GEOS
GEOS copied to clipboard
refactor: Add component selector for fluid models
In IsothermalCompositionalMultiphaseFVMKernels.hpp:2127-2157 and ThermalCompositionalMultiphaseFVMKernels.hpp:1397-1432, we have calls of the form
constitutive::constitutiveUpdatePassThru( fluidBase, [&]( auto & fluid )
{
using FluidType = TYPEOFREF( fluid );
// ...
isothermalCompositionalMultiphaseBaseKernels::internal::kernelLaunchSelectorCompSwitch( numComps, [&]( auto NC )
{
integer constexpr NUM_COMP = NC();
// ...
using kernelType = DirichletFaceBasedAssemblyKernel< NUM_COMP, NUM_DOF, typename FluidType::KernelWrapper >;
// ...
} );
} );
This expands over all available fluid types and within each expansion, we further expand over all possible numbers of components. The possible number of components is currently set to be from 1 to 5. However, not all fluid types support all these component numbers. For example the CO2BrineFluid
models support only 2 components. As such we end up here with unnecessary expansions. The end result of all these expansions is to make the CompositionalMultiphaseFVM
class extremely large to compile especially for CUDA builds. This is so bad that some of the fluid models have been commented out in MultiFluidSelector.hpp:39-58 just to be able to compile on GHA.
This PR tries to reduce the number of combinations by explicitly listing, for each fluid model, the number of components that it allows. The expansion is a combination of the fluid model type and number of components. Furthermore, not all fluid models support thermal simulations. So the thermal kernels are expanded only over those models that support thermal simulations.
Some other changes
- Each fluid model class is tagged with a static boolean
thermal()
method. - Some validation of the user input has been added to ensure that the number of components listed in
MultiFluidSelector
are honoured. - Added a couple of integrated tests to include the constant pressure boundary condition.