mirror of
				https://github.com/OPM/opm-simulators.git
				synced 2025-02-25 18:55:30 -06:00 
			
		
		
		
	changed: make has_brine contexpr
and use if constexpr to eliminate some code
This commit is contained in:
		@@ -115,7 +115,7 @@ namespace Opm
 | 
			
		||||
        // flag for polymer molecular weight related
 | 
			
		||||
        static const bool has_polymermw = getPropValue<TypeTag, Properties::EnablePolymerMW>();
 | 
			
		||||
        static constexpr bool has_foam = getPropValue<TypeTag, Properties::EnableFoam>();
 | 
			
		||||
        static const bool has_brine = getPropValue<TypeTag, Properties::EnableBrine>();
 | 
			
		||||
        static constexpr bool has_brine = getPropValue<TypeTag, Properties::EnableBrine>();
 | 
			
		||||
        static const int contiSolventEqIdx = Indices::contiSolventEqIdx;
 | 
			
		||||
        static const int contiZfracEqIdx = Indices::contiZfracEqIdx;
 | 
			
		||||
        static const int contiPolymerEqIdx = Indices::contiPolymerEqIdx;
 | 
			
		||||
 
 | 
			
		||||
@@ -422,10 +422,7 @@ namespace Opm
 | 
			
		||||
    WellInterface<TypeTag>::
 | 
			
		||||
    wsalt() const
 | 
			
		||||
    {
 | 
			
		||||
        if (!has_brine) {
 | 
			
		||||
            return 0.0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if constexpr (has_brine) {
 | 
			
		||||
            auto injectorType = well_ecl_.injectorType();
 | 
			
		||||
 | 
			
		||||
            if (injectorType == InjectorType::WATER) {
 | 
			
		||||
@@ -437,6 +434,9 @@ namespace Opm
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 0.0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user