Skip to content

Commit

Permalink
Remove unnecessary loop (#3204)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkachuma authored and Algiane committed Jul 30, 2024
1 parent df77ead commit c741ad3
Showing 1 changed file with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -583,18 +583,15 @@ void CompositionalMultiphaseBase::validateConstitutiveModels( DomainPartition co
compareMultiphaseModels( fluid, referenceFluid );
compareMulticomponentModels( fluid, referenceFluid );

constitutiveUpdatePassThru( fluid, [&] ( auto & castedFluid )
{
bool const isFluidModelThermal = castedFluid.isThermal();
GEOS_THROW_IF( m_isThermal && !isFluidModelThermal,
GEOS_FMT( "CompositionalMultiphaseBase {}: the thermal option is enabled in the solver, but the fluid model {} is incompatible with the thermal option",
getDataContext(), fluid.getDataContext() ),
InputError );
GEOS_THROW_IF( !m_isThermal && isFluidModelThermal,
GEOS_FMT( "CompositionalMultiphaseBase {}: the thermal option is enabled in fluid model {}, but the solver options are incompatible with the thermal option",
getDataContext(), fluid.getDataContext() ),
InputError );
} );
bool const isFluidModelThermal = fluid.isThermal();
GEOS_THROW_IF( m_isThermal && !isFluidModelThermal,
GEOS_FMT( "CompositionalMultiphaseBase {}: the thermal option is enabled in the solver, but the fluid model {} is incompatible with the thermal option",
getDataContext(), fluid.getDataContext() ),
InputError );
GEOS_THROW_IF( !m_isThermal && isFluidModelThermal,
GEOS_FMT( "CompositionalMultiphaseBase {}: the thermal option is enabled in fluid model {}, but the solver options are incompatible with the thermal option",
getDataContext(), fluid.getDataContext() ),
InputError );

string const & relpermName = subRegion.getReference< string >( viewKeyStruct::relPermNamesString() );
RelativePermeabilityBase const & relPerm = getConstitutiveModel< RelativePermeabilityBase >( subRegion, relpermName );
Expand Down

0 comments on commit c741ad3

Please sign in to comment.