diff --git a/src/coreComponents/physicsSolvers/fluidFlow/kernels/singlePhase/MobilityKernel.hpp b/src/coreComponents/physicsSolvers/fluidFlow/kernels/singlePhase/MobilityKernel.hpp index e283e5fe06..f2f5f4db7b 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/kernels/singlePhase/MobilityKernel.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/kernels/singlePhase/MobilityKernel.hpp @@ -22,6 +22,7 @@ #include "common/DataTypes.hpp" #include "common/GEOS_RAJA_Interface.hpp" +#include "constitutive/fluid/singlefluid/SingleFluidLayouts.hpp" namespace geos { @@ -48,25 +49,6 @@ struct MobilityKernel dMob_dPres = dDens_dP / visc - mob / visc * dVisc_dP; // tjb keep } -// Thermal version - GEOS_HOST_DEVICE - inline - static void - old_compute( real64 const & dens, - real64 const & dDens_dP, // tjb - real64 const & dDens_dT, // tjb - real64 const & visc, - real64 const & dVisc_dP, // tjb - real64 const & dVisc_dT, // tjb - real64 & mob, - real64 & dMob_dPres, - real64 & dMob_dTemp ) - { - mob = dens / visc; - dMob_dPres = dDens_dP / visc - mob / visc * dVisc_dP; - dMob_dTemp = dDens_dT / visc - mob / visc * dVisc_dT; - } - // Value-only (no derivatives) version GEOS_HOST_DEVICE inline diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index e013bde457..dcafd19866 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -461,6 +461,10 @@ + + + + @@ -2149,7 +2153,7 @@ the relative residual norm satisfies: - + @@ -2230,6 +2234,7 @@ the relative residual norm satisfies: + @@ -3156,7 +3161,7 @@ Level 0 outputs no specific information for this solver. Higher levels require m - + @@ -3179,7 +3184,7 @@ Local- Add jump stabilization on interior of macro elements--> - + @@ -4251,6 +4256,58 @@ Level 0 outputs no specific information for this solver. Higher levels require m + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index 5de00ab14f..d0f63172d7 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -471,7 +471,7 @@ - + @@ -540,6 +540,7 @@ + @@ -555,7 +556,7 @@ - + @@ -592,7 +593,7 @@ - + @@ -643,7 +644,7 @@ - + @@ -684,7 +685,7 @@ - + @@ -717,7 +718,7 @@ - + @@ -728,7 +729,7 @@ - + @@ -741,7 +742,7 @@ - + @@ -754,7 +755,7 @@ - + @@ -770,7 +771,7 @@ - + @@ -804,7 +805,7 @@ - + @@ -867,7 +868,7 @@ - + @@ -898,7 +899,7 @@ - + @@ -911,7 +912,7 @@ - + @@ -924,7 +925,7 @@ - + @@ -937,7 +938,7 @@ - + @@ -950,7 +951,7 @@ - + @@ -965,7 +966,7 @@ - + @@ -976,7 +977,7 @@ - + @@ -989,7 +990,7 @@ - + @@ -1000,7 +1001,7 @@ - + @@ -1022,7 +1023,7 @@ - + @@ -1035,7 +1036,7 @@ - + @@ -1046,7 +1047,7 @@ - + @@ -1057,7 +1058,7 @@ - + @@ -1070,7 +1071,7 @@ - + @@ -1085,7 +1086,7 @@ - + @@ -1100,7 +1101,7 @@ - + @@ -1113,7 +1114,7 @@ - + @@ -1128,7 +1129,7 @@ - + @@ -1139,7 +1140,7 @@ - + @@ -1152,7 +1153,7 @@ - + @@ -1165,7 +1166,7 @@ - + @@ -1180,7 +1181,7 @@ - + @@ -1196,7 +1197,7 @@ - + @@ -1211,7 +1212,7 @@ - + @@ -1228,7 +1229,7 @@ - + @@ -1245,7 +1246,24 @@ - + + + + + + + + + + + + + + + + + + @@ -1260,7 +1278,7 @@ - + @@ -1273,7 +1291,7 @@ - + @@ -1312,7 +1330,7 @@ - + @@ -1341,7 +1359,7 @@ - + @@ -1434,7 +1452,7 @@ - + @@ -2083,29 +2101,21 @@ - - - - - - - - - - - - - - - - + + + + + + + + - + @@ -2598,14 +2608,10 @@ - - - - - - - - + + + + @@ -2614,25 +2620,21 @@ - - - - + + - - - - + + - + @@ -2857,29 +2859,21 @@ - - - - - - - - - - - - - - - - + + + + + + + + - + @@ -3058,7 +3052,7 @@ - + @@ -3086,7 +3080,7 @@ - + @@ -3105,11 +3099,11 @@ - + - + @@ -3119,7 +3113,7 @@ - + @@ -3129,11 +3123,11 @@ - + - + @@ -3143,7 +3137,7 @@ - + @@ -3153,7 +3147,7 @@ - + @@ -3163,7 +3157,7 @@ - + @@ -3187,7 +3181,7 @@ - + @@ -3205,7 +3199,7 @@ - + @@ -3217,7 +3211,7 @@ - + @@ -3229,7 +3223,7 @@ - + @@ -3237,11 +3231,11 @@ - + - + @@ -3264,7 +3258,7 @@ - + @@ -3290,7 +3284,7 @@ - + @@ -3311,7 +3305,7 @@ - + @@ -3341,7 +3335,7 @@ - + @@ -3355,7 +3349,7 @@ - + @@ -3382,7 +3376,7 @@ - + @@ -3421,7 +3415,7 @@ - + diff --git a/src/coreComponents/unitTests/fluidFlowTests/testSingleFlowUtils.hpp b/src/coreComponents/unitTests/fluidFlowTests/testSingleFlowUtils.hpp index d42ca9877c..bbcee3bd85 100644 --- a/src/coreComponents/unitTests/fluidFlowTests/testSingleFlowUtils.hpp +++ b/src/coreComponents/unitTests/fluidFlowTests/testSingleFlowUtils.hpp @@ -19,6 +19,7 @@ #include "codingUtilities/UnitTestUtilities.hpp" #include "constitutive/ConstitutiveManager.hpp" #include "constitutive/fluid/singlefluid/SingleFluidBase.hpp" +#include "constitutive/fluid/singlefluid/SingleFluidLayouts.hpp" #include "mesh/MeshManager.hpp" #include "mainInterface/ProblemManager.hpp" #include "physicsSolvers/fluidFlow/SinglePhaseBase.hpp" @@ -94,6 +95,7 @@ void testMobilityNumericalDerivatives( SinglePhaseFVM<> & solver, real64 const perturbParameter, real64 const relTol ) { + using DerivOffset = constitutive::singlefluid::DerivativeOffsetC< 0 >; solver.forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const, MeshLevel & mesh, @@ -114,8 +116,8 @@ void testMobilityNumericalDerivatives( SinglePhaseFVM<> & solver, arrayView1d< real64 > const mob = subRegion.getField< fields::flow::mobility >(); - arrayView1d< real64 > const dMob_dPres = - subRegion.getField< fields::flow::dMobility_dPressure >(); + arrayView2d< real64 > const dMob = + subRegion.getField< fields::flow::dMobility >(); // reset the solver state to zero out variable updates solver.resetStateToBeginningOfStep( domain ); @@ -144,7 +146,7 @@ void testMobilityNumericalDerivatives( SinglePhaseFVM<> & solver, real64 const delta = pres[ei] - pres_n[ei]; checkDerivative( mob[ei], mobOrig[ei], - dMob_dPres[ei], + dMob[ei][DerivOffset::dP], delta, relTol, "mob", @@ -154,15 +156,16 @@ void testMobilityNumericalDerivatives( SinglePhaseFVM<> & solver, // Step 2: update temperature and check derivatives - if( isThermal ) + if ( isThermal ) { + using DerivOffsetTherm = constitutive::singlefluid::DerivativeOffsetC< 1 >; arrayView1d< real64 > const temp = subRegion.getField< fields::flow::temperature >(); arrayView1d< real64 const > const temp_n = subRegion.getField< fields::flow::temperature_n >(); - arrayView1d< real64 > const dMob_dTemp = - subRegion.getField< fields::flow::dMobility_dTemperature >(); + arrayView2d< real64 > const dMobTherm = + subRegion.getField< fields::flow::dMobility>(); // reset the solver state to zero out variable updates (resetting the whole domain is overkill...) solver.resetStateToBeginningOfStep( domain ); @@ -184,7 +187,7 @@ void testMobilityNumericalDerivatives( SinglePhaseFVM<> & solver, real64 const delta = temp[ei] - temp_n[ei]; checkDerivative( mob[ei], mobOrig[ei], - dMob_dTemp[ei], + dMobTherm[ei][DerivOffsetTherm::dT], delta, relTol, "mob", diff --git a/src/coreComponents/unitTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp b/src/coreComponents/unitTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp index 043a6720da..12d0f02016 100644 --- a/src/coreComponents/unitTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp +++ b/src/coreComponents/unitTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp @@ -43,7 +43,7 @@ TEST( SinglePhaseBaseKernels, mobility ) real64 mob; real64 dMob_dPres; - MobilityKernel::compute( dens[i], dDens_dPres[i], dDens_dPres[i], visc[i], dVisc_dPres[i], dVisc_dPres[i], mob, dMob_dPres ); + MobilityKernel::compute( dens[i], dDens_dPres[i], visc[i], dVisc_dPres[i], mob, dMob_dPres ); // compute etalon real64 const mob_et = dens[i] / visc[i];