diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp index 77fa7562fb3..3642e631124 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp @@ -41,8 +41,8 @@ class CO2SolubilityUpdate final : public FlashModelBaseUpdate { public: - using PhaseProp = MultiFluidVar< real64, 3, multifluid::LAYOUT_PHASE, multifluid::LAYOUT_PHASE_DC >; - using PhaseComp = MultiFluidVar< real64, 4, multifluid::LAYOUT_PHASE_COMP, multifluid::LAYOUT_PHASE_COMP_DC >; + using PhaseProp = MultiFluidVar< real64, 3 >; + using PhaseComp = MultiFluidVar< real64, 4 >; CO2SolubilityUpdate( arrayView1d< real64 const > const & componentMolarWeight, TableFunction const & CO2SolubilityTable, diff --git a/src/coreComponents/constitutive/fluid/multifluid/Layouts.hpp b/src/coreComponents/constitutive/fluid/multifluid/Layouts.hpp index 894fa58d041..b4427e9d537 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/Layouts.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/Layouts.hpp @@ -22,7 +22,6 @@ #include "common/DataTypes.hpp" #include "common/GeosxConfig.hpp" -#include "LvArray/src/typeManipulation.hpp" #include "RAJA/RAJA.hpp" namespace geos @@ -32,7 +31,7 @@ namespace constitutive namespace multifluid { -/// indices of pressure, temperature, and composition derivatives +/// Indices of pressure, temperature, and composition derivatives struct DerivativeOffset { /// index of derivative wrt pressure @@ -43,56 +42,85 @@ struct DerivativeOffset static integer constexpr dC = 2; }; +// Data layout depends on the number of dimensions of the data +template< int NDIM > +struct Layout +{ + using PERM = RAJA::PERM_I; +}; + #if defined( GEOS_USE_DEVICE ) -/// Constitutive model phase property array layout -using LAYOUT_PHASE = RAJA::PERM_JKI; -/// Constitutive model phase property compositional derivative array layout -using LAYOUT_PHASE_DC = RAJA::PERM_JKLI; +template<> struct Layout< 2 > +{ + using PERM = RAJA::PERM_JI; +}; +template<> struct Layout< 3 > +{ + using PERM = RAJA::PERM_JKI; +}; +template<> struct Layout< 4 > +{ + using PERM = RAJA::PERM_JKLI; +}; +template<> struct Layout< 5 > +{ + using PERM = RAJA::PERM_JKLMI; +}; + +#else + +template<> struct Layout< 2 > +{ + using PERM = RAJA::PERM_IJ; +}; +template<> struct Layout< 3 > +{ + using PERM = RAJA::PERM_IJK; +}; +template<> struct Layout< 4 > +{ + using PERM = RAJA::PERM_IJKL; +}; +template<> struct Layout< 5 > +{ + using PERM = RAJA::PERM_IJKLM; +}; -/// Constitutive model phase composition array layout -using LAYOUT_PHASE_COMP = RAJA::PERM_JKLI; -/// Constitutive model phase composition compositional derivative array layout -using LAYOUT_PHASE_COMP_DC = RAJA::PERM_JKLMI; +#endif -/// Constitutive model fluid property array layout -using LAYOUT_FLUID = RAJA::PERM_JI; -/// Constitutive model fluid property compositional derivative array layout -using LAYOUT_FLUID_DC = RAJA::PERM_JKI; +namespace internal +{ -#else +template< typename T, int DIM, int USD > +struct ArraySliceOrRefHelper +{ + using type = geos::ArraySlice< T, DIM, USD >; +}; -/// Constitutive model phase property array layout -using LAYOUT_PHASE = RAJA::PERM_IJK; -/// Constitutive model phase property compositional derivative array layout -using LAYOUT_PHASE_DC = RAJA::PERM_IJKL; +// an array slice of DIM=0 decays to a reference to scalar +template< typename T, int USD > +struct ArraySliceOrRefHelper< T, 0, USD > +{ + using type = T &; +}; -/// Constitutive model phase composition array layout -using LAYOUT_PHASE_COMP = RAJA::PERM_IJKL; -/// Constitutive model phase composition compositional derivative array layout -using LAYOUT_PHASE_COMP_DC = RAJA::PERM_IJKLM; +template< typename T, int DIM, int USD=DIM-1 > +using ArraySliceOrRef = typename ArraySliceOrRefHelper< T, DIM, USD >::type; -/// Constitutive model fluid property array layout -using LAYOUT_FLUID = RAJA::PERM_IJ; -/// Constitutive model fluid property compositional derivative array layout -using LAYOUT_FLUID_DC = RAJA::PERM_IJK; +} // namespace internal -#endif +template< typename T, int NDIM > +using Array = geos::Array< T, NDIM, typename Layout< NDIM >::PERM >; -/// Constitutive model phase property unit stride dimension -static constexpr int USD_PHASE = LvArray::typeManipulation::getStrideOneDimension( LAYOUT_PHASE{} ); -/// Constitutive model phase property compositional derivative unit stride dimension -static constexpr int USD_PHASE_DC = LvArray::typeManipulation::getStrideOneDimension( LAYOUT_PHASE_DC{} ); +template< typename T, int NDIM, localIndex CAPACITY > +using StackArray = geos::StackArray< T, NDIM, CAPACITY, typename Layout< NDIM >::PERM >; -/// Constitutive model phase composition unit stride dimension -static constexpr int USD_PHASE_COMP = LvArray::typeManipulation::getStrideOneDimension( LAYOUT_PHASE_COMP{} ); -/// Constitutive model phase composition compositional derivative unit stride dimension -static constexpr int USD_PHASE_COMP_DC = LvArray::typeManipulation::getStrideOneDimension( LAYOUT_PHASE_COMP_DC{} ); +template< typename T, int NDIM > +using ArrayView = geos::ArrayView< T, NDIM, getUSD< typename Layout< NDIM >::PERM > >; -/// Constitutive model fluid property unit stride dimension -static constexpr int USD_FLUID = LvArray::typeManipulation::getStrideOneDimension( LAYOUT_FLUID{} ); -/// Constitutive model fluid property compositional derivative unit stride dimension -static constexpr int USD_FLUID_DC = LvArray::typeManipulation::getStrideOneDimension( LAYOUT_FLUID_DC{} ); +template< typename T, int NDIM > +using ArraySlice = internal::ArraySliceOrRef< T, NDIM, getUSD< typename Layout< NDIM >::PERM > >; } // namespace multifluid } // namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp index 139e8507a01..61e06b7d3f7 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.cpp @@ -206,11 +206,11 @@ void MultiFluidBase::saveConvergedState() const PhaseProp::ViewTypeConst const phaseInternalEnergy = m_phaseInternalEnergy.toViewConst(); PhaseComp::ViewTypeConst const phaseCompFraction = m_phaseCompFraction.toViewConst(); - arrayView2d< real64, multifluid::USD_FLUID > const totalDensity_n = m_totalDensity_n.toView(); - arrayView3d< real64, multifluid::USD_PHASE > const phaseDensity_n = m_phaseDensity_n.toView(); - arrayView3d< real64, multifluid::USD_PHASE > const phaseEnthalpy_n = m_phaseEnthalpy_n.toView(); - arrayView3d< real64, multifluid::USD_PHASE > const phaseInternalEnergy_n = m_phaseInternalEnergy_n.toView(); - arrayView4d< real64, multifluid::USD_PHASE_COMP > const phaseCompFraction_n = m_phaseCompFraction_n.toView(); + multifluid::ArrayView< real64, 2 > const totalDensity_n = m_totalDensity_n.toView(); + multifluid::ArrayView< real64, 3 > const phaseDensity_n = m_phaseDensity_n.toView(); + multifluid::ArrayView< real64, 3 > const phaseEnthalpy_n = m_phaseEnthalpy_n.toView(); + multifluid::ArrayView< real64, 3 > const phaseInternalEnergy_n = m_phaseInternalEnergy_n.toView(); + multifluid::ArrayView< real64, 4 > const phaseCompFraction_n = m_phaseCompFraction_n.toView(); forAll< parallelDevicePolicy<> >( numElem, [=] GEOS_HOST_DEVICE ( localIndex const k ) { diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp index a221fa6ed0b..b5ebbe66ef4 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidBase.hpp @@ -21,7 +21,6 @@ #include "common/DataLayouts.hpp" #include "constitutive/ConstitutiveBase.hpp" -#include "constitutive/fluid/multifluid/Layouts.hpp" #include "constitutive/fluid/multifluid/MultiFluidConstants.hpp" #include "constitutive/fluid/multifluid/MultiFluidUtils.hpp" @@ -113,67 +112,67 @@ class MultiFluidBase : public ConstitutiveBase */ void setMassFlag( bool const flag ) { m_useMass = flag; } - arrayView3d< real64 const, multifluid::USD_PHASE > phaseFraction() const + multifluid::ArrayView< real64 const, 3 > phaseFraction() const { return m_phaseFraction.value; } - arrayView4d< real64 const, multifluid::USD_PHASE_DC > dPhaseFraction() const + multifluid::ArrayView< real64 const, 4 > dPhaseFraction() const { return m_phaseFraction.derivs; } - arrayView3d< real64 const, multifluid::USD_PHASE > phaseDensity() const + multifluid::ArrayView< real64 const, 3 > phaseDensity() const { return m_phaseDensity.value; } - arrayView3d< real64 const, multifluid::USD_PHASE > phaseDensity_n() const + multifluid::ArrayView< real64 const, 3 > phaseDensity_n() const { return m_phaseDensity_n; } - arrayView4d< real64 const, multifluid::USD_PHASE_DC > dPhaseDensity() const + multifluid::ArrayView< real64 const, 4 > dPhaseDensity() const { return m_phaseDensity.derivs; } - arrayView3d< real64 const, multifluid::USD_PHASE > phaseMassDensity() const + multifluid::ArrayView< real64 const, 3 > phaseMassDensity() const { return m_phaseMassDensity.value; } - arrayView4d< real64 const, multifluid::USD_PHASE_DC > dPhaseMassDensity() const + multifluid::ArrayView< real64 const, 4 > dPhaseMassDensity() const { return m_phaseMassDensity.derivs; } - arrayView3d< real64 const, multifluid::USD_PHASE > phaseViscosity() const + multifluid::ArrayView< real64 const, 3 > phaseViscosity() const { return m_phaseViscosity.value; } - arrayView4d< real64 const, multifluid::USD_PHASE_DC > dPhaseViscosity() const + multifluid::ArrayView< real64 const, 4 > dPhaseViscosity() const { return m_phaseViscosity.derivs; } - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > phaseCompFraction() const + multifluid::ArrayView< real64 const, 4 > phaseCompFraction() const { return m_phaseCompFraction.value; } - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > phaseCompFraction_n() const + multifluid::ArrayView< real64 const, 4 > phaseCompFraction_n() const { return m_phaseCompFraction_n; } - arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > dPhaseCompFraction() const + multifluid::ArrayView< real64 const, 5 > dPhaseCompFraction() const { return m_phaseCompFraction.derivs; } - arrayView2d< real64 const, multifluid::USD_FLUID > totalDensity() const + multifluid::ArrayView< real64 const, 2 > totalDensity() const { return m_totalDensity.value; } - arrayView2d< real64 const, multifluid::USD_FLUID > totalDensity_n() const + multifluid::ArrayView< real64 const, 2 > totalDensity_n() const { return m_totalDensity_n; } - arrayView3d< real64 const, multifluid::USD_FLUID_DC > dTotalDensity() const + multifluid::ArrayView< real64 const, 3 > dTotalDensity() const { return m_totalDensity.derivs; } - arrayView3d< real64 const, multifluid::USD_PHASE > phaseEnthalpy() const + multifluid::ArrayView< real64 const, 3 > phaseEnthalpy() const { return m_phaseEnthalpy.value; } - arrayView3d< real64 const, multifluid::USD_PHASE > phaseEnthalpy_n() const + multifluid::ArrayView< real64 const, 3 > phaseEnthalpy_n() const { return m_phaseEnthalpy_n; } - arrayView4d< real64 const, multifluid::USD_PHASE_DC > dPhaseEnthalpy() const + multifluid::ArrayView< real64 const, 4 > dPhaseEnthalpy() const { return m_phaseEnthalpy.derivs; } - arrayView3d< real64 const, multifluid::USD_PHASE > phaseInternalEnergy() const + multifluid::ArrayView< real64 const, 3 > phaseInternalEnergy() const { return m_phaseInternalEnergy.value; } - arrayView3d< real64 const, multifluid::USD_PHASE > phaseInternalEnergy_n() const + multifluid::ArrayView< real64 const, 3 > phaseInternalEnergy_n() const { return m_phaseInternalEnergy_n; } - arrayView4d< real64 const, multifluid::USD_PHASE_DC > dPhaseInternalEnergy() const + multifluid::ArrayView< real64 const, 4 > dPhaseInternalEnergy() const { return m_phaseInternalEnergy.derivs; } /** @@ -207,9 +206,9 @@ class MultiFluidBase : public ConstitutiveBase public: - using PhaseProp = MultiFluidVar< real64, 3, multifluid::LAYOUT_PHASE, multifluid::LAYOUT_PHASE_DC >; - using PhaseComp = MultiFluidVar< real64, 4, multifluid::LAYOUT_PHASE_COMP, multifluid::LAYOUT_PHASE_COMP_DC >; - using FluidProp = MultiFluidVar< real64, 2, multifluid::LAYOUT_FLUID, multifluid::LAYOUT_FLUID_DC >; + using PhaseProp = MultiFluidVar< real64, 3 >; + using PhaseComp = MultiFluidVar< real64, 4 >; + using FluidProp = MultiFluidVar< real64, 2 >; public: class KernelWrapper @@ -256,28 +255,28 @@ class MultiFluidBase : public ConstitutiveBase GEOS_FORCE_INLINE integer numPhases() const { return LvArray::integerConversion< integer >( m_phaseFraction.value.size( 2 ) ); } - GEOS_HOST_DEVICE arrayView3d< real64 const, multifluid::USD_PHASE > phaseFraction() const + GEOS_HOST_DEVICE multifluid::ArrayView< real64 const, 3 > phaseFraction() const { return m_phaseFraction.value; } - GEOS_HOST_DEVICE arrayView3d< real64 const, multifluid::USD_PHASE > phaseDensity() const + GEOS_HOST_DEVICE multifluid::ArrayView< real64 const, 3 > phaseDensity() const { return m_phaseDensity.value; } - GEOS_HOST_DEVICE arrayView3d< real64 const, multifluid::USD_PHASE > phaseMassDensity() const + GEOS_HOST_DEVICE multifluid::ArrayView< real64 const, 3 > phaseMassDensity() const { return m_phaseMassDensity.value; } - GEOS_HOST_DEVICE arrayView3d< real64 const, multifluid::USD_PHASE > phaseViscosity() const + GEOS_HOST_DEVICE multifluid::ArrayView< real64 const, 3 > phaseViscosity() const { return m_phaseViscosity.value; } - GEOS_HOST_DEVICE arrayView4d< real64 const, multifluid::USD_PHASE_COMP > phaseCompFraction() const + GEOS_HOST_DEVICE multifluid::ArrayView< real64 const, 4 > phaseCompFraction() const { return m_phaseCompFraction.value; } - GEOS_HOST_DEVICE arrayView2d< real64 const, multifluid::USD_FLUID > totalDensity() const + GEOS_HOST_DEVICE multifluid::ArrayView< real64 const, 2 > totalDensity() const { return m_totalDensity.value; } - GEOS_HOST_DEVICE arrayView3d< real64 const, multifluid::USD_PHASE > phaseEnthalpy() const + GEOS_HOST_DEVICE multifluid::ArrayView< real64 const, 3 > phaseEnthalpy() const { return m_phaseEnthalpy.value; } - GEOS_HOST_DEVICE arrayView3d< real64 const, multifluid::USD_PHASE > phaseInternalEnergy() const + GEOS_HOST_DEVICE multifluid::ArrayView< real64 const, 3 > phaseInternalEnergy() const { return m_phaseInternalEnergy.value; } /** @@ -303,13 +302,13 @@ class MultiFluidBase : public ConstitutiveBase real64 const pressure, real64 const temperature, arraySlice1d< real64 const, compflow::USD_COMP - 1 > const & composition, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseFraction, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseDensity, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseMassDensity, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseViscosity, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseEnthalpy, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseInternalEnergy, - arraySlice2d< real64, multifluid::USD_PHASE_COMP-2 > const & phaseCompFraction, + multifluid::ArraySlice< real64, 1 > const & phaseFraction, + multifluid::ArraySlice< real64, 1 > const & phaseDensity, + multifluid::ArraySlice< real64, 1 > const & phaseMassDensity, + multifluid::ArraySlice< real64, 1 > const & phaseViscosity, + multifluid::ArraySlice< real64, 1 > const & phaseEnthalpy, + multifluid::ArraySlice< real64, 1 > const & phaseInternalEnergy, + multifluid::ArraySlice< real64, 2 > const & phaseCompFraction, real64 & totalDensity ); protected: @@ -389,8 +388,8 @@ class MultiFluidBase : public ConstitutiveBase template< integer maxNumComp, integer maxNumPhase > GEOS_HOST_DEVICE void convertToMassFractions( real64 const (&phaseMolecularWeight)[maxNumPhase], - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseFrac, - arraySlice2d< real64, multifluid::USD_PHASE_COMP - 2 > const phaseCompFrac ) const; + multifluid::ArraySlice< real64, 1 > const phaseFrac, + multifluid::ArraySlice< real64, 2 > const phaseCompFrac ) const; /** * @brief Utility function to convert mole fractions to mass fractions and keep derivatives @@ -417,10 +416,10 @@ class MultiFluidBase : public ConstitutiveBase real64 const (&dPhaseMolecularWeight)[maxNumPhase][maxNumComp+2], PhaseProp::SliceType const phaseFrac, PhaseComp::SliceType const phaseCompFrac, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseDens, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseVisc, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseEnthalpy, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseInternalEnergy ) const; + multifluid::ArraySlice< real64, 2 > const dPhaseDens, + multifluid::ArraySlice< real64, 2 > const dPhaseVisc, + multifluid::ArraySlice< real64, 2 > const dPhaseEnthalpy, + multifluid::ArraySlice< real64, 2 > const dPhaseInternalEnergy ) const; /** * @brief Utility function to compute the internal energy from pressure, enthalpy, and density @@ -435,10 +434,10 @@ class MultiFluidBase : public ConstitutiveBase template< integer maxNumComp, integer maxNumPhase > GEOS_HOST_DEVICE void computeInternalEnergy( real64 const & pressure, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseFrac, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseMassDens, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseEnthalpy, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseInternalEnergy ) const; + multifluid::ArraySlice< real64, 1 > const phaseFrac, + multifluid::ArraySlice< real64, 1 > const phaseMassDens, + multifluid::ArraySlice< real64, 1 > const phaseEnthalpy, + multifluid::ArraySlice< real64, 1 > const phaseInternalEnergy ) const; /** * @brief Utility function to compute the internal energy from pressure, enthalpy, and density and keep derivatives @@ -465,8 +464,8 @@ class MultiFluidBase : public ConstitutiveBase */ template< integer maxNumComp, integer maxNumPhase > GEOS_HOST_DEVICE - void computeTotalDensity( arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseFrac, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseDens, + void computeTotalDensity( multifluid::ArraySlice< real64, 1 > const phaseFrac, + multifluid::ArraySlice< real64, 1 > const phaseDens, real64 & totalDens ) const; /** @@ -585,10 +584,10 @@ class MultiFluidBase : public ConstitutiveBase void computeDerivativesWrtMassFractions( real64 const (&dCompMoleFrac_dCompMassFrac)[maxNumComp][maxNumComp], PhaseProp::SliceType const phaseFrac, PhaseComp::SliceType const phaseCompFrac, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseDens, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseVisc, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseEnthalpy, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseInternalEnergy ) const; + multifluid::ArraySlice< real64, 2 > const dPhaseDens, + multifluid::ArraySlice< real64, 2 > const dPhaseVisc, + multifluid::ArraySlice< real64, 2 > const dPhaseEnthalpy, + multifluid::ArraySlice< real64, 2 > const dPhaseInternalEnergy ) const; /** * @brief Main compute function to update properties in a cell with derivatives (used in Newton iterations) @@ -678,11 +677,11 @@ class MultiFluidBase : public ConstitutiveBase // backup data - array3d< real64, multifluid::LAYOUT_PHASE > m_phaseDensity_n; - array3d< real64, multifluid::LAYOUT_PHASE > m_phaseEnthalpy_n; - array3d< real64, multifluid::LAYOUT_PHASE > m_phaseInternalEnergy_n; - array4d< real64, multifluid::LAYOUT_PHASE_COMP > m_phaseCompFraction_n; - array2d< real64, multifluid::LAYOUT_FLUID > m_totalDensity_n; + multifluid::Array< real64, 3 > m_phaseDensity_n; + multifluid::Array< real64, 3 > m_phaseEnthalpy_n; + multifluid::Array< real64, 3 > m_phaseInternalEnergy_n; + multifluid::Array< real64, 4 > m_phaseCompFraction_n; + multifluid::Array< real64, 2 > m_totalDensity_n; }; @@ -693,13 +692,13 @@ MultiFluidBase::KernelWrapper::computeValues( FLUIDWRAPPER const fluidWrapper, real64 const pressure, real64 const temperature, arraySlice1d< real64 const, compflow::USD_COMP - 1 > const & composition, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseFraction, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseDensity, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseMassDensity, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseViscosity, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseEnthalpy, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const & phaseInternalEnergy, - arraySlice2d< real64, multifluid::USD_PHASE_COMP-2 > const & phaseCompFraction, + multifluid::ArraySlice< real64, 1 > const & phaseFraction, + multifluid::ArraySlice< real64, 1 > const & phaseDensity, + multifluid::ArraySlice< real64, 1 > const & phaseMassDensity, + multifluid::ArraySlice< real64, 1 > const & phaseViscosity, + multifluid::ArraySlice< real64, 1 > const & phaseEnthalpy, + multifluid::ArraySlice< real64, 1 > const & phaseInternalEnergy, + multifluid::ArraySlice< real64, 2 > const & phaseCompFraction, real64 & totalDensity ) { integer constexpr maxNumPhase = MAX_NUM_PHASES; @@ -711,9 +710,9 @@ MultiFluidBase::KernelWrapper::computeValues( FLUIDWRAPPER const fluidWrapper, // Allocate data for derivatives. All properties of the same type will use the same memory // space for the derivatives. The derivatives returned will clearly be garbage but the values // should be correct. - StackArray< real64, 4, maxNumDof * maxNumPhase, multifluid::LAYOUT_PHASE_DC > dPhaseProp( 1, 1, numPhase, numComp+2 ); - StackArray< real64, 5, maxNumDof * maxNumComp * maxNumPhase, multifluid::LAYOUT_PHASE_COMP_DC > dPhaseComp( 1, 1, numPhase, numComp, numComp+2 ); - StackArray< real64, 3, maxNumDof, multifluid::LAYOUT_FLUID_DC > dFluidProp( 1, 1, numComp+2 ); + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseProp( 1, 1, numPhase, numComp+2 ); + multifluid::StackArray< real64, 5, maxNumDof*maxNumComp*maxNumPhase > dPhaseComp( 1, 1, numPhase, numComp, numComp+2 ); + multifluid::StackArray< real64, 3, maxNumDof > dFluidProp( 1, 1, numComp+2 ); // Wrap the output in multi variable objects PhaseProp::SliceType phaseFractionWrapper { phaseFraction, dPhaseProp[0][0] }; @@ -793,11 +792,9 @@ GEOS_FORCE_INLINE void MultiFluidBase::KernelWrapper:: convertToMassFractions( real64 const (&phaseMolecularWeight)[maxNumPhase], - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseFrac, - arraySlice2d< real64, multifluid::USD_PHASE_COMP - 2 > const phaseCompFrac ) const + multifluid::ArraySlice< real64, 1 > const phaseFrac, + multifluid::ArraySlice< real64, 2 > const phaseCompFrac ) const { - using namespace multifluid; - integer constexpr maxNumDof = maxNumComp + 2; integer const numPhase = numPhases(); integer const numComp = numComponents(); @@ -805,18 +802,18 @@ MultiFluidBase::KernelWrapper:: real64 dCompMoleFrac_dCompMassFrac[maxNumComp][maxNumComp]{}; real64 dPhaseMolecularWeight[maxNumPhase][maxNumDof]{}; - StackArray< real64, 4, maxNumDof *maxNumPhase, LAYOUT_PHASE_DC > dPhaseFrac( 1, 1, numPhase, numComp+2 ); - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseFrac( 1, 1, numPhase, numComp+2 ); + MultiFluidVarSlice< real64, 1 > phaseFracAndDeriv { phaseFrac, dPhaseFrac[0][0] }; - StackArray< real64, 5, maxNumDof *maxNumComp *maxNumPhase, LAYOUT_PHASE_COMP_DC > dPhaseCompFrac( 1, 1, numPhase, numComp, numComp+2 ); - MultiFluidVarSlice< real64, 2, USD_PHASE_COMP - 2, USD_PHASE_COMP_DC - 2 > + multifluid::StackArray< real64, 5, maxNumDof*maxNumComp*maxNumPhase > dPhaseCompFrac( 1, 1, numPhase, numComp, numComp+2 ); + MultiFluidVarSlice< real64, 2 > phaseCompFracAndDeriv { phaseCompFrac, dPhaseCompFrac[0][0] }; - StackArray< real64, 4, maxNumDof *maxNumPhase, LAYOUT_PHASE_DC > dPhaseDens( 1, 1, numPhase, numComp+2 ); - StackArray< real64, 4, maxNumDof *maxNumPhase, LAYOUT_PHASE_DC > dPhaseVisc( 1, 1, numPhase, numComp+2 ); - StackArray< real64, 4, maxNumDof *maxNumPhase, LAYOUT_PHASE_DC > dPhaseEnthalpy( 1, 1, numPhase, numComp+2 ); - StackArray< real64, 4, maxNumDof *maxNumPhase, LAYOUT_PHASE_DC > dPhaseInternalEnergy( 1, 1, numPhase, numComp+2 ); + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseDens( 1, 1, numPhase, numComp+2 ); + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseVisc( 1, 1, numPhase, numComp+2 ); + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseEnthalpy( 1, 1, numPhase, numComp+2 ); + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseInternalEnergy( 1, 1, numPhase, numComp+2 ); convertToMassFractions( dCompMoleFrac_dCompMassFrac, phaseMolecularWeight, @@ -839,10 +836,10 @@ MultiFluidBase::KernelWrapper:: real64 const (&dPhaseMolecularWeight)[maxNumPhase][maxNumComp+2], PhaseProp::SliceType const phaseFrac, PhaseComp::SliceType const phaseCompFrac, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseDens, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseVisc, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseEnthalpy, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseInternalEnergy ) const + multifluid::ArraySlice< real64, 2 > const dPhaseDens, + multifluid::ArraySlice< real64, 2 > const dPhaseVisc, + multifluid::ArraySlice< real64, 2 > const dPhaseEnthalpy, + multifluid::ArraySlice< real64, 2 > const dPhaseInternalEnergy ) const { convertToPhaseMassFractions( phaseMolecularWeight, dPhaseMolecularWeight, @@ -970,10 +967,10 @@ MultiFluidBase::KernelWrapper:: computeDerivativesWrtMassFractions( real64 const (&dCompMoleFrac_dCompMassFrac)[maxNumComp][maxNumComp], PhaseProp::SliceType const phaseFrac, PhaseComp::SliceType const phaseCompFrac, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseDens, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseVisc, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseEnthalpy, - arraySlice2d< real64, multifluid::USD_PHASE_DC - 2 > const dPhaseInternalEnergy ) const + multifluid::ArraySlice< real64, 2 > const dPhaseDens, + multifluid::ArraySlice< real64, 2 > const dPhaseVisc, + multifluid::ArraySlice< real64, 2 > const dPhaseEnthalpy, + multifluid::ArraySlice< real64, 2 > const dPhaseInternalEnergy ) const { using Deriv = multifluid::DerivativeOffset; @@ -1002,31 +999,29 @@ GEOS_FORCE_INLINE void MultiFluidBase::KernelWrapper:: computeInternalEnergy( real64 const & pressure, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseFrac, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseMassDens, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseEnthalpy, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseInternalEnergy ) const + multifluid::ArraySlice< real64, 1 > const phaseFrac, + multifluid::ArraySlice< real64, 1 > const phaseMassDens, + multifluid::ArraySlice< real64, 1 > const phaseEnthalpy, + multifluid::ArraySlice< real64, 1 > const phaseInternalEnergy ) const { - using namespace multifluid; - integer constexpr maxNumDof = maxNumComp + 2; integer const numPhase = numPhases(); integer const numComp = numComponents(); - StackArray< real64, 4, maxNumDof *maxNumPhase, LAYOUT_PHASE_DC > dPhaseFrac( 1, 1, numPhase, numComp+2 ); - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseFrac( 1, 1, numPhase, numComp+2 ); + MultiFluidVarSlice< real64, 1 > phaseFracAndDeriv { phaseFrac, dPhaseFrac[0][0] }; - StackArray< real64, 4, maxNumDof *maxNumPhase, LAYOUT_PHASE_DC > dPhaseMassDens( 1, 1, numPhase, numComp+2 ); - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseMassDens( 1, 1, numPhase, numComp+2 ); + MultiFluidVarSlice< real64, 1 > phaseMassDensAndDeriv { phaseMassDens, dPhaseMassDens[0][0] }; - StackArray< real64, 4, maxNumDof *maxNumPhase, LAYOUT_PHASE_DC > dPhaseEnthalpy( 1, 1, numPhase, numComp+2 ); - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseEnthalpy( 1, 1, numPhase, numComp+2 ); + MultiFluidVarSlice< real64, 1 > phaseEnthalpyAndDeriv { phaseEnthalpy, dPhaseEnthalpy[0][0] }; - StackArray< real64, 4, maxNumDof *maxNumPhase, LAYOUT_PHASE_DC > dPhaseInternalEnergy( 1, 1, numPhase, numComp+2 ); - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseInternalEnergy( 1, 1, numPhase, numComp+2 ); + MultiFluidVarSlice< real64, 1 > phaseInternalEnergyAndDeriv { phaseInternalEnergy, dPhaseInternalEnergy[0][0] }; computeInternalEnergy( pressure, @@ -1071,24 +1066,22 @@ template< integer maxNumComp, integer maxNumPhase > GEOS_HOST_DEVICE inline void MultiFluidBase::KernelWrapper:: - computeTotalDensity( arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseFrac, - arraySlice1d< real64, multifluid::USD_PHASE - 2 > const phaseDens, + computeTotalDensity( multifluid::ArraySlice< real64, 1 > const phaseFrac, + multifluid::ArraySlice< real64, 1 > const phaseDens, real64 & totalDens ) const { - using namespace multifluid; - integer constexpr maxNumDof = maxNumComp + 2; integer const numPhase = numPhases(); integer const numComp = numComponents(); - StackArray< real64, 3, maxNumDof, LAYOUT_FLUID_DC > dTotalDens( 1, 1, numComp+2 ); - MultiFluidVarSlice< real64, 0, USD_FLUID - 2, USD_FLUID_DC - 2 > totalDensAndDeriv { totalDens, dTotalDens[0][0] }; + multifluid::StackArray< real64, 3, maxNumDof > dTotalDens( 1, 1, numComp+2 ); + MultiFluidVarSlice< real64, 0 > totalDensAndDeriv { totalDens, dTotalDens[0][0] }; - StackArray< real64, 4, maxNumDof *maxNumPhase, LAYOUT_PHASE_DC > dPhaseFrac( 1, 1, numPhase, numComp+2 ); - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > phaseFracAndDeriv { phaseFrac, dPhaseFrac[0][0] }; + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseFrac( 1, 1, numPhase, numComp+2 ); + MultiFluidVarSlice< real64, 1 > phaseFracAndDeriv { phaseFrac, dPhaseFrac[0][0] }; - StackArray< real64, 4, maxNumDof *maxNumPhase, LAYOUT_PHASE_DC > dPhaseDens( 1, 1, numPhase, numComp+2 ); - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > phaseDensAndDeriv { phaseDens, dPhaseDens[0][0] }; + multifluid::StackArray< real64, 4, maxNumDof*maxNumPhase > dPhaseDens( 1, 1, numPhase, numComp+2 ); + MultiFluidVarSlice< real64, 1 > phaseDensAndDeriv { phaseDens, dPhaseDens[0][0] }; computeTotalDensity( phaseFracAndDeriv, phaseDensAndDeriv, diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidFields.hpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidFields.hpp index 66ef6fee67f..4f24f69f5bf 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidFields.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidFields.hpp @@ -20,6 +20,7 @@ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUIDFIELDS_HPP_ #include "constitutive/fluid/multifluid/Layouts.hpp" +#include "constitutive/fluid/multifluid/MultiFluidUtils.hpp" #include "mesh/MeshFields.hpp" namespace geos @@ -31,16 +32,14 @@ namespace fields namespace multifluid { -using array2dLayoutFluid = array2d< real64, constitutive::multifluid::LAYOUT_FLUID >; -using array3dLayoutFluid_dC = array3d< real64, constitutive::multifluid::LAYOUT_FLUID_DC >; -using array3dLayoutPhase = array3d< real64, constitutive::multifluid::LAYOUT_PHASE >; -using array4dLayoutPhase_dC = array4d< real64, constitutive::multifluid::LAYOUT_PHASE_DC >; -using array4dLayoutPhaseComp = array4d< real64, constitutive::multifluid::LAYOUT_PHASE_COMP >; -using array5dLayoutPhaseComp_dC = array5d< real64, constitutive::multifluid::LAYOUT_PHASE_COMP_DC >; +using array2dLayout = Array< real64, 2 >; +using array3dLayout = Array< real64, 3 >; +using array4dLayout = Array< real64, 4 >; +using array5dLayout = Array< real64, 5 >; DECLARE_FIELD( phaseFraction, "phaseFraction", - array3dLayoutPhase, + array3dLayout, 0, LEVEL_0, WRITE_AND_READ, @@ -48,7 +47,7 @@ DECLARE_FIELD( phaseFraction, DECLARE_FIELD( dPhaseFraction, "dPhaseFraction", - array4dLayoutPhase_dC, + array4dLayout, 0, NOPLOT, NO_WRITE, @@ -56,7 +55,7 @@ DECLARE_FIELD( dPhaseFraction, DECLARE_FIELD( phaseDensity, "phaseDensity", - array3dLayoutPhase, + array3dLayout, 0, LEVEL_0, WRITE_AND_READ, @@ -64,7 +63,7 @@ DECLARE_FIELD( phaseDensity, DECLARE_FIELD( phaseDensity_n, "phaseDensity_n", - array3dLayoutPhase, + array3dLayout, 0, NOPLOT, WRITE_AND_READ, @@ -72,7 +71,7 @@ DECLARE_FIELD( phaseDensity_n, DECLARE_FIELD( dPhaseDensity, "dPhaseDensity", - array4dLayoutPhase_dC, + array4dLayout, 0, NOPLOT, NO_WRITE, @@ -80,7 +79,7 @@ DECLARE_FIELD( dPhaseDensity, DECLARE_FIELD( phaseMassDensity, "phaseMassDensity", - array3dLayoutPhase, + array3dLayout, 0, LEVEL_0, WRITE_AND_READ, @@ -88,7 +87,7 @@ DECLARE_FIELD( phaseMassDensity, DECLARE_FIELD( dPhaseMassDensity, "dPhaseMassDensity", - array4dLayoutPhase_dC, + array4dLayout, 0, NOPLOT, NO_WRITE, @@ -96,7 +95,7 @@ DECLARE_FIELD( dPhaseMassDensity, DECLARE_FIELD( phaseViscosity, "phaseViscosity", - array3dLayoutPhase, + array3dLayout, 0, LEVEL_0, WRITE_AND_READ, @@ -104,7 +103,7 @@ DECLARE_FIELD( phaseViscosity, DECLARE_FIELD( dPhaseViscosity, "dPhaseViscosity", - array4dLayoutPhase_dC, + array4dLayout, 0, NOPLOT, NO_WRITE, @@ -112,7 +111,7 @@ DECLARE_FIELD( dPhaseViscosity, DECLARE_FIELD( phaseEnthalpy, "phaseEnthalpy", - array3dLayoutPhase, + array3dLayout, 0, NOPLOT, // default behavior overridden by thermal models NO_WRITE, @@ -120,7 +119,7 @@ DECLARE_FIELD( phaseEnthalpy, DECLARE_FIELD( phaseEnthalpy_n, "phaseEnthalpy_n", - array3dLayoutPhase, + array3dLayout, 0, NOPLOT, WRITE_AND_READ, @@ -128,7 +127,7 @@ DECLARE_FIELD( phaseEnthalpy_n, DECLARE_FIELD( dPhaseEnthalpy, "dPhaseEnthalpy", - array4dLayoutPhase_dC, + array4dLayout, 0, NOPLOT, NO_WRITE, @@ -136,7 +135,7 @@ DECLARE_FIELD( dPhaseEnthalpy, DECLARE_FIELD( phaseInternalEnergy, "phaseInternalEnergy", - array3dLayoutPhase, + array3dLayout, 0, NOPLOT, // default behavior overridden by thermal models NO_WRITE, @@ -144,7 +143,7 @@ DECLARE_FIELD( phaseInternalEnergy, DECLARE_FIELD( phaseInternalEnergy_n, "phaseInternalEnergy_n", - array3dLayoutPhase, + array3dLayout, 0, NOPLOT, WRITE_AND_READ, @@ -152,7 +151,7 @@ DECLARE_FIELD( phaseInternalEnergy_n, DECLARE_FIELD( dPhaseInternalEnergy, "dPhaseInternalEnergy", - array4dLayoutPhase_dC, + array4dLayout, 0, NOPLOT, NO_WRITE, @@ -160,7 +159,7 @@ DECLARE_FIELD( dPhaseInternalEnergy, DECLARE_FIELD( phaseCompFraction, "phaseCompFraction", - array4dLayoutPhaseComp, + array4dLayout, 0, LEVEL_0, WRITE_AND_READ, @@ -168,7 +167,7 @@ DECLARE_FIELD( phaseCompFraction, DECLARE_FIELD( phaseCompFraction_n, "phaseCompFraction_n", - array4dLayoutPhaseComp, + array4dLayout, 0, NOPLOT, WRITE_AND_READ, @@ -176,7 +175,7 @@ DECLARE_FIELD( phaseCompFraction_n, DECLARE_FIELD( dPhaseCompFraction, "dPhaseCompFraction", - array5dLayoutPhaseComp_dC, + array5dLayout, 0, NOPLOT, NO_WRITE, @@ -184,7 +183,7 @@ DECLARE_FIELD( dPhaseCompFraction, DECLARE_FIELD( totalDensity, "totalDensity", - array2dLayoutFluid, + array2dLayout, 0, LEVEL_0, WRITE_AND_READ, @@ -192,7 +191,7 @@ DECLARE_FIELD( totalDensity, DECLARE_FIELD( totalDensity_n, "totalDensity_n", - array2dLayoutFluid, + array2dLayout, 0, NOPLOT, WRITE_AND_READ, @@ -200,7 +199,7 @@ DECLARE_FIELD( totalDensity_n, DECLARE_FIELD( dTotalDensity, "dTotalDensity", - array3dLayoutFluid_dC, + array3dLayout, 0, NOPLOT, NO_WRITE, diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidUtils.hpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidUtils.hpp index 6f3db3ca97f..dd47c4908d7 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidUtils.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidUtils.hpp @@ -19,6 +19,7 @@ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_MULTIFLUIDUTILS_HPP_ #include "common/DataTypes.hpp" +#include "constitutive/fluid/multifluid/Layouts.hpp" namespace geos { @@ -26,52 +27,29 @@ namespace geos namespace constitutive { -namespace internal -{ - -template< typename T, int DIM, int USD > -struct ArraySliceOrRefHelper -{ - using type = ArraySlice< T, DIM, USD >; -}; - -// an array slice of DIM=0 decays to a reference to scalar -template< typename T, int USD > -struct ArraySliceOrRefHelper< T, 0, USD > -{ - using type = T &; -}; - -template< typename T, int DIM, int USD=DIM-1 > -using ArraySliceOrRef = typename ArraySliceOrRefHelper< T, DIM, USD >::type; - -} // namespace internal - /** * @brief Helper struct used to represent a variable and its compositional derivatives * @tparam DIM number of dimensions */ -template< typename T, int DIM, int USD, int USD_DC > +template< typename T, int DIM > struct MultiFluidVarSlice { GEOS_HOST_DEVICE - MultiFluidVarSlice( internal::ArraySliceOrRef< T, DIM, USD > inputValue, - internal::ArraySliceOrRef< T, DIM+1, USD_DC > inputDerivs ): + MultiFluidVarSlice( multifluid::ArraySlice< T, DIM > inputValue, + multifluid::ArraySlice< T, DIM+1 > inputDerivs ): value( inputValue ), derivs( inputDerivs ) {} - internal::ArraySliceOrRef< T, DIM, USD > value; /// variable value - internal::ArraySliceOrRef< T, DIM + 1, USD_DC > derivs; /// derivative w.r.t. pressure, temperature, compositions + multifluid::ArraySlice< T, DIM > value; /// variable value + multifluid::ArraySlice< T, DIM + 1 > derivs; /// derivative w.r.t. pressure, temperature, compositions }; /** * @brief Struct holding views into fluid data, used to simplify parameter passing in kernel wrapper constructors. * @tparam NDIM number of dimensions - * @tparam USD unit-stride-dim of primary property - * @tparam USD_DC unit-stride-dim of derivatives */ -template< typename T, int NDIM, int USD, int USD_DC > +template< typename T, int NDIM > struct MultiFluidVarView { MultiFluidVarView() = default; @@ -83,16 +61,16 @@ struct MultiFluidVarView {} GEOS_HOST_DEVICE - MultiFluidVarView ( ArrayView< T, NDIM, USD > const & valueSrc, - ArrayView< T, NDIM + 1, USD_DC > const & derivsSrc ): + MultiFluidVarView ( multifluid::ArrayView< T, NDIM > const & valueSrc, + multifluid::ArrayView< T, NDIM + 1 > const & derivsSrc ): value( valueSrc ), derivs( derivsSrc ) {}; - ArrayView< T, NDIM, USD > value; ///< View into property values - ArrayView< T, NDIM + 1, USD_DC > derivs; ///< View into property derivatives w.r.t. pressure, temperature, compositions + multifluid::ArrayView< T, NDIM > value; ///< View into property values + multifluid::ArrayView< T, NDIM + 1 > derivs; ///< View into property derivatives w.r.t. pressure, temperature, compositions - using SliceType = MultiFluidVarSlice< T, NDIM - 2, USD - 2, USD_DC - 2 >; + using SliceType = MultiFluidVarSlice< T, NDIM - 2 >; GEOS_HOST_DEVICE SliceType operator()( localIndex const k, localIndex const q ) const @@ -104,17 +82,15 @@ struct MultiFluidVarView /** * @brief Struct holding views into fluid data, used to simplify parameter passing in kernel wrapper constructors. * @tparam NDIM number of dimensions - * @tparam PERM unit-stride-dim of primary property - * @tparam PERM_DC unit-stride-dim of derivatives */ -template< typename T, int NDIM, typename PERM, typename PERM_DC > +template< typename T, int NDIM > struct MultiFluidVar { - Array< real64, NDIM, PERM > value; ///< Property values - Array< real64, NDIM + 1, PERM_DC > derivs; ///< Property derivatives w.r.t. pressure, temperature, compositions + multifluid::Array< real64, NDIM > value; ///< Property values + multifluid::Array< real64, NDIM + 1 > derivs; ///< Property derivatives w.r.t. pressure, temperature, compositions - using ViewType = MultiFluidVarView< T, NDIM, getUSD< PERM >, getUSD< PERM_DC > >; - using ViewTypeConst = MultiFluidVarView< T const, NDIM, getUSD< PERM >, getUSD< PERM_DC > >; + using ViewType = MultiFluidVarView< T, NDIM >; + using ViewTypeConst = MultiFluidVarView< T const, NDIM >; using SliceType = typename ViewType::SliceType; using SliceTypeConst = typename ViewTypeConst::SliceType; @@ -170,4 +146,4 @@ void convertToMoleFractions( integer numComponents, } // namespace geos -#endif //GEOS_CONSTITUTIVE_FLUID_MULTIFLUIDUTILS_HPP_ +#endif //GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_MULTIFLUIDUTILS_HPP_ diff --git a/src/coreComponents/constitutive/fluid/multifluid/blackOil/BlackOilFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/blackOil/BlackOilFluid.hpp index bfd8bfedce4..8f0f2800c37 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/blackOil/BlackOilFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/blackOil/BlackOilFluid.hpp @@ -136,7 +136,7 @@ class BlackOilFluid : public BlackOilFluidBase void computeDensitiesViscosities( bool const needDerivs, real64 const pressure, real64 const composition[NC_BO], - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & phaseFrac, + multifluid::ArraySlice< real64 const, 1 > const & phaseFrac, PhaseProp::SliceType const & phaseDens, PhaseProp::SliceType const & phaseMassDens, PhaseProp::SliceType const & phaseVisc, @@ -247,7 +247,7 @@ class BlackOilFluid : public BlackOilFluidBase real64 const dBo_dPres, real64 const dBo_dComp[HNC_BO], real64 & dens, - arraySlice1d< real64, multifluid::USD_PHASE_DC - 3 > const & dDens ) const; + multifluid::ArraySlice< real64, 1 > const & dDens ) const; /// Data needed to update the oil phase properties PVTOData::KernelWrapper m_PVTOView; @@ -555,7 +555,7 @@ BlackOilFluid::KernelWrapper:: computeDensitiesViscosities( bool const needDerivs, real64 const pressure, real64 const composition[NC_BO], - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & phaseFrac, + multifluid::ArraySlice< real64 const, 1 > const & phaseFrac, PhaseProp::SliceType const & phaseDens, PhaseProp::SliceType const & phaseMassDens, PhaseProp::SliceType const & phaseVisc, @@ -897,7 +897,7 @@ BlackOilFluid::KernelWrapper:: real64 const dBo_dPres, real64 const dBo_dComp[HNC_BO], real64 & dens, - arraySlice1d< real64, multifluid::USD_PHASE_DC - 3 > const & dDens ) const + multifluid::ArraySlice< real64, 1 > const & dDens ) const { using Deriv = multifluid::DerivativeOffset; using PT = BlackOilFluid::PhaseType; diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.hpp index e9d6d17ef6c..0d188ac053a 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.hpp @@ -39,8 +39,8 @@ class NegativeTwoPhaseFlashModelUpdate final : public FunctionBaseUpdate { public: - using PhaseProp = MultiFluidVar< real64, 3, multifluid::LAYOUT_PHASE, multifluid::LAYOUT_PHASE_DC >; - using PhaseComp = MultiFluidVar< real64, 4, multifluid::LAYOUT_PHASE_COMP, multifluid::LAYOUT_PHASE_COMP_DC >; + using PhaseProp = MultiFluidVar< real64, 3 >; + using PhaseComp = MultiFluidVar< real64, 4 >; explicit NegativeTwoPhaseFlashModelUpdate( integer const numComponents ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveFluidDriver.cpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveFluidDriver.cpp index e0e826b0f2e..cde18b7e3e2 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveFluidDriver.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveFluidDriver.cpp @@ -193,9 +193,9 @@ void ReactiveFluidDriver::runTest( FLUID_TYPE & fluid, arrayView2d< real64 > con localIndex const numKineticReactions = fluid.numKineticReactions(); // get output data views - arrayView2d< real64 const, multifluid::USD_FLUID > primarySpeciesConcentration = fluid.primarySpeciesConcentration(); - arrayView2d< real64 const, multifluid::USD_FLUID > secondarySpeciesConcentration = fluid.secondarySpeciesConcentration(); - arrayView2d< real64 const, multifluid::USD_FLUID > kineticReactionRates = fluid.kineticReactionRates(); + multifluid::ArrayView< real64 const, 2 > primarySpeciesConcentration = fluid.primarySpeciesConcentration(); + multifluid::ArrayView< real64 const, 2 > secondarySpeciesConcentration = fluid.secondarySpeciesConcentration(); + multifluid::ArrayView< real64 const, 2 > kineticReactionRates = fluid.kineticReactionRates(); // create kernel wrapper diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp index 959fdf35282..f96ef3083a0 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp @@ -188,13 +188,13 @@ class ReactiveMultiFluid : public MultiFluidBase std::unique_ptr< chemicalReactions::KineticReactions > m_kineticReactions; - array2d< real64, multifluid::LAYOUT_FLUID > m_primarySpeciesConcentration; + multifluid::Array< real64, 2 > m_primarySpeciesConcentration; - array2d< real64, multifluid::LAYOUT_FLUID > m_secondarySpeciesConcentration; + multifluid::Array< real64, 2 > m_secondarySpeciesConcentration; - array2d< real64, multifluid::LAYOUT_FLUID > m_primarySpeciesTotalConcentration; + multifluid::Array< real64, 2 > m_primarySpeciesTotalConcentration; - array2d< real64, multifluid::LAYOUT_FLUID > m_kineticReactionRates; + multifluid::Array< real64, 2 > m_kineticReactionRates; }; inline void diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp index f4897c4b9b6..58dcbd047df 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp @@ -769,7 +769,7 @@ void CompositionalMultiphaseBase::initializeFluidState( MeshLevel & mesh, // in order to initialize the primary solution variables string const & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); MultiFluidBase const & fluid = getConstitutiveModel< MultiFluidBase >( subRegion, fluidName ); - arrayView2d< real64 const, multifluid::USD_FLUID > const totalDens = fluid.totalDensity(); + multifluid::ArrayView< real64 const, 2 > const totalDens = fluid.totalDensity(); arrayView2d< real64 const, compflow::USD_COMP > const compFrac = subRegion.getField< fields::flow::globalCompFraction >(); @@ -1788,7 +1788,7 @@ void CompositionalMultiphaseBase::applyDirichletBC( real64 const time_n, subRegion.getReference< array1d< real64 > >( fields::flow::pressure::key() ); arrayView2d< real64 const, compflow::USD_COMP > const compDens = subRegion.getReference< array2d< real64, compflow::LAYOUT_COMP > >( fields::flow::globalCompDensity::key() ); - arrayView2d< real64 const, multifluid::USD_FLUID > const totalDens = fluid.totalDensity(); + multifluid::ArrayView< real64 const, 2 > const totalDens = fluid.totalDensity(); integer const numComp = m_numComponents; forAll< parallelDevicePolicy<> >( targetSet.size(), [=] GEOS_HOST_DEVICE ( localIndex const a ) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVMKernels.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVMKernels.cpp index 3405e5cdd6d..1ed1018afa8 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVMKernels.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVMKernels.cpp @@ -41,13 +41,13 @@ void UpwindingHelper:: upwindViscousCoefficient( localIndex const (&localIds)[ 3 ], localIndex const (&neighborIds)[ 3 ], - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, real64 const & oneSidedVolFlux, real64 ( & upwPhaseViscCoef )[ NP ][ NC ], @@ -140,15 +140,15 @@ UpwindingHelper:: upwindBuoyancyCoefficient( localIndex const (&localIds)[ 3 ], localIndex const (&neighborIds)[ 3 ], real64 const & transGravCoef, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, real64 ( & phaseGravTerm )[ NP ][ NP-1 ], real64 ( & dPhaseGravTerm_dPres )[ NP ][ NP-1 ][ 2 ], real64 ( & dPhaseGravTerm_dCompDens )[ NP ][ NP-1 ][ 2 ][ NC ], @@ -278,8 +278,8 @@ UpwindingHelper:: computePhaseGravTerm( localIndex const (&localIds)[ 3 ], localIndex const (&neighborIds)[ 3 ], real64 const & transGravCoef, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, real64 ( & phaseGravTerm )[ NP ][ NP-1 ], real64 ( & dPhaseGravTerm_dPres )[ NP ][ NP-1 ][ 2 ], @@ -503,13 +503,13 @@ UpwindingHelper:: UpwindingHelper:: \ upwindViscousCoefficient< NC, NP >( localIndex const (&localIds)[ 3 ], \ localIndex const (&neighborIds)[ 3 ], \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, \ ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, \ - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, \ ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, \ real64 const & oneSidedVolFlux, \ real64 ( &upwPhaseViscCoef )[ NP ][ NC ], \ @@ -523,15 +523,15 @@ UpwindingHelper:: upwindBuoyancyCoefficient< NC, NP >( localIndex const (&localIds)[ 3 ], \ localIndex const (&neighborIds)[ 3 ], \ real64 const & transGravCoef, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, \ ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, \ - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, \ real64 ( &phaseGravTerm )[ NP ][ NP-1 ], \ real64 ( &dPhaseGravTerm_dPres )[ NP ][ NP-1 ][ 2 ], \ real64 ( &dPhaseGravTerm_dCompDens )[ NP ][ NP-1 ][ 2 ][ NC ], \ @@ -545,8 +545,8 @@ UpwindingHelper:: computePhaseGravTerm< NC, NP >( localIndex const (&localIds)[ 3 ], \ localIndex const (&neighborIds)[ 3 ], \ real64 const & transGravCoef, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, \ real64 ( &phaseGravTerm )[ NP ][ NP-1 ], \ real64 ( &dPhaseGravTerm_dPres )[ NP ][ NP-1 ][ 2 ], \ @@ -606,8 +606,8 @@ AssemblerKernelHelper:: arraySlice1d< localIndex const > const & elemToFaces, real64 const & elemPres, real64 const & elemGravCoef, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & elemPhaseMassDens, - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const & dElemPhaseMassDens, + multifluid::ArraySlice< real64 const, 1 > const & elemPhaseMassDens, + multifluid::ArraySlice< real64 const, 2 > const & dElemPhaseMassDens, arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const & elemPhaseMob, arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > const & dElemPhaseMob, arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > const & dElemCompFrac_dCompDens, @@ -716,15 +716,15 @@ AssemblerKernelHelper:: arraySlice1d< localIndex const > const & elemToFaces, real64 const & elemGravCoef, integer const useTotalMassEquation, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, arraySlice2d< real64 const > const & transMatrixGrav, real64 const (&oneSidedVolFlux)[ NF ], @@ -1133,8 +1133,8 @@ AssemblerKernelHelper:: arraySlice1d< localIndex const > const & elemToFaces, \ real64 const & elemPres, \ real64 const & elemGravCoef, \ - arraySlice1d< real64 const, multifluid::USD_PHASE-2 > const & elemPhaseMassDens, \ - arraySlice2d< real64 const, multifluid::USD_PHASE_DC-2 > const & dElemPhaseMassDens_dCompFrac, \ + multifluid::ArraySlice< real64 const, 1 > const & elemPhaseMassDens, \ + multifluid::ArraySlice< real64 const, 2 > const & dElemPhaseMassDens_dCompFrac, \ arraySlice1d< real64 const, compflow::USD_PHASE-1 > const & elemPhaseMob, \ arraySlice2d< real64 const, compflow::USD_PHASE_DC-1 > const & dElemPhaseMob, \ arraySlice2d< real64 const, compflow::USD_COMP_DC-1 > const & dElemCompFrac_dCompDens, \ @@ -1158,15 +1158,15 @@ AssemblerKernelHelper:: arraySlice1d< localIndex const > const & elemToFaces, \ real64 const & elemGravCoef, \ integer const useTotalMassEquation, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, \ ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, \ - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, \ ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, \ arraySlice2d< real64 const > const & transMatrixGrav, \ real64 const (&oneSidedVolFlux)[ NF ], \ @@ -1287,15 +1287,15 @@ AssemblerKernel:: real64 const & elemPres, real64 const & elemGravCoef, integer const useTotalMassEquation, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, integer const elemGhostRank, globalIndex const rankOffset, @@ -1415,15 +1415,15 @@ AssemblerKernel:: real64 const & elemPres, \ real64 const & elemGravCoef, \ integer const useTotalMassEquation, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, \ ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, \ - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, \ ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, \ integer const elemGhostRank, \ globalIndex const rankOffset, \ @@ -1496,12 +1496,12 @@ FluxKernel:: ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, globalIndex const rankOffset, real64 const lengthTolerance, @@ -1627,12 +1627,12 @@ FluxKernel:: ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, \ - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, \ ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, \ globalIndex const rankOffset, \ real64 const lengthTolerance, \ diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVMKernels.hpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVMKernels.hpp index 3c07c9a99bf..bed07427585 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVMKernels.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVMKernels.hpp @@ -89,13 +89,13 @@ struct UpwindingHelper static void upwindViscousCoefficient( localIndex const (&localIds)[ 3 ], localIndex const (&neighborIds)[ 3 ], - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, real64 const & oneSidedVolFlux, real64 ( &upwPhaseViscCoef )[ NP ][ NC ], @@ -133,15 +133,15 @@ struct UpwindingHelper upwindBuoyancyCoefficient( localIndex const (&localIds)[ 3 ], localIndex const (&neighborIds)[ 3 ], real64 const & transGravCoef, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, real64 ( &phaseGravTerm )[ NP ][ NP-1 ], real64 ( &dPhaseGravTerm_dPres )[ NP ][ NP-1 ][ 2 ], real64 ( &dPhaseGravTerm_dCompDens )[ NP ][ NP-1 ][ 2 ][ NC ], @@ -169,8 +169,8 @@ struct UpwindingHelper computePhaseGravTerm( localIndex const (&localIds)[ 3 ], localIndex const (&neighborIds)[ 3 ], real64 const & transGravCoef, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, real64 ( &phaseGravTerm )[ NP ][ NP-1 ], real64 ( &dPhaseGravTerm_dPres )[ NP ][ NP-1 ][ 2 ], @@ -285,8 +285,8 @@ struct AssemblerKernelHelper arraySlice1d< localIndex const > const & elemToFaces, real64 const & elemPres, real64 const & elemGravCoef, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & elemPhaseMassDens, - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const & dElemPhaseMassDens, + multifluid::ArraySlice< real64 const, 1 > const & elemPhaseMassDens, + multifluid::ArraySlice< real64 const, 2 > const & dElemPhaseMassDens, arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const & elemPhaseMob, arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > const & dElemPhaseMob, arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > const & dElemCompFrac_dCompDens, @@ -336,15 +336,15 @@ struct AssemblerKernelHelper arraySlice1d< localIndex const > const & elemToFaces, real64 const & elemGravCoef, integer const useTotalMassEquation, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, arraySlice2d< real64 const > const & transMatrixGrav, real64 const (&oneSidedVolFlux)[ NF ], @@ -524,15 +524,15 @@ struct AssemblerKernel real64 const & elemPres, real64 const & elemGravCoef, const integer useTotalMassEquation, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, integer const elemGhostRank, globalIndex const rankOffset, @@ -628,12 +628,12 @@ struct FluxKernel ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, ElementViewConst< arrayView1d< globalIndex const > > const & elemDofNumber, globalIndex const rankOffset, real64 const lengthTolerance, @@ -699,8 +699,8 @@ class PhaseMobilityKernel : public isothermalCompositionalMultiphaseBaseKernels: using Deriv = multifluid::DerivativeOffset; arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > const dCompFrac_dCompDens = m_dCompFrac_dCompDens[ei]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const phaseVisc = m_phaseVisc[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const dPhaseVisc = m_dPhaseVisc[ei][0]; + multifluid::ArraySlice< real64 const, 1 > const phaseVisc = m_phaseVisc[ei][0]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseVisc = m_dPhaseVisc[ei][0]; arraySlice1d< real64 const, relperm::USD_RELPERM - 2 > const phaseRelPerm = m_phaseRelPerm[ei][0]; arraySlice2d< real64 const, relperm::USD_RELPERM_DS - 2 > const dPhaseRelPerm_dPhaseVolFrac = m_dPhaseRelPerm_dPhaseVolFrac[ei][0]; arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const phaseVolFrac = m_phaseVolFrac[ei]; @@ -777,8 +777,8 @@ class PhaseMobilityKernel : public isothermalCompositionalMultiphaseBaseKernels: arrayView3d< real64 const, compflow::USD_COMP_DC > m_dCompFrac_dCompDens; /// Views on the phase viscosities - arrayView3d< real64 const, multifluid::USD_PHASE > m_phaseVisc; - arrayView4d< real64 const, multifluid::USD_PHASE_DC > m_dPhaseVisc; + multifluid::ArrayView< real64 const, 3 > m_phaseVisc; + multifluid::ArrayView< real64 const, 4 > m_dPhaseVisc; /// Views on the phase relative permeabilities arrayView3d< real64 const, relperm::USD_RELPERM > m_phaseRelPerm; @@ -975,7 +975,7 @@ class ResidualNormKernel : public solverBaseKernels::ResidualNormKernelBase< 1 > ElementViewConst< arrayView2d< real64 const > > const m_porosity_n; /// View on total mass/molar density at the previous converged time step - ElementViewConst< arrayView2d< real64 const, multifluid::USD_FLUID > > const m_totalDens_n; + ElementViewConst< multifluid::ArrayView< real64 const, 2 > > const m_totalDens_n; }; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp index fd01f5d3898..48186bc63ab 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp @@ -259,8 +259,8 @@ void CompositionalMultiphaseStatistics::computeRegionStatistics( real64 const ti string const & fluidName = subRegion.getReference< string >( CompositionalMultiphaseBase::viewKeyStruct::fluidNamesString() ); MultiFluidBase const & fluid = constitutiveModels.getGroup< MultiFluidBase >( fluidName ); - arrayView3d< real64 const, multifluid::USD_PHASE > const phaseDensity = fluid.phaseDensity(); - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const phaseCompFraction = fluid.phaseCompFraction(); + multifluid::ArrayView< real64 const, 3 > const phaseDensity = fluid.phaseDensity(); + multifluid::ArrayView< real64 const, 4 > const phaseCompFraction = fluid.phaseCompFraction(); //get min vol fraction for each phase to dispactche immobile/mobile mass diff --git a/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseBaseKernels.hpp b/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseBaseKernels.hpp index 2afbf350956..023fa53a669 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseBaseKernels.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseBaseKernels.hpp @@ -299,10 +299,10 @@ class PhaseVolumeFractionKernel : public PropertyKernelBase< NUM_COMP > arraySlice1d< real64 const, compflow::USD_COMP - 1 > const compDens = m_compDens[ei]; arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > const dCompFrac_dCompDens = m_dCompFrac_dCompDens[ei]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const phaseDens = m_phaseDens[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const dPhaseDens = m_dPhaseDens[ei][0]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const phaseFrac = m_phaseFrac[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const dPhaseFrac = m_dPhaseFrac[ei][0]; + multifluid::ArraySlice< real64 const, 1 > const phaseDens = m_phaseDens[ei][0]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseDens = m_dPhaseDens[ei][0]; + multifluid::ArraySlice< real64 const, 1 > const phaseFrac = m_phaseFrac[ei][0]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseFrac = m_dPhaseFrac[ei][0]; arraySlice1d< real64, compflow::USD_PHASE - 1 > const phaseVolFrac = m_phaseVolFrac[ei]; arraySlice2d< real64, compflow::USD_PHASE_DC - 1 > const dPhaseVolFrac = m_dPhaseVolFrac[ei]; @@ -413,12 +413,12 @@ class PhaseVolumeFractionKernel : public PropertyKernelBase< NUM_COMP > arrayView3d< real64 const, compflow::USD_COMP_DC > m_dCompFrac_dCompDens; /// Views on phase fractions - arrayView3d< real64 const, multifluid::USD_PHASE > m_phaseFrac; - arrayView4d< real64 const, multifluid::USD_PHASE_DC > m_dPhaseFrac; + multifluid::ArrayView< real64 const, 3 > m_phaseFrac; + multifluid::ArrayView< real64 const, 4 > m_dPhaseFrac; /// Views on phase densities - arrayView3d< real64 const, multifluid::USD_PHASE > m_phaseDens; - arrayView4d< real64 const, multifluid::USD_PHASE_DC > m_dPhaseDens; + multifluid::ArrayView< real64 const, 3 > m_phaseDens; + multifluid::ArrayView< real64 const, 4 > m_dPhaseDens; }; @@ -702,13 +702,13 @@ class ElementBasedAssemblyKernel arraySlice1d< real64 const, compflow::USD_PHASE - 1 > phaseVolFrac = m_phaseVolFrac[ei]; arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > dPhaseVolFrac = m_dPhaseVolFrac[ei]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > phaseDens_n = m_phaseDens_n[ei][0]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > phaseDens = m_phaseDens[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > dPhaseDens = m_dPhaseDens[ei][0]; + multifluid::ArraySlice< real64 const, 1 > phaseDens_n = m_phaseDens_n[ei][0]; + multifluid::ArraySlice< real64 const, 1 > phaseDens = m_phaseDens[ei][0]; + multifluid::ArraySlice< real64 const, 2 > dPhaseDens = m_dPhaseDens[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP - 2 > phaseCompFrac_n = m_phaseCompFrac_n[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP - 2 > phaseCompFrac = m_phaseCompFrac[ei][0]; - arraySlice3d< real64 const, multifluid::USD_PHASE_COMP_DC - 2 > dPhaseCompFrac = m_dPhaseCompFrac[ei][0]; + multifluid::ArraySlice< real64 const, 2 > phaseCompFrac_n = m_phaseCompFrac_n[ei][0]; + multifluid::ArraySlice< real64 const, 2 > phaseCompFrac = m_phaseCompFrac[ei][0]; + multifluid::ArraySlice< real64 const, 3 > dPhaseCompFrac = m_dPhaseCompFrac[ei][0]; // temporary work arrays real64 dPhaseAmount_dC[numComp]{}; @@ -942,14 +942,14 @@ class ElementBasedAssemblyKernel arrayView3d< real64 const, compflow::USD_PHASE_DC > const m_dPhaseVolFrac; /// Views on the phase densities - arrayView3d< real64 const, multifluid::USD_PHASE > const m_phaseDens_n; - arrayView3d< real64 const, multifluid::USD_PHASE > const m_phaseDens; - arrayView4d< real64 const, multifluid::USD_PHASE_DC > const m_dPhaseDens; + multifluid::ArrayView< real64 const, 3 > const m_phaseDens_n; + multifluid::ArrayView< real64 const, 3 > const m_phaseDens; + multifluid::ArrayView< real64 const, 4 > const m_dPhaseDens; /// Views on the phase component fraction - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const m_phaseCompFrac_n; - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const m_phaseCompFrac; - arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > const m_dPhaseCompFrac; + multifluid::ArrayView< real64 const, 4 > const m_phaseCompFrac_n; + multifluid::ArrayView< real64 const, 4 > const m_phaseCompFrac; + multifluid::ArrayView< real64 const, 5 > const m_dPhaseCompFrac; // Views on component densities arrayView2d< real64 const, compflow::USD_COMP > m_compDens; @@ -1887,7 +1887,7 @@ class ResidualNormKernel : public solverBaseKernels::ResidualNormKernelBase< 1 > arrayView2d< real64 const > const m_porosity_n; /// View on total mass/molar density at the previous converged time step - arrayView2d< real64 const, multifluid::USD_FLUID > const m_totalDens_n; + multifluid::ArrayView< real64 const, 2 > const m_totalDens_n; }; @@ -1972,8 +1972,8 @@ struct StatisticsKernel arrayView1d< real64 const > const & temp, arrayView1d< real64 const > const & refPorosity, arrayView2d< real64 const > const & porosity, - arrayView3d< real64 const, multifluid::USD_PHASE > const & phaseDensity, - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const & phaseCompFraction, + multifluid::ArrayView< real64 const, 3 > const & phaseDensity, + multifluid::ArrayView< real64 const, 4 > const & phaseCompFraction, arrayView2d< real64 const, compflow::USD_PHASE > const & phaseVolFrac, arrayView3d< real64 const, relperm::USD_RELPERM > const & phaseTrappedVolFrac, arrayView3d< real64 const, relperm::USD_RELPERM > const & phaseRelperm, @@ -2131,14 +2131,13 @@ struct HydrostaticPressureKernel { // fluid properties at this elevation StackArray< real64, 2, constitutive::MultiFluidBase::MAX_NUM_COMPONENTS, compflow::LAYOUT_COMP > compFrac( 1, numComps ); - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > phaseFrac( 1, 1, numPhases ); - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > phaseDens( 1, 1, numPhases ); - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > phaseMassDens( 1, 1, numPhases ); - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > phaseVisc( 1, 1, numPhases ); - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > phaseEnthalpy( 1, 1, numPhases ); - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > phaseInternalEnergy( 1, 1, numPhases ); - StackArray< real64, 4, constitutive::MultiFluidBase::MAX_NUM_PHASES *constitutive::MultiFluidBase::MAX_NUM_COMPONENTS, - multifluid::LAYOUT_PHASE_COMP > phaseCompFrac( 1, 1, numPhases, numComps ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > phaseFrac( 1, 1, numPhases ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > phaseDens( 1, 1, numPhases ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > phaseMassDens( 1, 1, numPhases ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > phaseVisc( 1, 1, numPhases ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > phaseEnthalpy( 1, 1, numPhases ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > phaseInternalEnergy( 1, 1, numPhases ); + multifluid::StackArray< real64, 4, constitutive::MultiFluidBase::MAX_NUM_PHASES*constitutive::MultiFluidBase::MAX_NUM_COMPONENTS > phaseCompFrac( 1, 1, numPhases, numComps ); real64 totalDens = 0.0; bool isSinglePhaseFlow = true; @@ -2268,13 +2267,13 @@ struct HydrostaticPressureKernel // datum fluid properties array2d< real64, compflow::LAYOUT_COMP > datumCompFrac( 1, numComps ); - array3d< real64, multifluid::LAYOUT_PHASE > datumPhaseFrac( 1, 1, numPhases ); - array3d< real64, multifluid::LAYOUT_PHASE > datumPhaseDens( 1, 1, numPhases ); - array3d< real64, multifluid::LAYOUT_PHASE > datumPhaseMassDens( 1, 1, numPhases ); - array3d< real64, multifluid::LAYOUT_PHASE > datumPhaseVisc( 1, 1, numPhases ); - array3d< real64, multifluid::LAYOUT_PHASE > datumPhaseEnthalpy( 1, 1, numPhases ); - array3d< real64, multifluid::LAYOUT_PHASE > datumPhaseInternalEnergy( 1, 1, numPhases ); - array4d< real64, multifluid::LAYOUT_PHASE_COMP > datumPhaseCompFrac( 1, 1, numPhases, numComps ); + multifluid::Array< real64, 3 > datumPhaseFrac( 1, 1, numPhases ); + multifluid::Array< real64, 3 > datumPhaseDens( 1, 1, numPhases ); + multifluid::Array< real64, 3 > datumPhaseMassDens( 1, 1, numPhases ); + multifluid::Array< real64, 3 > datumPhaseVisc( 1, 1, numPhases ); + multifluid::Array< real64, 3 > datumPhaseEnthalpy( 1, 1, numPhases ); + multifluid::Array< real64, 3 > datumPhaseInternalEnergy( 1, 1, numPhases ); + multifluid::Array< real64, 4 > datumPhaseCompFrac( 1, 1, numPhases, numComps ); real64 datumTotalDens = 0.0; real64 const datumTemp = tempTableWrapper.compute( &datumElevation ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernelUtilities.hpp b/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernelUtilities.hpp index f63126c5cbb..4c75731165c 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernelUtilities.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernelUtilities.hpp @@ -29,6 +29,8 @@ namespace geos { +using namespace constitutive; + namespace isothermalCompositionalMultiphaseFVMKernelUtilities { @@ -38,7 +40,7 @@ static constexpr real64 epsC1PPU = 5000; template< typename VIEWTYPE > using ElementViewConst = ElementRegionManager::ElementViewConst< VIEWTYPE >; -using Deriv = constitutive::multifluid::DerivativeOffset; +using Deriv = multifluid::DerivativeOffset; struct PotGrad { @@ -57,8 +59,8 @@ struct PotGrad ElementViewConst< arrayView1d< real64 const > > const & gravCoef, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > > const & phaseCapPressure, ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > > const & dPhaseCapPressure_dPhaseVolFrac, real64 & potGrad, @@ -229,8 +231,8 @@ struct PPUPhaseFlux ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > > const & phaseCapPressure, ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > > const & dPhaseCapPressure_dPhaseVolFrac, localIndex & k_up, @@ -334,8 +336,8 @@ struct C1PPUPhaseFlux ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > > const & dPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseMassDens, ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > > const & phaseCapPressure, ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > > const & dPhaseCapPressure_dPhaseVolFrac, localIndex & k_up, @@ -484,8 +486,8 @@ struct PhaseComponentFlux localIndex const ( &seri )[numFluxSupportPoints], localIndex const ( &sesri )[numFluxSupportPoints], localIndex const ( &sei )[numFluxSupportPoints], - ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, constitutive::multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, real64 const & phaseFlux, real64 const ( &dPhaseFlux_dP )[numFluxSupportPoints], @@ -501,9 +503,9 @@ struct PhaseComponentFlux real64 dProp_dC[numComp]{}; // slice some constitutive arrays to avoid too much indexing in component loop - arraySlice1d< real64 const, constitutive::multifluid::USD_PHASE_COMP-3 > phaseCompFracSub = + multifluid::ArraySlice< real64 const, 1 > phaseCompFracSub = phaseCompFrac[er_up][esr_up][ei_up][0][ip]; - arraySlice2d< real64 const, constitutive::multifluid::USD_PHASE_COMP_DC-3 > dPhaseCompFracSub = + multifluid::ArraySlice< real64 const, 2 > dPhaseCompFracSub = dPhaseCompFrac[er_up][esr_up][ei_up][0][ip]; // compute component fluxes and derivatives using upstream cell composition diff --git a/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernels.cpp b/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernels.cpp index e6636d930fa..71a63d3862a 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernels.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernels.cpp @@ -76,10 +76,10 @@ CFLFluxKernel:: ElementViewConst< arrayView1d< real64 const > > const & gravCoef, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseVolFrac, ElementViewConst< arrayView3d< real64 const, relperm::USD_RELPERM > > const & phaseRelPerm, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseVisc, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseVisc, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, ElementView< arrayView2d< real64, compflow::USD_PHASE > > const & phaseOutflux, ElementView< arrayView2d< real64, compflow::USD_COMP > > const & compOutflux ) { @@ -166,10 +166,10 @@ CFLFluxKernel:: ElementViewConst< arrayView3d< real64 const > > const & permeability, ElementViewConst< arrayView3d< real64 const > > const & dPerm_dPres, ElementViewConst< arrayView3d< real64 const, relperm::USD_RELPERM > > const & phaseRelPerm, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseVisc, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseVisc, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, ElementView< arrayView2d< real64, compflow::USD_PHASE > > const & phaseOutflux, ElementView< arrayView2d< real64, compflow::USD_COMP > > const & compOutflux ) { @@ -224,10 +224,10 @@ CFLFluxKernel:: ElementViewConst< arrayView3d< real64 const > > const & permeability, \ ElementViewConst< arrayView3d< real64 const > > const & dPerm_dPres, \ ElementViewConst< arrayView3d< real64 const, relperm::USD_RELPERM > > const & phaseRelPerm, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseVisc, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseVisc, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, \ ElementView< arrayView2d< real64, compflow::USD_PHASE > > const & phaseOutflux, \ ElementView< arrayView2d< real64, compflow::USD_COMP > > const & compOutflux ) @@ -267,7 +267,7 @@ CFLKernel:: arraySlice1d< real64 const, compflow::USD_PHASE - 1 > phaseVolFrac, arraySlice1d< real64 const, relperm::USD_RELPERM - 2 > phaseRelPerm, arraySlice2d< real64 const, relperm::USD_RELPERM_DS - 2 > dPhaseRelPerm_dPhaseVolFrac, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > phaseVisc, + multifluid::ArraySlice< real64 const, 1 > phaseVisc, arraySlice1d< real64 const, compflow::USD_PHASE - 1 > phaseOutflux, real64 & phaseCFLNumber ) { @@ -381,7 +381,7 @@ CFLKernel:: arrayView2d< real64 const, compflow::USD_PHASE > const & phaseVolFrac, arrayView3d< real64 const, relperm::USD_RELPERM > const & phaseRelPerm, arrayView4d< real64 const, relperm::USD_RELPERM_DS > const & dPhaseRelPerm_dPhaseVolFrac, - arrayView3d< real64 const, multifluid::USD_PHASE > const & phaseVisc, + multifluid::ArrayView< real64 const, 3 > const & phaseVisc, arrayView2d< real64 const, compflow::USD_PHASE > const & phaseOutflux, arrayView2d< real64 const, compflow::USD_COMP > const & compOutflux, arrayView1d< real64 > const & phaseCFLNumber, @@ -434,7 +434,7 @@ CFLKernel:: arrayView2d< real64 const, compflow::USD_PHASE > const & phaseVolFrac, \ arrayView3d< real64 const, relperm::USD_RELPERM > const & phaseRelPerm, \ arrayView4d< real64 const, relperm::USD_RELPERM_DS > const & dPhaseRelPerm_dPhaseVolFrac, \ - arrayView3d< real64 const, multifluid::USD_PHASE > const & phaseVisc, \ + multifluid::ArrayView< real64 const, 3 > const & phaseVisc, \ arrayView2d< real64 const, compflow::USD_PHASE > const & phaseOutflux, \ arrayView2d< real64 const, compflow::USD_COMP > const & compOutflux, \ arrayView1d< real64 > const & phaseCFLNumber, \ @@ -468,12 +468,12 @@ AquiferBCKernel:: real64 const dAquiferVolFlux_dPres, real64 const aquiferWaterPhaseDens, arrayView1d< real64 const > const & aquiferWaterPhaseCompFrac, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > phaseDens, - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > dPhaseDens, + multifluid::ArraySlice< real64 const, 1 > phaseDens, + multifluid::ArraySlice< real64 const, 2 > dPhaseDens, arraySlice1d< real64 const, compflow::USD_PHASE - 1 > phaseVolFrac, arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > dPhaseVolFrac, - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP - 2 > phaseCompFrac, - arraySlice3d< real64 const, multifluid::USD_PHASE_COMP_DC - 2 > dPhaseCompFrac, + multifluid::ArraySlice< real64 const, 2 > phaseCompFrac, + multifluid::ArraySlice< real64 const, 3 > dPhaseCompFrac, arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > dCompFrac_dCompDens, real64 const dt, real64 (& localFlux)[NC], @@ -557,10 +557,10 @@ AquiferBCKernel:: ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, real64 const timeAtBeginningOfStep, real64 const dt, CRSMatrixView< real64, globalIndex const > const & localMatrix, @@ -673,10 +673,10 @@ AquiferBCKernel:: ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseVolFrac, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseVolFrac, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, \ - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, \ real64 const timeAtBeginningOfStep, \ real64 const dt, \ CRSMatrixView< real64, globalIndex const > const & localMatrix, \ diff --git a/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernels.hpp b/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernels.hpp index da4e426d578..e62a84b8c0b 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernels.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseFVMKernels.hpp @@ -129,10 +129,10 @@ class PhaseMobilityKernel : public isothermalCompositionalMultiphaseBaseKernels: using Deriv = multifluid::DerivativeOffset; arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > const dCompFrac_dCompDens = m_dCompFrac_dCompDens[ei]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const phaseDens = m_phaseDens[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const dPhaseDens = m_dPhaseDens[ei][0]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const phaseVisc = m_phaseVisc[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const dPhaseVisc = m_dPhaseVisc[ei][0]; + multifluid::ArraySlice< real64 const, 1 > const phaseDens = m_phaseDens[ei][0]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseDens = m_dPhaseDens[ei][0]; + multifluid::ArraySlice< real64 const, 1 > const phaseVisc = m_phaseVisc[ei][0]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseVisc = m_dPhaseVisc[ei][0]; arraySlice1d< real64 const, relperm::USD_RELPERM - 2 > const phaseRelPerm = m_phaseRelPerm[ei][0]; arraySlice2d< real64 const, relperm::USD_RELPERM_DS - 2 > const dPhaseRelPerm_dPhaseVolFrac = m_dPhaseRelPerm_dPhaseVolFrac[ei][0]; arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const phaseVolFrac = m_phaseVolFrac[ei]; @@ -214,12 +214,12 @@ class PhaseMobilityKernel : public isothermalCompositionalMultiphaseBaseKernels: arrayView3d< real64 const, compflow::USD_COMP_DC > m_dCompFrac_dCompDens; /// Views on the phase densities - arrayView3d< real64 const, multifluid::USD_PHASE > m_phaseDens; - arrayView4d< real64 const, multifluid::USD_PHASE_DC > m_dPhaseDens; + multifluid::ArrayView< real64 const, 3 > m_phaseDens; + multifluid::ArrayView< real64 const, 4 > m_dPhaseDens; /// Views on the phase viscosities - arrayView3d< real64 const, multifluid::USD_PHASE > m_phaseVisc; - arrayView4d< real64 const, multifluid::USD_PHASE_DC > m_dPhaseVisc; + multifluid::ArrayView< real64 const, 3 > m_phaseVisc; + multifluid::ArrayView< real64 const, 4 > m_dPhaseVisc; /// Views on the phase relative permeabilities arrayView3d< real64 const, relperm::USD_RELPERM > m_phaseRelPerm; @@ -378,8 +378,8 @@ class FaceBasedAssemblyKernelBase ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const m_dPhaseVolFrac; /// Views on phase component fractions - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const m_phaseCompFrac; - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const m_dPhaseCompFrac; + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const m_phaseCompFrac; + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const m_dPhaseCompFrac; // Residual and jacobian @@ -800,8 +800,8 @@ class FaceBasedAssemblyKernel : public FaceBasedAssemblyKernelBase ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const m_dPhaseMob; /// Views on phase mass densities - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const m_phaseMassDens; - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const m_dPhaseMassDens; + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const m_phaseMassDens; + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const m_dPhaseMassDens; /// Views on phase capillary pressure ElementViewConst< arrayView3d< real64 const, cappres::USD_CAPPRES > > const m_phaseCapPressure; @@ -1519,8 +1519,8 @@ class DiffusionDispersionFaceBasedAssemblyKernel : public FaceBasedAssemblyKerne ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const m_phaseVolFrac; /// Views on phase densities - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const m_phaseDens; - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const m_dPhaseDens; + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const m_phaseDens; + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const m_dPhaseDens; /// Views on diffusivity ElementViewConst< arrayView3d< real64 const > > const m_diffusivity; @@ -1824,14 +1824,13 @@ class DirichletFaceBasedAssemblyKernel : public FaceBasedAssemblyKernel< NUM_COM // This is needed to get the phase mass density and the phase comp fraction at the face // Because we approximate the face mobility using the total element mobility - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > facePhaseFrac( 1, 1, m_numPhases ); - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > facePhaseDens( 1, 1, m_numPhases ); - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > facePhaseMassDens( 1, 1, m_numPhases ); - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > facePhaseVisc( 1, 1, m_numPhases ); - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > facePhaseEnthalpy( 1, 1, m_numPhases ); - StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES, multifluid::LAYOUT_PHASE > facePhaseInternalEnergy( 1, 1, m_numPhases ); - StackArray< real64, 4, constitutive::MultiFluidBase::MAX_NUM_PHASES * NUM_COMP, - multifluid::LAYOUT_PHASE_COMP > facePhaseCompFrac( 1, 1, m_numPhases, NUM_COMP ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > facePhaseFrac( 1, 1, m_numPhases ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > facePhaseDens( 1, 1, m_numPhases ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > facePhaseMassDens( 1, 1, m_numPhases ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > facePhaseVisc( 1, 1, m_numPhases ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > facePhaseEnthalpy( 1, 1, m_numPhases ); + multifluid::StackArray< real64, 3, constitutive::MultiFluidBase::MAX_NUM_PHASES > facePhaseInternalEnergy( 1, 1, m_numPhases ); + multifluid::StackArray< real64, 4, constitutive::MultiFluidBase::MAX_NUM_PHASES*NUM_COMP > facePhaseCompFrac( 1, 1, m_numPhases, NUM_COMP ); real64 faceTotalDens = 0.0; MultiFluidBase::KernelWrapper::computeValues( m_fluidWrapper, @@ -1924,9 +1923,9 @@ class DirichletFaceBasedAssemblyKernel : public FaceBasedAssemblyKernel< NUM_COM } // slice some constitutive arrays to avoid too much indexing in component loop - arraySlice1d< real64 const, multifluid::USD_PHASE_COMP-3 > phaseCompFracSub = + multifluid::ArraySlice< real64 const, 1 > phaseCompFracSub = m_phaseCompFrac[er][esr][ei][0][ip]; - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP_DC-3 > dPhaseCompFracSub = + multifluid::ArraySlice< real64 const, 2 > dPhaseCompFracSub = m_dPhaseCompFrac[er][esr][ei][0][ip]; // compute component fluxes and derivatives using element composition @@ -2190,10 +2189,10 @@ struct CFLFluxKernel ElementViewConst< arrayView1d< real64 const > > const & gravCoef, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseVolFrac, ElementViewConst< arrayView3d< real64 const, relperm::USD_RELPERM > > const & phaseRelPerm, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseVisc, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseVisc, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, ElementView< arrayView2d< real64, compflow::USD_PHASE > > const & phaseOutflux, ElementView< arrayView2d< real64, compflow::USD_COMP > > const & compOutflux ); @@ -2208,10 +2207,10 @@ struct CFLFluxKernel ElementViewConst< arrayView3d< real64 const > > const & permeability, ElementViewConst< arrayView3d< real64 const > > const & dPerm_dPres, ElementViewConst< arrayView3d< real64 const, relperm::USD_RELPERM > > const & phaseRelPerm, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseVisc, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseMassDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseVisc, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, ElementView< arrayView2d< real64, compflow::USD_PHASE > > const & phaseOutflux, ElementView< arrayView2d< real64, compflow::USD_COMP > > const & compOutflux ); }; @@ -2235,7 +2234,7 @@ struct CFLKernel arraySlice1d< real64 const, compflow::USD_PHASE - 1 > phaseVolFrac, arraySlice1d< real64 const, relperm::USD_RELPERM - 2 > phaseRelPerm, arraySlice2d< real64 const, relperm::USD_RELPERM_DS - 2 > dPhaseRelPerm_dPhaseVolFrac, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > phaseVisc, + multifluid::ArraySlice< real64 const, 1 > phaseVisc, arraySlice1d< real64 const, compflow::USD_PHASE- 1 > phaseOutflux, real64 & phaseCFLNumber ); @@ -2259,7 +2258,7 @@ struct CFLKernel arrayView2d< real64 const, compflow::USD_PHASE > const & phaseVolFrac, arrayView3d< real64 const, relperm::USD_RELPERM > const & phaseRelPerm, arrayView4d< real64 const, relperm::USD_RELPERM_DS > const & dPhaseRelPerm_dPhaseVolFrac, - arrayView3d< real64 const, multifluid::USD_PHASE > const & phaseVisc, + multifluid::ArrayView< real64 const, 3 > const & phaseVisc, arrayView2d< real64 const, compflow::USD_PHASE > const & phaseOutflux, arrayView2d< real64 const, compflow::USD_COMP > const & compOutflux, arrayView1d< real64 > const & phaseCFLNumber, @@ -2313,12 +2312,12 @@ struct AquiferBCKernel real64 const dAquiferVolFlux_dPres, real64 const aquiferWaterPhaseDens, arrayView1d< real64 const > const & aquiferWaterPhaseCompFrac, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > phaseDens, - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > dPhaseDens, + multifluid::ArraySlice< real64 const, 1 > phaseDens, + multifluid::ArraySlice< real64 const, 2 > dPhaseDens, arraySlice1d< real64 const, compflow::USD_PHASE - 1 > phaseVolFrac, arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > dPhaseVolFrac, - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP - 2 > phaseCompFrac, - arraySlice3d< real64 const, multifluid::USD_PHASE_COMP_DC - 2 > dPhaseCompFrac, + multifluid::ArraySlice< real64 const, 2 > phaseCompFrac, + multifluid::ArraySlice< real64 const, 3 > dPhaseCompFrac, arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > dCompFrac_dCompDens, real64 const dt, real64 ( &localFlux )[NC], @@ -2343,10 +2342,10 @@ struct AquiferBCKernel ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & phaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dPhaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dCompFrac_dCompDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & phaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dPhaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & phaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & phaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & phaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dPhaseCompFrac, real64 const timeAtBeginningOfStep, real64 const dt, CRSMatrixView< real64, globalIndex const > const & localMatrix, diff --git a/src/coreComponents/physicsSolvers/fluidFlow/StabilizedCompositionalMultiphaseFVMKernels.hpp b/src/coreComponents/physicsSolvers/fluidFlow/StabilizedCompositionalMultiphaseFVMKernels.hpp index b0d6328732f..c9ed2af0850 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/StabilizedCompositionalMultiphaseFVMKernels.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/StabilizedCompositionalMultiphaseFVMKernels.hpp @@ -287,8 +287,8 @@ class FaceBasedAssemblyKernel : public isothermalCompositionalMultiphaseFVMKerne /// Views on flow properties at the previous converged time step ElementViewConst< arrayView1d< real64 const > > const m_pres_n; - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const m_phaseDens_n; - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const m_phaseCompFrac_n; + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const m_phaseDens_n; + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const m_phaseCompFrac_n; ElementViewConst< arrayView3d< real64 const, relperm::USD_RELPERM > > const m_phaseRelPerm_n; /// Views on the macroelement indices and stab constant diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ThermalCompositionalMultiphaseBaseKernels.hpp b/src/coreComponents/physicsSolvers/fluidFlow/ThermalCompositionalMultiphaseBaseKernels.hpp index 9540147964e..26902205e1f 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/ThermalCompositionalMultiphaseBaseKernels.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/ThermalCompositionalMultiphaseBaseKernels.hpp @@ -69,8 +69,8 @@ class PhaseVolumeFractionKernel : public isothermalCompositionalMultiphaseBaseKe { using Deriv = multifluid::DerivativeOffset; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const dPhaseDens = m_dPhaseDens[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const dPhaseFrac = m_dPhaseFrac[ei][0]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseDens = m_dPhaseDens[ei][0]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseFrac = m_dPhaseFrac[ei][0]; arraySlice2d< real64, compflow::USD_PHASE_DC - 1 > const dPhaseVolFrac = m_dPhaseVolFrac[ei]; @@ -298,13 +298,13 @@ class ElementBasedAssemblyKernel : public isothermalCompositionalMultiphaseBaseK arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > dCompFrac_dCompDens = m_dCompFrac_dCompDens[ei]; arraySlice1d< real64 const, compflow::USD_PHASE - 1 > phaseVolFrac = m_phaseVolFrac[ei]; arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > dPhaseVolFrac = m_dPhaseVolFrac[ei]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > phaseDens = m_phaseDens[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > dPhaseDens = m_dPhaseDens[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP - 2 > phaseCompFrac = m_phaseCompFrac[ei][0]; - arraySlice3d< real64 const, multifluid::USD_PHASE_COMP_DC - 2 > dPhaseCompFrac = m_dPhaseCompFrac[ei][0]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > phaseInternalEnergy_n = m_phaseInternalEnergy_n[ei][0]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > phaseInternalEnergy = m_phaseInternalEnergy[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > dPhaseInternalEnergy = m_dPhaseInternalEnergy[ei][0]; + multifluid::ArraySlice< real64 const, 1 > phaseDens = m_phaseDens[ei][0]; + multifluid::ArraySlice< real64 const, 2 > dPhaseDens = m_dPhaseDens[ei][0]; + multifluid::ArraySlice< real64 const, 2 > phaseCompFrac = m_phaseCompFrac[ei][0]; + multifluid::ArraySlice< real64 const, 3 > dPhaseCompFrac = m_dPhaseCompFrac[ei][0]; + multifluid::ArraySlice< real64 const, 1 > phaseInternalEnergy_n = m_phaseInternalEnergy_n[ei][0]; + multifluid::ArraySlice< real64 const, 1 > phaseInternalEnergy = m_phaseInternalEnergy[ei][0]; + multifluid::ArraySlice< real64 const, 2 > dPhaseInternalEnergy = m_dPhaseInternalEnergy[ei][0]; // Step 1: assemble the derivatives of the component mass balance equations with respect to temperature @@ -396,9 +396,9 @@ class ElementBasedAssemblyKernel : public isothermalCompositionalMultiphaseBaseK arrayView2d< real64 const > const m_dPoro_dTemp; /// Views on phase internal energy - arrayView3d< real64 const, multifluid::USD_PHASE > m_phaseInternalEnergy_n; - arrayView3d< real64 const, multifluid::USD_PHASE > m_phaseInternalEnergy; - arrayView4d< real64 const, multifluid::USD_PHASE_DC > m_dPhaseInternalEnergy; + multifluid::ArrayView< real64 const, 3 > m_phaseInternalEnergy_n; + multifluid::ArrayView< real64 const, 3 > m_phaseInternalEnergy; + multifluid::ArrayView< real64 const, 4 > m_dPhaseInternalEnergy; /// Views on rock internal energy arrayView2d< real64 const > m_rockInternalEnergy_n; @@ -978,9 +978,9 @@ class ResidualNormKernel : public solverBaseKernels::ResidualNormKernelBase< 2 > /// View on phase properties at the previous converged time step arrayView2d< real64 const, compflow::USD_PHASE > const m_phaseVolFrac_n; - arrayView2d< real64 const, multifluid::USD_FLUID > const m_totalDens_n; - arrayView3d< real64 const, multifluid::USD_PHASE > const m_phaseDens_n; - arrayView3d< real64 const, multifluid::USD_PHASE > const m_phaseInternalEnergy_n; + multifluid::ArrayView< real64 const, 2 > const m_totalDens_n; + multifluid::ArrayView< real64 const, 3 > const m_phaseDens_n; + multifluid::ArrayView< real64 const, 3 > const m_phaseInternalEnergy_n; /// View on solid properties at the previous converged time step arrayView2d< real64 const > const m_solidInternalEnergy_n; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ThermalCompositionalMultiphaseFVMKernels.hpp b/src/coreComponents/physicsSolvers/fluidFlow/ThermalCompositionalMultiphaseFVMKernels.hpp index 28bd1d26eb6..35b28ad720b 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/ThermalCompositionalMultiphaseFVMKernels.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/ThermalCompositionalMultiphaseFVMKernels.hpp @@ -77,10 +77,10 @@ class PhaseMobilityKernel : public isothermalCompositionalMultiphaseFVMKernels:: { using Deriv = multifluid::DerivativeOffset; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const phaseDens = m_phaseDens[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const dPhaseDens = m_dPhaseDens[ei][0]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const phaseVisc = m_phaseVisc[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const dPhaseVisc = m_dPhaseVisc[ei][0]; + multifluid::ArraySlice< real64 const, 1 > const phaseDens = m_phaseDens[ei][0]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseDens = m_dPhaseDens[ei][0]; + multifluid::ArraySlice< real64 const, 1 > const phaseVisc = m_phaseVisc[ei][0]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseVisc = m_dPhaseVisc[ei][0]; arraySlice2d< real64 const, relperm::USD_RELPERM_DS - 2 > const dPhaseRelPerm_dPhaseVolFrac = m_dPhaseRelPerm_dPhaseVolFrac[ei][0]; arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > const dPhaseVolFrac = m_dPhaseVolFrac[ei]; @@ -415,9 +415,9 @@ class FaceBasedAssemblyKernel : public isothermalCompositionalMultiphaseFVMKerne // Step 3.2: compute the derivative of component flux wrt temperature // slice some constitutive arrays to avoid too much indexing in component loop - arraySlice1d< real64 const, multifluid::USD_PHASE_COMP - 3 > phaseCompFracSub = + multifluid::ArraySlice< real64 const, 1 > phaseCompFracSub = m_phaseCompFrac[er_up][esr_up][ei_up][0][ip]; - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP_DC - 3 > dPhaseCompFracSub = + multifluid::ArraySlice< real64 const, 2 > dPhaseCompFracSub = m_dPhaseCompFrac[er_up][esr_up][ei_up][0][ip]; for( integer ic = 0; ic < numComp; ++ic ) @@ -587,8 +587,8 @@ class FaceBasedAssemblyKernel : public isothermalCompositionalMultiphaseFVMKerne ElementViewConst< arrayView1d< real64 const > > const m_temp; /// Views on phase enthalpies - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const m_phaseEnthalpy; - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const m_dPhaseEnthalpy; + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const m_phaseEnthalpy; + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const m_dPhaseEnthalpy; /// View on thermal conductivity ElementViewConst< arrayView3d< real64 const > > const m_thermalConductivity; @@ -1176,8 +1176,8 @@ class DirichletFaceBasedAssemblyKernel : public isothermalCompositionalMultiphas localIndex const kf, real64 const f, // potGrad times trans real64 const facePhaseMob, - arraySlice1d< const real64, multifluid::USD_PHASE - 2 > const & facePhaseEnthalpy, - arraySlice2d< const real64, multifluid::USD_PHASE_COMP-2 > const & facePhaseCompFrac, + multifluid::ArraySlice< const real64, 1 > const & facePhaseEnthalpy, + multifluid::ArraySlice< const real64, 2 > const & facePhaseCompFrac, real64 const phaseFlux, real64 const dPhaseFlux_dP, real64 const (&dPhaseFlux_dC)[numComp] ) @@ -1210,9 +1210,9 @@ class DirichletFaceBasedAssemblyKernel : public isothermalCompositionalMultiphas // Step 3.2.a: compute the derivative of component flux wrt temperature // slice some constitutive arrays to avoid too much indexing in component loop - arraySlice1d< real64 const, multifluid::USD_PHASE_COMP - 3 > phaseCompFracSub = + multifluid::ArraySlice< real64 const, 1 > phaseCompFracSub = m_phaseCompFrac[er][esr][ei][0][ip]; - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP_DC - 3 > dPhaseCompFracSub = + multifluid::ArraySlice< real64 const, 2 > dPhaseCompFracSub = m_dPhaseCompFrac[er][esr][ei][0][ip]; for( integer ic = 0; ic < numComp; ++ic ) @@ -1345,8 +1345,8 @@ class DirichletFaceBasedAssemblyKernel : public isothermalCompositionalMultiphas ElementViewConst< arrayView1d< real64 const > > const m_temp; /// Views on phase enthalpies - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const m_phaseEnthalpy; - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const m_dPhaseEnthalpy; + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const m_phaseEnthalpy; + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const m_dPhaseEnthalpy; /// View on thermal conductivity ElementViewConst< arrayView3d< real64 const > > const m_thermalConductivity; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index ca537b2f6a6..246f233bba7 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -650,14 +650,14 @@ void CompositionalMultiphaseWell::updateVolRatesForConstraint( WellElementSubReg string const & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); MultiFluidBase & fluid = subRegion.getConstitutiveModel< MultiFluidBase >( fluidName ); - arrayView3d< real64 const, multifluid::USD_PHASE > const & phaseFrac = fluid.phaseFraction(); - arrayView4d< real64 const, multifluid::USD_PHASE_DC > const & dPhaseFrac = fluid.dPhaseFraction(); + multifluid::ArrayView< real64 const, 3 > const & phaseFrac = fluid.phaseFraction(); + multifluid::ArrayView< real64 const, 4 > const & dPhaseFrac = fluid.dPhaseFraction(); - arrayView2d< real64 const, multifluid::USD_FLUID > const & totalDens = fluid.totalDensity(); - arrayView3d< real64 const, multifluid::USD_FLUID_DC > const & dTotalDens = fluid.dTotalDensity(); + multifluid::ArrayView< real64 const, 2 > const & totalDens = fluid.totalDensity(); + multifluid::ArrayView< real64 const, 3 > const & dTotalDens = fluid.dTotalDensity(); - arrayView3d< real64 const, multifluid::USD_PHASE > const & phaseDens = fluid.phaseDensity(); - arrayView4d< real64 const, multifluid::USD_PHASE_DC > const & dPhaseDens = fluid.dPhaseDensity(); + multifluid::ArrayView< real64 const, 3 > const & phaseDens = fluid.phaseDensity(); + multifluid::ArrayView< real64 const, 4 > const & dPhaseDens = fluid.dPhaseDensity(); // control data @@ -975,8 +975,8 @@ void CompositionalMultiphaseWell::initializeWells( DomainPartition & domain ) // get well secondary variables on well elements string const & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); MultiFluidBase & fluid = getConstitutiveModel< MultiFluidBase >( subRegion, fluidName ); - arrayView3d< real64 const, multifluid::USD_PHASE > const & wellElemPhaseDens = fluid.phaseDensity(); - arrayView2d< real64 const, multifluid::USD_FLUID > const & wellElemTotalDens = fluid.totalDensity(); + multifluid::ArrayView< real64 const, 3 > const & wellElemPhaseDens = fluid.phaseDensity(); + multifluid::ArrayView< real64 const, 2 > const & wellElemTotalDens = fluid.totalDensity(); // 4) Back calculate component densities constitutive::constitutiveUpdatePassThru( fluid, [&] ( auto & castedFluid ) @@ -1112,12 +1112,12 @@ void CompositionalMultiphaseWell::assembleAccumulationTerms( DomainPartition con string const & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ); MultiFluidBase const & fluid = subRegion.getConstitutiveModel< MultiFluidBase >( fluidName ); - arrayView3d< real64 const, multifluid::USD_PHASE > const & wellElemPhaseDens = fluid.phaseDensity(); - arrayView4d< real64 const, multifluid::USD_PHASE_DC > const & dWellElemPhaseDens = fluid.dPhaseDensity(); - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const & wellElemPhaseCompFrac = fluid.phaseCompFraction(); - arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > const & dWellElemPhaseCompFrac = fluid.dPhaseCompFraction(); - arrayView3d< real64 const, multifluid::USD_PHASE > const & wellElemPhaseDens_n = fluid.phaseDensity_n(); - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const & wellElemPhaseCompFrac_n = fluid.phaseCompFraction_n(); + multifluid::ArrayView< real64 const, 3 > const & wellElemPhaseDens = fluid.phaseDensity(); + multifluid::ArrayView< real64 const, 4 > const & dWellElemPhaseDens = fluid.dPhaseDensity(); + multifluid::ArrayView< real64 const, 4 > const & wellElemPhaseCompFrac = fluid.phaseCompFraction(); + multifluid::ArrayView< real64 const, 5 > const & dWellElemPhaseCompFrac = fluid.dPhaseCompFraction(); + multifluid::ArrayView< real64 const, 3 > const & wellElemPhaseDens_n = fluid.phaseDensity_n(); + multifluid::ArrayView< real64 const, 4 > const & wellElemPhaseCompFrac_n = fluid.phaseCompFraction_n(); isothermalCompositionalMultiphaseBaseKernels:: KernelLaunchSelector1< AccumulationKernel >( numFluidComponents(), diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.cpp index 70a8e51721d..e95c2db0bfd 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.cpp @@ -771,12 +771,12 @@ PerforationKernel:: arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const & resPhaseVolFrac, arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > const & dResPhaseVolFrac, arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > const & dResCompFrac_dCompDens, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & resPhaseDens, - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const & dResPhaseDens, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & resPhaseVisc, - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const & dResPhaseVisc, - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP - 2 > const & resPhaseCompFrac, - arraySlice3d< real64 const, multifluid::USD_PHASE_COMP_DC - 2 > const & dResPhaseCompFrac, + multifluid::ArraySlice< real64 const, 1 > const & resPhaseDens, + multifluid::ArraySlice< real64 const, 2 > const & dResPhaseDens, + multifluid::ArraySlice< real64 const, 1 > const & resPhaseVisc, + multifluid::ArraySlice< real64 const, 2 > const & dResPhaseVisc, + multifluid::ArraySlice< real64 const, 2 > const & resPhaseCompFrac, + multifluid::ArraySlice< real64 const, 3 > const & dResPhaseCompFrac, arraySlice1d< real64 const, relperm::USD_RELPERM - 2 > const & resPhaseRelPerm, arraySlice2d< real64 const, relperm::USD_RELPERM_DS - 2 > const & dResPhaseRelPerm_dPhaseVolFrac, real64 const & wellElemGravCoef, @@ -1086,12 +1086,12 @@ PerforationKernel:: ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & resPhaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dResPhaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dResCompFrac_dCompDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & resPhaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dResPhaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & resPhaseVisc, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dResPhaseVisc, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & resPhaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dResPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & resPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dResPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & resPhaseVisc, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dResPhaseVisc, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & resPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dResPhaseCompFrac, ElementViewConst< arrayView3d< real64 const, relperm::USD_RELPERM > > const & resPhaseRelPerm, ElementViewConst< arrayView4d< real64 const, relperm::USD_RELPERM_DS > > const & dResPhaseRelPerm_dPhaseVolFrac, arrayView1d< real64 const > const & wellElemGravCoef, @@ -1164,12 +1164,12 @@ PerforationKernel:: ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & resPhaseVolFrac, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dResPhaseVolFrac, \ ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dResCompFrac_dCompDens, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & resPhaseDens, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dResPhaseDens, \ - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & resPhaseVisc, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dResPhaseVisc, \ - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & resPhaseCompFrac, \ - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dResPhaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & resPhaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dResPhaseDens, \ + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & resPhaseVisc, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dResPhaseVisc, \ + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & resPhaseCompFrac, \ + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dResPhaseCompFrac, \ ElementViewConst< arrayView3d< real64 const, relperm::USD_RELPERM > > const & resPhaseRelPerm, \ ElementViewConst< arrayView4d< real64 const, relperm::USD_RELPERM_DS > > const & dResPhaseRelPerm_dPhaseVolFrac, \ arrayView1d< real64 const > const & wellElemGravCoef, \ @@ -1212,13 +1212,13 @@ AccumulationKernel:: arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const & phaseVolFrac, arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > const & dPhaseVolFrac, arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > const & dCompFrac_dCompDens, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & phaseDens, - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const & dPhaseDens, - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP - 2 > const & phaseCompFrac, - arraySlice3d< real64 const, multifluid::USD_PHASE_COMP_DC - 2 > const & dPhaseCompFrac, + multifluid::ArraySlice< real64 const, 1 > const & phaseDens, + multifluid::ArraySlice< real64 const, 2 > const & dPhaseDens, + multifluid::ArraySlice< real64 const, 2 > const & phaseCompFrac, + multifluid::ArraySlice< real64 const, 3 > const & dPhaseCompFrac, arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const & phaseVolFrac_n, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & phaseDens_n, - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP - 2 > const & phaseCompFrac_n, + multifluid::ArraySlice< real64 const, 1 > const & phaseDens_n, + multifluid::ArraySlice< real64 const, 2 > const & phaseCompFrac_n, real64 ( & localAccum )[NC], real64 ( & localAccumJacobian )[NC][NC + 1] ) { @@ -1297,13 +1297,13 @@ AccumulationKernel:: arrayView2d< real64 const, compflow::USD_PHASE > const & wellElemPhaseVolFrac, arrayView3d< real64 const, compflow::USD_PHASE_DC > const & dWellElemPhaseVolFrac, arrayView3d< real64 const, compflow::USD_COMP_DC > const & dWellElemCompFrac_dCompDens, - arrayView3d< real64 const, multifluid::USD_PHASE > const & wellElemPhaseDens, - arrayView4d< real64 const, multifluid::USD_PHASE_DC > const & dWellElemPhaseDens, - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const & wellElemPhaseCompFrac, - arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > const & dWellElemPhaseCompFrac, + multifluid::ArrayView< real64 const, 3 > const & wellElemPhaseDens, + multifluid::ArrayView< real64 const, 4 > const & dWellElemPhaseDens, + multifluid::ArrayView< real64 const, 4 > const & wellElemPhaseCompFrac, + multifluid::ArrayView< real64 const, 5 > const & dWellElemPhaseCompFrac, arrayView2d< real64 const, compflow::USD_PHASE > const & wellElemPhaseVolFrac_n, - arrayView3d< real64 const, multifluid::USD_PHASE > const & wellElemPhaseDens_n, - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const & wellElemPhaseCompFrac_n, + multifluid::ArrayView< real64 const, 3 > const & wellElemPhaseDens_n, + multifluid::ArrayView< real64 const, 4 > const & wellElemPhaseCompFrac_n, CRSMatrixView< real64, globalIndex const > const & localMatrix, arrayView1d< real64 > const & localRhs ) { @@ -1383,13 +1383,13 @@ AccumulationKernel:: arrayView2d< real64 const, compflow::USD_PHASE > const & wellElemPhaseVolFrac, \ arrayView3d< real64 const, compflow::USD_PHASE_DC > const & dWellElemPhaseVolFrac, \ arrayView3d< real64 const, compflow::USD_COMP_DC > const & dWellElemCompFrac_dCompDens, \ - arrayView3d< real64 const, multifluid::USD_PHASE > const & wellElemPhaseDens, \ - arrayView4d< real64 const, multifluid::USD_PHASE_DC > const & dWellElemPhaseDens, \ - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const & wellElemPhaseCompFrac, \ - arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > const & dWellElemPhaseCompFrac, \ + multifluid::ArrayView< real64 const, 3 > const & wellElemPhaseDens, \ + multifluid::ArrayView< real64 const, 4 > const & dWellElemPhaseDens, \ + multifluid::ArrayView< real64 const, 4 > const & wellElemPhaseCompFrac, \ + multifluid::ArrayView< real64 const, 5 > const & dWellElemPhaseCompFrac, \ arrayView2d< real64 const, compflow::USD_PHASE > const & wellElemPhaseVolFrac_n, \ - arrayView3d< real64 const, multifluid::USD_PHASE > const & wellElemPhaseDens_n, \ - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const & wellElemPhaseCompFrac_n, \ + multifluid::ArrayView< real64 const, 3 > const & wellElemPhaseDens_n, \ + multifluid::ArrayView< real64 const, 4 > const & wellElemPhaseCompFrac_n, \ CRSMatrixView< real64, globalIndex const > const & localMatrix, \ arrayView1d< real64 > const & localRhs ) @@ -1523,7 +1523,7 @@ PresTempCompFracInitializationKernel:: ElementViewConst< arrayView1d< real64 const > > const & resTemp, ElementViewConst< arrayView2d< real64 const, compflow::USD_COMP > > const & resCompDens, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & resPhaseVolFrac, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & resPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & resPhaseMassDens, arrayView1d< localIndex const > const & resElementRegion, arrayView1d< localIndex const > const & resElementSubRegion, arrayView1d< localIndex const > const & resElementIndex, @@ -1718,7 +1718,7 @@ CompDensInitializationKernel:: launch( localIndex const subRegionSize, integer const numComponents, arrayView2d< real64 const, compflow::USD_COMP > const & wellElemCompFrac, - arrayView2d< real64 const, multifluid::USD_FLUID > const & wellElemTotalDens, + multifluid::ArrayView< real64 const, 2 > const & wellElemTotalDens, arrayView2d< real64, compflow::USD_COMP > const & wellElemCompDens ) { forAll< parallelDevicePolicy<> >( subRegionSize, [=] GEOS_HOST_DEVICE ( localIndex const iwelem ) @@ -1738,8 +1738,8 @@ RateInitializationKernel:: integer const targetPhaseIndex, WellControls const & wellControls, real64 const & currentTime, - arrayView3d< real64 const, multifluid::USD_PHASE > const & phaseDens, - arrayView2d< real64 const, multifluid::USD_FLUID > const & totalDens, + multifluid::ArrayView< real64 const, 3 > const & phaseDens, + multifluid::ArrayView< real64 const, 2 > const & totalDens, arrayView1d< real64 > const & connRate ) { WellControls::Control const control = wellControls.getControl(); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.hpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.hpp index ea06e3ae2ad..ebf2844386d 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWellKernels.hpp @@ -272,12 +272,12 @@ struct PerforationKernel arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const & resPhaseVolFrac, arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > const & dResPhaseVolFrac, arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > const & dResCompFrac_dCompDens, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & resPhaseDens, - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const & dResPhaseDens, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & resPhaseVisc, - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const & dResPhaseVisc, - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP - 2 > const & resPhaseCompFrac, - arraySlice3d< real64 const, multifluid::USD_PHASE_COMP_DC - 2 > const & dResPhaseCompFrac, + multifluid::ArraySlice< real64 const, 1 > const & resPhaseDens, + multifluid::ArraySlice< real64 const, 2 > const & dResPhaseDens, + multifluid::ArraySlice< real64 const, 1 > const & resPhaseVisc, + multifluid::ArraySlice< real64 const, 2 > const & dResPhaseVisc, + multifluid::ArraySlice< real64 const, 2 > const & resPhaseCompFrac, + multifluid::ArraySlice< real64 const, 3 > const & dResPhaseCompFrac, arraySlice1d< real64 const, relperm::USD_RELPERM - 2 > const & resPhaseRelPerm, arraySlice2d< real64 const, relperm::USD_RELPERM_DS - 2 > const & dResPhaseRelPerm_dPhaseVolFrac, real64 const & wellElemGravCoef, @@ -302,12 +302,12 @@ struct PerforationKernel ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & resPhaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const & dResPhaseVolFrac_dComp, ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const & dResCompFrac_dCompDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & resPhaseDens, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dResPhaseDens, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & resPhaseVisc, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_DC > > const & dResPhaseVisc, - ElementViewConst< arrayView4d< real64 const, multifluid::USD_PHASE_COMP > > const & resPhaseCompFrac, - ElementViewConst< arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > > const & dResPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & resPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dResPhaseDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & resPhaseVisc, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & dResPhaseVisc, + ElementViewConst< multifluid::ArrayView< real64 const, 4 > > const & resPhaseCompFrac, + ElementViewConst< multifluid::ArrayView< real64 const, 5 > > const & dResPhaseCompFrac, ElementViewConst< arrayView3d< real64 const, relperm::USD_RELPERM > > const & resPhaseRelPerm, ElementViewConst< arrayView4d< real64 const, relperm::USD_RELPERM_DS > > const & dResPhaseRelPerm_dPhaseVolFrac, arrayView1d< real64 const > const & wellElemGravCoef, @@ -347,13 +347,13 @@ struct AccumulationKernel arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const & phaseVolFrac, arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > const & dPhaseVolFrac, arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > const & dCompFrac_dCompDens, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & phaseDens, - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > const & dPhaseDens, - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP - 2 > const & phaseCompFrac, - arraySlice3d< real64 const, multifluid::USD_PHASE_COMP_DC - 2 > const & dPhaseCompFrac, + multifluid::ArraySlice< real64 const, 1 > const & phaseDens, + multifluid::ArraySlice< real64 const, 2 > const & dPhaseDens, + multifluid::ArraySlice< real64 const, 2 > const & phaseCompFrac, + multifluid::ArraySlice< real64 const, 3 > const & dPhaseCompFrac, arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const & phaseVolFrac_n, - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > const & phaseDens_n, - arraySlice2d< real64 const, multifluid::USD_PHASE_COMP - 2 > const & phaseCompFrac_n, + multifluid::ArraySlice< real64 const, 1 > const & phaseDens_n, + multifluid::ArraySlice< real64 const, 2 > const & phaseCompFrac_n, real64 ( &localAccum )[NC], real64 ( &localAccumJacobian )[NC][NC + 1] ); @@ -369,13 +369,13 @@ struct AccumulationKernel arrayView2d< real64 const, compflow::USD_PHASE > const & wellElemPhaseVolFrac, arrayView3d< real64 const, compflow::USD_PHASE_DC > const & dWellElemPhaseVolFrac, arrayView3d< real64 const, compflow::USD_COMP_DC > const & dWellElemCompFrac_dCompDens, - arrayView3d< real64 const, multifluid::USD_PHASE > const & wellElemPhaseDens, - arrayView4d< real64 const, multifluid::USD_PHASE_DC > const & dWellElemPhaseDens, - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const & wellElemPhaseCompFrac, - arrayView5d< real64 const, multifluid::USD_PHASE_COMP_DC > const & dWellElemPhaseCompFrac, + multifluid::ArrayView< real64 const, 3 > const & wellElemPhaseDens, + multifluid::ArrayView< real64 const, 4 > const & dWellElemPhaseDens, + multifluid::ArrayView< real64 const, 4 > const & wellElemPhaseCompFrac, + multifluid::ArrayView< real64 const, 5 > const & dWellElemPhaseCompFrac, arrayView2d< real64 const, compflow::USD_PHASE > const & wellElemPhaseVolFrac_n, - arrayView3d< real64 const, multifluid::USD_PHASE > const & wellElemPhaseDens_n, - arrayView4d< real64 const, multifluid::USD_PHASE_COMP > const & wellElemPhaseCompFrac_n, + multifluid::ArrayView< real64 const, 3 > const & wellElemPhaseDens_n, + multifluid::ArrayView< real64 const, 4 > const & wellElemPhaseCompFrac_n, CRSMatrixView< real64, globalIndex const > const & localMatrix, arrayView1d< real64 > const & localRhs ); @@ -453,7 +453,7 @@ struct PresTempCompFracInitializationKernel ElementViewConst< arrayView1d< real64 const > > const & resTemp, ElementViewConst< arrayView2d< real64 const, compflow::USD_COMP > > const & resCompDens, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const & resPhaseVolFrac, - ElementViewConst< arrayView3d< real64 const, multifluid::USD_PHASE > > const & resPhaseMassDens, + ElementViewConst< multifluid::ArrayView< real64 const, 3 > > const & resPhaseMassDens, arrayView1d< localIndex const > const & resElementRegion, arrayView1d< localIndex const > const & resElementSubRegion, arrayView1d< localIndex const > const & resElementIndex, @@ -474,7 +474,7 @@ struct CompDensInitializationKernel launch( localIndex const subRegionSize, integer const numComponents, arrayView2d< real64 const, compflow::USD_COMP > const & wellElemCompFrac, - arrayView2d< real64 const, multifluid::USD_FLUID > const & wellElemTotalDens, + multifluid::ArrayView< real64 const, 2 > const & wellElemTotalDens, arrayView2d< real64, compflow::USD_COMP > const & wellElemCompDens ); }; @@ -489,8 +489,8 @@ struct RateInitializationKernel integer const targetPhaseIndex, WellControls const & wellControls, real64 const & currentTime, - arrayView3d< real64 const, multifluid::USD_PHASE > const & phaseDens, - arrayView2d< real64 const, multifluid::USD_FLUID > const & totalDens, + multifluid::ArrayView< real64 const, 3 > const & phaseDens, + multifluid::ArrayView< real64 const, 2 > const & totalDens, arrayView1d< real64 > const & connRate ); }; @@ -550,8 +550,8 @@ class TotalMassDensityKernel : public isothermalCompositionalMultiphaseBaseKerne arraySlice1d< real64 const, compflow::USD_PHASE - 1 > phaseVolFrac = m_phaseVolFrac[ei]; arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > dPhaseVolFrac = m_dPhaseVolFrac[ei]; arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > dCompFrac_dCompDens = m_dCompFrac_dCompDens[ei]; - arraySlice1d< real64 const, multifluid::USD_PHASE - 2 > phaseMassDens = m_phaseMassDens[ei][0]; - arraySlice2d< real64 const, multifluid::USD_PHASE_DC - 2 > dPhaseMassDens = m_dPhaseMassDens[ei][0]; + multifluid::ArraySlice< real64 const, 1 > phaseMassDens = m_phaseMassDens[ei][0]; + multifluid::ArraySlice< real64 const, 2 > dPhaseMassDens = m_dPhaseMassDens[ei][0]; real64 & totalMassDens = m_totalMassDens[ei]; real64 & dTotalMassDens_dPres = m_dTotalMassDens_dPres[ei]; arraySlice1d< real64, compflow::USD_FLUID_DC - 1 > dTotalMassDens_dCompDens = m_dTotalMassDens_dCompDens[ei]; @@ -592,8 +592,8 @@ class TotalMassDensityKernel : public isothermalCompositionalMultiphaseBaseKerne arrayView3d< real64 const, compflow::USD_COMP_DC > m_dCompFrac_dCompDens; /// Views on phase mass densities - arrayView3d< real64 const, multifluid::USD_PHASE > m_phaseMassDens; - arrayView4d< real64 const, multifluid::USD_PHASE_DC > m_dPhaseMassDens; + multifluid::ArrayView< real64 const, 3 > m_phaseMassDens; + multifluid::ArrayView< real64 const, 4 > m_dPhaseMassDens; // outputs @@ -824,8 +824,8 @@ class ResidualNormKernel : public solverBaseKernels::ResidualNormKernelBase< 1 > arrayView1d< real64 const > const m_volume; /// View on phase/total density at the previous converged time step - arrayView3d< real64 const, multifluid::USD_PHASE > const m_phaseDens_n; - arrayView2d< real64 const, multifluid::USD_FLUID > const m_totalDens_n; + multifluid::ArrayView< real64 const, 3 > const m_phaseDens_n; + multifluid::ArrayView< real64 const, 2 > const m_totalDens_n; }; diff --git a/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics.hpp b/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics.hpp index d690038b45c..b4cf83a60f9 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics.hpp @@ -20,6 +20,7 @@ #define GEOS_PHYSICSSOLVERS_MULTIPHYSICS_POROMECHANICSKERNELS_MULTIPHASEPOROMECHANICS_HPP_ #include "codingUtilities/Utilities.hpp" +#include "constitutive/fluid/multifluid/Layouts.hpp" #include "physicsSolvers/fluidFlow/CompositionalMultiphaseBaseFields.hpp" #include "physicsSolvers/multiphysics/PoromechanicsFields.hpp" #include "physicsSolvers/multiphysics/poromechanicsKernels/PoromechanicsBase.hpp" @@ -27,6 +28,8 @@ namespace geos { +using namespace constitutive; + namespace poromechanicsKernels { @@ -317,18 +320,18 @@ class MultiphasePoromechanics : protected: /// Views on phase densities and derivatives - arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > m_fluidPhaseDensity; - arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > m_fluidPhaseDensity_n; - arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > m_dFluidPhaseDensity; + multifluid::ArrayView< real64 const, 3 > m_fluidPhaseDensity; + multifluid::ArrayView< real64 const, 3 > m_fluidPhaseDensity_n; + multifluid::ArrayView< real64 const, 4 > m_dFluidPhaseDensity; /// Views on phase component fractions and derivatives - arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_COMP > m_fluidPhaseCompFrac; - arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_COMP > m_fluidPhaseCompFrac_n; - arrayView5d< real64 const, constitutive::multifluid::USD_PHASE_COMP_DC > m_dFluidPhaseCompFrac; + multifluid::ArrayView< real64 const, 4 > m_fluidPhaseCompFrac; + multifluid::ArrayView< real64 const, 4 > m_fluidPhaseCompFrac_n; + multifluid::ArrayView< real64 const, 5 > m_dFluidPhaseCompFrac; /// Views on phase mass densities - arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > m_fluidPhaseMassDensity; - arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > m_dFluidPhaseMassDensity; + multifluid::ArrayView< real64 const, 3 > m_fluidPhaseMassDensity; + multifluid::ArrayView< real64 const, 4 > m_dFluidPhaseMassDensity; /// Views on phase volume fraction (saturation) arrayView2d< real64 const, compflow::USD_PHASE > const m_fluidPhaseVolFrac; @@ -445,7 +448,7 @@ class MultiphaseBulkDensityKernel arrayView2d< real64 const > const m_rockDensity; // the fluid density - arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > const m_fluidPhaseDensity; + multifluid::ArrayView< real64 const, 3 > const m_fluidPhaseDensity; // the porosity arrayView2d< real64 const > const m_porosity; diff --git a/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics_impl.hpp b/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics_impl.hpp index 441bd7c0a6d..7837203b64c 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics_impl.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics_impl.hpp @@ -210,8 +210,8 @@ computeBodyForce( localIndex const k, GEOS_UNUSED_VAR( dPorosity_dTemperature ); - arraySlice1d< real64 const, constitutive::multifluid::USD_PHASE - 2 > const phaseMassDensity = m_fluidPhaseMassDensity[k][q]; - arraySlice2d< real64 const, constitutive::multifluid::USD_PHASE_DC - 2 > const dPhaseMassDensity = m_dFluidPhaseMassDensity[k][q]; + multifluid::ArraySlice< real64 const, 1 > const phaseMassDensity = m_fluidPhaseMassDensity[k][q]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseMassDensity = m_dFluidPhaseMassDensity[k][q]; arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const phaseVolFrac = m_fluidPhaseVolFrac[k]; arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > const dPhaseVolFrac = m_dFluidPhaseVolFrac[k]; arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > const dGlobalCompFrac_dGlobalCompDensity = m_dGlobalCompFraction_dGlobalCompDensity[k]; @@ -287,12 +287,12 @@ computeFluidIncrement( localIndex const k, real64 dPhaseAmount_dC[maxNumComponents]{}; real64 dPhaseCompFrac_dC[maxNumComponents]{}; - arraySlice1d< real64 const, constitutive::multifluid::USD_PHASE - 2 > const phaseDensity = m_fluidPhaseDensity[k][q]; - arraySlice1d< real64 const, constitutive::multifluid::USD_PHASE - 2 > const phaseDensity_n = m_fluidPhaseDensity_n[k][q]; - arraySlice2d< real64 const, constitutive::multifluid::USD_PHASE_DC - 2 > const dPhaseDensity = m_dFluidPhaseDensity[k][q]; - arraySlice2d< real64 const, constitutive::multifluid::USD_PHASE_COMP - 2 > const phaseCompFrac = m_fluidPhaseCompFrac[k][q]; - arraySlice2d< real64 const, constitutive::multifluid::USD_PHASE_COMP - 2 > const phaseCompFrac_n = m_fluidPhaseCompFrac_n[k][q]; - arraySlice3d< real64 const, constitutive::multifluid::USD_PHASE_COMP_DC -2 > const dPhaseCompFrac = m_dFluidPhaseCompFrac[k][q]; + multifluid::ArraySlice< real64 const, 1 > const phaseDensity = m_fluidPhaseDensity[k][q]; + multifluid::ArraySlice< real64 const, 1 > const phaseDensity_n = m_fluidPhaseDensity_n[k][q]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseDensity = m_dFluidPhaseDensity[k][q]; + multifluid::ArraySlice< real64 const, 2 > const phaseCompFrac = m_fluidPhaseCompFrac[k][q]; + multifluid::ArraySlice< real64 const, 2 > const phaseCompFrac_n = m_fluidPhaseCompFrac_n[k][q]; + multifluid::ArraySlice< real64 const, 3 > const dPhaseCompFrac = m_dFluidPhaseCompFrac[k][q]; arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const phaseVolFrac = m_fluidPhaseVolFrac[k]; arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const phaseVolFrac_n = m_fluidPhaseVolFrac_n[k]; arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > const dPhaseVolFrac = m_dFluidPhaseVolFrac[k]; diff --git a/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/ThermalMultiphasePoromechanics.hpp b/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/ThermalMultiphasePoromechanics.hpp index 5c60e6820da..db135403dd4 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/ThermalMultiphasePoromechanics.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/ThermalMultiphasePoromechanics.hpp @@ -314,9 +314,9 @@ class ThermalMultiphasePoromechanics : protected: /// Views on phase internal energy - arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > m_fluidPhaseInternalEnergy_n; - arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > m_fluidPhaseInternalEnergy; - arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > m_dFluidPhaseInternalEnergy; + multifluid::ArrayView< real64 const, 3 > m_fluidPhaseInternalEnergy_n; + multifluid::ArrayView< real64 const, 3 > m_fluidPhaseInternalEnergy; + multifluid::ArrayView< real64 const, 4 > m_dFluidPhaseInternalEnergy; /// Views on rock internal energy arrayView2d< real64 const > const m_rockInternalEnergy_n; diff --git a/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/ThermalMultiphasePoromechanics_impl.hpp b/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/ThermalMultiphasePoromechanics_impl.hpp index 85dd0ec4da6..9b8b8e9e1d4 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/ThermalMultiphasePoromechanics_impl.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/poromechanicsKernels/ThermalMultiphasePoromechanics_impl.hpp @@ -196,8 +196,8 @@ computeBodyForce( localIndex const k, { GEOS_UNUSED_VAR( mixtureDensity ); - arraySlice1d< real64 const, constitutive::multifluid::USD_PHASE - 2 > const phaseMassDensity = m_fluidPhaseMassDensity[k][q]; - arraySlice2d< real64 const, constitutive::multifluid::USD_PHASE_DC - 2 > const dPhaseMassDensity = m_dFluidPhaseMassDensity[k][q]; + multifluid::ArraySlice< real64 const, 1 > const phaseMassDensity = m_fluidPhaseMassDensity[k][q]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseMassDensity = m_dFluidPhaseMassDensity[k][q]; arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const phaseVolFrac = m_fluidPhaseVolFrac[k]; arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > const dPhaseVolFrac = m_dFluidPhaseVolFrac[k]; @@ -269,13 +269,13 @@ computeFluidIncrement( localIndex const k, real64 dPhaseInternalEnergy_dC[maxNumComponents]{}; // construct the slices - arraySlice1d< real64 const, constitutive::multifluid::USD_PHASE - 2 > const phaseInternalEnergy_n = m_fluidPhaseInternalEnergy_n[k][q]; - arraySlice1d< real64 const, constitutive::multifluid::USD_PHASE - 2 > const phaseInternalEnergy = m_fluidPhaseInternalEnergy[k][q]; - arraySlice2d< real64 const, constitutive::multifluid::USD_PHASE_DC - 2 > const dPhaseInternalEnergy = m_dFluidPhaseInternalEnergy[k][q]; - arraySlice1d< real64 const, constitutive::multifluid::USD_PHASE - 2 > const phaseDensity = m_fluidPhaseDensity[k][q]; - arraySlice2d< real64 const, constitutive::multifluid::USD_PHASE_DC - 2 > const dPhaseDensity = m_dFluidPhaseDensity[k][q]; - arraySlice2d< real64 const, constitutive::multifluid::USD_PHASE_COMP - 2 > const phaseCompFrac = m_fluidPhaseCompFrac[k][q]; - arraySlice3d< real64 const, constitutive::multifluid::USD_PHASE_COMP_DC -2 > const dPhaseCompFrac = m_dFluidPhaseCompFrac[k][q]; + multifluid::ArraySlice< real64 const, 1 > const phaseInternalEnergy_n = m_fluidPhaseInternalEnergy_n[k][q]; + multifluid::ArraySlice< real64 const, 1 > const phaseInternalEnergy = m_fluidPhaseInternalEnergy[k][q]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseInternalEnergy = m_dFluidPhaseInternalEnergy[k][q]; + multifluid::ArraySlice< real64 const, 1 > const phaseDensity = m_fluidPhaseDensity[k][q]; + multifluid::ArraySlice< real64 const, 2 > const dPhaseDensity = m_dFluidPhaseDensity[k][q]; + multifluid::ArraySlice< real64 const, 2 > const phaseCompFrac = m_fluidPhaseCompFrac[k][q]; + multifluid::ArraySlice< real64 const, 3 > const dPhaseCompFrac = m_dFluidPhaseCompFrac[k][q]; arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const phaseVolFrac = m_fluidPhaseVolFrac[k]; arraySlice2d< real64 const, compflow::USD_PHASE_DC - 1 > const dPhaseVolFrac = m_dFluidPhaseVolFrac[k]; arraySlice2d< real64 const, compflow::USD_COMP_DC - 1 > const dGlobalCompFrac_dGlobalCompDensity = m_dGlobalCompFraction_dGlobalCompDensity[k]; diff --git a/src/coreComponents/unitTests/constitutiveTests/testCO2BrinePVTModels.cpp b/src/coreComponents/unitTests/constitutiveTests/testCO2BrinePVTModels.cpp index 5012287a2f1..4c8e3bcd6d5 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testCO2BrinePVTModels.cpp +++ b/src/coreComponents/unitTests/constitutiveTests/testCO2BrinePVTModels.cpp @@ -37,7 +37,6 @@ using namespace geos::constitutive; using namespace geos::dataRepository; using namespace geos::stringutilities; using namespace geos::constitutive::PVTProps; -using namespace geos::constitutive::multifluid; /// Input tables written into temporary files during testing @@ -100,15 +99,13 @@ void testValuesAgainstPreviousImplementation( FLASH_WRAPPER const & flashModelWr integer constexpr numComp = 2; integer constexpr numDof = numComp + 2; - StackArray< real64, 3, numPhase, LAYOUT_PHASE > phaseFrac( 1, 1, numPhase ); - StackArray< real64, 4, numDof *numPhase, LAYOUT_PHASE_DC > dPhaseFrac( 1, 1, numPhase, numDof ); - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > - phaseFracAndDeriv { phaseFrac[0][0], dPhaseFrac[0][0] }; + multifluid::StackArray< real64, 3, numPhase > phaseFrac( 1, 1, numPhase ); + multifluid::StackArray< real64, 4, numDof * numPhase > dPhaseFrac( 1, 1, numPhase, numDof ); + MultiFluidVarSlice< real64, 1 > phaseFracAndDeriv { phaseFrac[0][0], dPhaseFrac[0][0] }; - StackArray< real64, 4, numComp *numPhase, LAYOUT_PHASE_COMP > phaseCompFrac( 1, 1, numPhase, numComp ); - StackArray< real64, 5, numDof *numComp *numPhase, LAYOUT_PHASE_COMP_DC > dPhaseCompFrac( 1, 1, numPhase, numComp, numDof ); - MultiFluidVarSlice< real64, 2, USD_PHASE_COMP - 2, USD_PHASE_COMP_DC - 2 > - phaseCompFracAndDeriv { phaseCompFrac[0][0], dPhaseCompFrac[0][0] }; + multifluid::StackArray< real64, 4, numComp * numPhase > phaseCompFrac( 1, 1, numPhase, numComp ); + multifluid::StackArray< real64, 5, numDof * numComp * numPhase > dPhaseCompFrac( 1, 1, numPhase, numComp, numDof ); + MultiFluidVarSlice< real64, 2 > phaseCompFracAndDeriv { phaseCompFrac[0][0], dPhaseCompFrac[0][0] }; flashModelWrapper.compute( pressure, temperature, @@ -227,15 +224,13 @@ void testNumericalDerivatives( FLASH_WRAPPER const & flashModelWrapper, // 1) First compute the unperturbed pressure - StackArray< real64, 3, numPhase, LAYOUT_PHASE > phaseFrac( 1, 1, numPhase ); - StackArray< real64, 4, numDof *numPhase, LAYOUT_PHASE_DC > dPhaseFrac( 1, 1, numPhase, numDof ); - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > - phaseFracAndDeriv { phaseFrac[0][0], dPhaseFrac[0][0] }; + multifluid::StackArray< real64, 3, numPhase > phaseFrac( 1, 1, numPhase ); + multifluid::StackArray< real64, 4, numDof * numPhase > dPhaseFrac( 1, 1, numPhase, numDof ); + MultiFluidVarSlice< real64, 1> phaseFracAndDeriv { phaseFrac[0][0], dPhaseFrac[0][0] }; - StackArray< real64, 4, numComp *numPhase, LAYOUT_PHASE_COMP > phaseCompFrac( 1, 1, numPhase, numComp ); - StackArray< real64, 5, numDof *numComp *numPhase, LAYOUT_PHASE_COMP_DC > dPhaseCompFrac( 1, 1, numPhase, numComp, numDof ); - MultiFluidVarSlice< real64, 2, USD_PHASE_COMP - 2, USD_PHASE_COMP_DC - 2 > - phaseCompFracAndDeriv { phaseCompFrac[0][0], dPhaseCompFrac[0][0] }; + multifluid::StackArray< real64, 4, numComp * numPhase > phaseCompFrac( 1, 1, numPhase, numComp ); + multifluid::StackArray< real64, 5, numDof * numComp * numPhase > dPhaseCompFrac( 1, 1, numPhase, numComp, numDof ); + MultiFluidVarSlice< real64, 2 > phaseCompFracAndDeriv { phaseCompFrac[0][0], dPhaseCompFrac[0][0] }; flashModelWrapper.compute( pressure, temperature, @@ -243,15 +238,13 @@ void testNumericalDerivatives( FLASH_WRAPPER const & flashModelWrapper, phaseFracAndDeriv, phaseCompFracAndDeriv ); - StackArray< real64, 3, numPhase, LAYOUT_PHASE > perturbedPhaseFrac( 1, 1, numPhase ); - StackArray< real64, 4, numDof *numPhase, LAYOUT_PHASE_DC > dPerturbedPhaseFrac( 1, 1, numPhase, numDof ); - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > - perturbedPhaseFracAndDeriv { perturbedPhaseFrac[0][0], dPerturbedPhaseFrac[0][0] }; + multifluid::StackArray< real64, 3, numPhase > perturbedPhaseFrac( 1, 1, numPhase ); + multifluid::StackArray< real64, 4, numDof * numPhase > dPerturbedPhaseFrac( 1, 1, numPhase, numDof ); + MultiFluidVarSlice< real64, 1 > perturbedPhaseFracAndDeriv { perturbedPhaseFrac[0][0], dPerturbedPhaseFrac[0][0] }; - StackArray< real64, 4, numComp *numPhase, LAYOUT_PHASE_COMP > perturbedPhaseCompFrac( 1, 1, numPhase, numComp ); - StackArray< real64, 5, numDof *numComp *numPhase, LAYOUT_PHASE_COMP_DC > dPerturbedPhaseCompFrac( 1, 1, numPhase, numComp, numDof ); - MultiFluidVarSlice< real64, 2, USD_PHASE_COMP - 2, USD_PHASE_COMP_DC - 2 > - perturbedPhaseCompFracAndDeriv { perturbedPhaseCompFrac[0][0], dPerturbedPhaseCompFrac[0][0] }; + multifluid::StackArray< real64, 4, numComp * numPhase > perturbedPhaseCompFrac( 1, 1, numPhase, numComp ); + multifluid::StackArray< real64, 5, numDof * numComp * numPhase > dPerturbedPhaseCompFrac( 1, 1, numPhase, numComp, numDof ); + MultiFluidVarSlice< real64, 2> perturbedPhaseCompFracAndDeriv { perturbedPhaseCompFrac[0][0], dPerturbedPhaseCompFrac[0][0] }; // 2) Check derivative with respect to pressure real64 const dP = perturbParameter * (pressure + perturbParameter); diff --git a/src/coreComponents/unitTests/constitutiveTests/testMultiFluid.cpp b/src/coreComponents/unitTests/constitutiveTests/testMultiFluid.cpp index 2297aaba3f3..c743d0a30b8 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testMultiFluid.cpp +++ b/src/coreComponents/unitTests/constitutiveTests/testMultiFluid.cpp @@ -30,7 +30,6 @@ using namespace geos; using namespace geos::testing; using namespace geos::constitutive; -using namespace geos::constitutive::multifluid; using namespace geos::dataRepository; using namespace geos::constitutive::PVTProps; @@ -148,27 +147,27 @@ void testNumericalDerivatives( MultiFluidBase & fluid, #define GET_FLUID_DATA( FLUID, TRAIT ) \ FLUID.getReference< TRAIT::type >( TRAIT::key() )[0][0] - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > phaseFrac { + MultiFluidVarSlice< real64, 1 > phaseFrac { GET_FLUID_DATA( fluid, fields::multifluid::phaseFraction ), GET_FLUID_DATA( fluid, fields::multifluid::dPhaseFraction ) }; - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > phaseDens { + MultiFluidVarSlice< real64, 1 > phaseDens { GET_FLUID_DATA( fluid, fields::multifluid::phaseDensity ), GET_FLUID_DATA( fluid, fields::multifluid::dPhaseDensity ) }; - MultiFluidVarSlice< real64, 1, USD_PHASE - 2, USD_PHASE_DC - 2 > phaseVisc { + MultiFluidVarSlice< real64, 1 > phaseVisc { GET_FLUID_DATA( fluid, fields::multifluid::phaseViscosity ), GET_FLUID_DATA( fluid, fields::multifluid::dPhaseViscosity ) }; - MultiFluidVarSlice< real64, 2, USD_PHASE_COMP - 2, USD_PHASE_COMP_DC - 2 > phaseCompFrac { + MultiFluidVarSlice< real64, 2 > phaseCompFrac { GET_FLUID_DATA( fluid, fields::multifluid::phaseCompFraction ), GET_FLUID_DATA( fluid, fields::multifluid::dPhaseCompFraction ) }; - MultiFluidVarSlice< real64, 0, USD_FLUID - 2, USD_FLUID_DC - 2 > totalDens { + MultiFluidVarSlice< real64, 0 > totalDens { GET_FLUID_DATA( fluid, fields::multifluid::totalDensity ), GET_FLUID_DATA( fluid, fields::multifluid::dTotalDensity ) }; @@ -313,22 +312,22 @@ void testValuesAgainstPreviousImplementation( CO2BrinePhillipsFluid::KernelWrapp } arraySlice1d< real64 const, compflow::USD_COMP - 1 > const composition = compositionValues[0]; - StackArray< real64, 3, numPhase, LAYOUT_PHASE > phaseFraction( 1, 1, numPhase ); - StackArray< real64, 4, numDof *numPhase, LAYOUT_PHASE_DC > dPhaseFraction( 1, 1, numPhase, numDof ); - StackArray< real64, 3, numPhase, LAYOUT_PHASE > phaseDensity( 1, 1, numPhase ); - StackArray< real64, 4, numDof *numPhase, LAYOUT_PHASE_DC > dPhaseDensity( 1, 1, numPhase, numDof ); - StackArray< real64, 3, numPhase, LAYOUT_PHASE > phaseMassDensity( 1, 1, numPhase ); - StackArray< real64, 4, numDof *numPhase, LAYOUT_PHASE_DC > dPhaseMassDensity( 1, 1, numPhase, numDof ); - StackArray< real64, 3, numPhase, LAYOUT_PHASE > phaseViscosity( 1, 1, numPhase ); - StackArray< real64, 4, numDof *numPhase, LAYOUT_PHASE_DC > dPhaseViscosity( 1, 1, numPhase, numDof ); - StackArray< real64, 3, numPhase, LAYOUT_PHASE > phaseEnthalpy( 1, 1, numPhase ); - StackArray< real64, 4, numDof *numPhase, LAYOUT_PHASE_DC > dPhaseEnthalpy( 1, 1, numPhase, numDof ); - StackArray< real64, 3, numPhase, LAYOUT_PHASE > phaseInternalEnergy( 1, 1, numPhase ); - StackArray< real64, 4, numDof *numPhase, LAYOUT_PHASE_DC > dPhaseInternalEnergy( 1, 1, numPhase, numDof ); - StackArray< real64, 4, numComp *numPhase, LAYOUT_PHASE_COMP > phaseCompFraction( 1, 1, numPhase, numComp ); - StackArray< real64, 5, numDof *numComp *numPhase, LAYOUT_PHASE_COMP_DC > dPhaseCompFraction( 1, 1, numPhase, numComp, numDof ); - StackArray< real64, 2, 1, LAYOUT_FLUID > totalDensity( 1, 1 ); - StackArray< real64, 3, numDof, LAYOUT_FLUID_DC > dTotalDensity( 1, 1, numDof ); + multifluid::StackArray< real64, 3, numPhase > phaseFraction( 1, 1, numPhase ); + multifluid::StackArray< real64, 4, numDof * numPhase > dPhaseFraction( 1, 1, numPhase, numDof ); + multifluid::StackArray< real64, 3, numPhase > phaseDensity( 1, 1, numPhase ); + multifluid::StackArray< real64, 4, numDof * numPhase > dPhaseDensity( 1, 1, numPhase, numDof ); + multifluid::StackArray< real64, 3, numPhase > phaseMassDensity( 1, 1, numPhase ); + multifluid::StackArray< real64, 4, numDof * numPhase > dPhaseMassDensity( 1, 1, numPhase, numDof ); + multifluid::StackArray< real64, 3, numPhase > phaseViscosity( 1, 1, numPhase ); + multifluid::StackArray< real64, 4, numDof * numPhase > dPhaseViscosity( 1, 1, numPhase, numDof ); + multifluid::StackArray< real64, 3, numPhase > phaseEnthalpy( 1, 1, numPhase ); + multifluid::StackArray< real64, 4, numDof * numPhase > dPhaseEnthalpy( 1, 1, numPhase, numDof ); + multifluid::StackArray< real64, 3, numPhase > phaseInternalEnergy( 1, 1, numPhase ); + multifluid::StackArray< real64, 4, numDof * numPhase > dPhaseInternalEnergy( 1, 1, numPhase, numDof ); + multifluid::StackArray< real64, 4, numComp * numPhase > phaseCompFraction( 1, 1, numPhase, numComp ); + multifluid::StackArray< real64, 5, numDof * numComp * numPhase > dPhaseCompFraction( 1, 1, numPhase, numComp, numDof ); + multifluid::StackArray< real64, 2, 1 > totalDensity( 1, 1 ); + multifluid::StackArray< real64, 3, numDof > dTotalDensity( 1, 1, numDof ); wrapper.compute( P, T, composition, { diff --git a/src/coreComponents/unitTests/fluidFlowTests/testCompFlowUtils.hpp b/src/coreComponents/unitTests/fluidFlowTests/testCompFlowUtils.hpp index eebfa0a114c..648bc88c772 100644 --- a/src/coreComponents/unitTests/fluidFlowTests/testCompFlowUtils.hpp +++ b/src/coreComponents/unitTests/fluidFlowTests/testCompFlowUtils.hpp @@ -32,7 +32,6 @@ namespace testing { using namespace geos::constitutive; -using namespace geos::constitutive::multifluid; void checkDerivative( real64 const valueEps, real64 const value,