20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_IHUPHASEFLUX_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_IHUPHASEFLUX_HPP
25 #include "constitutive/fluid/multifluid/Layouts.hpp"
26 #include "constitutive/capillaryPressure/Layouts.hpp"
33 namespace isothermalCompositionalMultiphaseFVMKernelUtilities
36 template<
typename VIEWTYPE >
37 using ElementViewConst = ElementRegionManager::ElementViewConst< VIEWTYPE >;
39 using Deriv = constitutive::multifluid::DerivativeOffset;
42 namespace UpwindHelpers
45 template< localIndex numComp >
47 static void assignToZero(
real64 & deriv_dP,
real64 ( & deriv_dC )[numComp] )
56 template< localIndex numComp >
58 static void assignToZero(
real64 & value,
real64 & deriv_dP,
real64 ( & deriv_dC )[numComp] )
61 assignToZero( deriv_dP, deriv_dC );
64 template< localIndex numComp, localIndex numFluxSupportPo
ints >
66 static void assignToZero(
real64 & value,
real64 ( & deriv_dP )[numFluxSupportPoints],
real64 ( & deriv_dC )[numFluxSupportPoints][numComp] )
69 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
71 assignToZero( deriv_dP[ke], deriv_dC[ke] );
75 template< localIndex numComp >
77 static void addToDerivativesScaled(
real64 const ( &dDeriv_dP ),
real64 const ( &dDeriv_dC )[numComp],
81 deriv_dP += dDeriv_dP * factor;
83 deriv_dC[ic] += dDeriv_dC[ic] * factor;
86 template< localIndex numComp, localIndex numFluxSupportPo
ints >
88 static void addToDerivativesScaled(
real64 const ( &dDeriv_dP )[numFluxSupportPoints],
real64 const ( &dDeriv_dC )[numFluxSupportPoints][numComp],
90 real64 ( & deriv_dP )[numFluxSupportPoints],
real64 ( & deriv_dC )[numFluxSupportPoints][numComp] )
92 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
94 addToDerivativesScaled( dDeriv_dP[ke], dDeriv_dC[ke], factor, deriv_dP[ke], deriv_dC[ke] );
98 template< localIndex numComp >
100 static void addToDerivatives(
real64 const ( &dDeriv_dP ),
real64 const ( &dDeriv_dC )[numComp],
103 addToDerivativesScaled( dDeriv_dP, dDeriv_dC, 1.0, deriv_dP, deriv_dC );
106 template< localIndex numComp, localIndex numFluxSupportPo
ints >
108 static void addToDerivatives(
real64 const ( &dDeriv_dP )[numFluxSupportPoints],
real64 const ( &dDeriv_dC )[numFluxSupportPoints][numComp],
109 real64 ( & deriv_dP )[numFluxSupportPoints],
real64 ( & deriv_dC )[numFluxSupportPoints][numComp] )
111 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
113 addToDerivativesScaled( dDeriv_dP, dDeriv_dC, 1.0, deriv_dP, deriv_dC );
117 template< localIndex numComp >
119 static void addToValueAndDerivatives(
real64 const & dValue,
real64 const ( &dDeriv_dP ),
real64 const ( &dDeriv_dC )[numComp],
123 addToDerivatives( dDeriv_dP, dDeriv_dC, deriv_dP, deriv_dC );
126 template< localIndex numComp, localIndex numFluxSupportPo
ints >
128 static void addToValueAndDerivatives(
real64 const & dValue,
real64 const ( &dDeriv_dP )[numFluxSupportPoints],
real64 const ( &dDeriv_dC )[numFluxSupportPoints][numComp],
129 real64 & value,
real64 ( & deriv_dP )[numFluxSupportPoints],
real64 ( & deriv_dC )[numFluxSupportPoints][numComp] )
132 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
134 addToDerivatives( dDeriv_dP[ke], dDeriv_dC[ke], deriv_dP[ke], deriv_dC[ke] );
138 template< localIndex numComp, localIndex numFluxSupportPo
ints >
141 localIndex const (&seri)[numFluxSupportPoints],
142 localIndex const (&sesri)[numFluxSupportPoints],
143 localIndex const (&sei)[numFluxSupportPoints],
144 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
145 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
152 if( std::fabs( phaseMob[er_up][esr_up][ei_up][ip] ) > 1e-20 )
154 mobility += phaseMob[er_up][esr_up][ei_up][ip];
155 dMobility_dP += dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dP];
158 dMobility_dC[ic] += dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dC + ic];
163 template< localIndex numComp, localIndex numFluxSupportPo
ints >
165 static void computeFractionalFlowAndDerivatives(
localIndex const & k_up,
real64 const & mob,
real64 const & dMob_dP,
real64 const ( &dMob_dC )[numComp],
166 real64 const & totMob,
real64 const ( &dTotMob_dP )[numFluxSupportPoints],
real64 const ( &dTotMob_dC )[numFluxSupportPoints][numComp],
167 real64 & fractionalFlow,
real64 ( & dFractionalFlow_dP )[numFluxSupportPoints],
real64 ( & dFractionalFlow_dC )[numFluxSupportPoints][numComp] )
171 if( std::fabs( mob ) > 1e-20 )
173 real64 const invTotMob = 1 / totMob;
175 fractionalFlow = mob * invTotMob;
177 addToDerivativesScaled( dMob_dP, dMob_dC, invTotMob, dFractionalFlow_dP[k_up], dFractionalFlow_dC[k_up] );
179 addToDerivativesScaled( dTotMob_dP, dTotMob_dC, -fractionalFlow * invTotMob, dFractionalFlow_dP, dFractionalFlow_dC );
183 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
186 upwindMobilityViscous(
localIndex const numPhase,
188 localIndex const (&seri)[numFluxSupportPoints],
189 localIndex const (&sesri)[numFluxSupportPoints],
190 localIndex const (&sei)[numFluxSupportPoints],
191 real64 const (&transmissibility)[2],
192 real64 const (&dTrans_dPres)[2],
194 ElementViewConst< arrayView1d< real64 const > >
const & pres,
195 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
196 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
197 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
198 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
199 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
200 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
201 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
202 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
203 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
208 real64 (& dMobility_dC)[numComp] )
211 scheme.template getUpwindDirectionViscous< numComp, numFluxSupportPoints, UPWIND >( numPhase,
227 dPhaseCapPressure_dPhaseVolFrac,
232 assignToZero( mobility, dMobility_dP, dMobility_dC );
233 assignMobilityAndDerivatives( ip, upwindDir, seri, sesri, sei, phaseMob, dPhaseMob, mobility, dMobility_dP, dMobility_dC );
236 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
239 upwindMobilityGravity(
localIndex const numPhase,
241 localIndex const (&seri)[numFluxSupportPoints],
242 localIndex const (&sesri)[numFluxSupportPoints],
243 localIndex const (&sei)[numFluxSupportPoints],
244 real64 const (&transmissibility)[2],
245 real64 const (&dTrans_dPres)[2],
247 ElementViewConst< arrayView1d< real64 const > >
const & pres,
248 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
249 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
250 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
251 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
252 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
253 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
254 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseVolFrac,
255 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
256 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
257 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
259 integer const checkPhasePresenceInGravity,
263 real64 ( & dMobility_dC )[numComp] )
266 scheme.template getUpwindDirectionGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
283 dPhaseCapPressure_dPhaseVolFrac,
285 checkPhasePresenceInGravity,
289 assignToZero( mobility, dMobility_dP, dMobility_dC );
290 assignMobilityAndDerivatives( ip, upwindDir, seri, sesri, sei, phaseMob, dPhaseMob, mobility, dMobility_dP, dMobility_dC );
293 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
296 upwindMobilityCapillary(
localIndex const numPhase,
298 localIndex const (&seri)[numFluxSupportPoints],
299 localIndex const (&sesri)[numFluxSupportPoints],
300 localIndex const (&sei)[numFluxSupportPoints],
301 real64 const (&transmissibility)[2],
302 real64 const (&dTrans_dPres)[2],
304 ElementViewConst< arrayView1d< real64 const > >
const & pres,
305 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
306 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
307 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
308 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
309 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
310 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
311 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
312 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
313 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
318 real64 ( & dMobility_dC )[numComp] )
321 scheme.template getUpwindDirectionCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
337 dPhaseCapPressure_dPhaseVolFrac,
342 assignToZero( mobility, dMobility_dP, dMobility_dC );
343 assignMobilityAndDerivatives( ip, upwindDir, seri, sesri, sei, phaseMob, dPhaseMob, mobility, dMobility_dP, dMobility_dC );
346 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
349 computeFractionalFlowViscous(
localIndex const numPhase,
351 localIndex const (&seri)[numFluxSupportPoints],
352 localIndex const (&sesri)[numFluxSupportPoints],
353 localIndex const (&sei)[numFluxSupportPoints],
354 real64 const (&transmissibility)[2],
355 real64 const (&dTrans_dPres)[2],
358 real64 const (&dTotMob_dP)[numFluxSupportPoints],
359 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
360 ElementViewConst< arrayView1d< real64 const > >
const & pres,
361 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
362 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
363 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
364 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
365 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
366 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
367 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
368 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
369 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
372 real64 (& dFractionalFlow_dP)[numFluxSupportPoints],
373 real64 (& dFractionalFlow_dC)[numFluxSupportPoints][numComp] )
378 real64 dMob_dC[numComp]{};
380 upwindMobilityViscous< numComp, numFluxSupportPoints, UPWIND >( numPhase,
397 dPhaseCapPressure_dPhaseVolFrac,
405 assignToZero( fractionalFlow, dFractionalFlow_dP, dFractionalFlow_dC );
406 computeFractionalFlowAndDerivatives( k_up, mob, dMob_dP, dMob_dC,
407 totMob, dTotMob_dP, dTotMob_dC,
408 fractionalFlow, dFractionalFlow_dP, dFractionalFlow_dC );
411 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
414 computeFractionalFlowGravity(
localIndex const numPhase,
416 localIndex const (&seri)[numFluxSupportPoints],
417 localIndex const (&sesri)[numFluxSupportPoints],
418 localIndex const (&sei)[numFluxSupportPoints],
419 real64 const (&transmissibility)[2],
420 real64 const (&dTrans_dPres)[2],
423 real64 const (&dTotMob_dP)[numFluxSupportPoints],
424 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
425 ElementViewConst< arrayView1d< real64 const > >
const & pres,
426 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
427 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
428 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
429 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
430 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
431 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
432 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseVolFrac,
433 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
434 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
435 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
437 integer const checkPhasePresenceInGravity,
439 real64 (& dFractionalFlow_dP)[numFluxSupportPoints],
440 real64 (& dFractionalFlow_dC)[numFluxSupportPoints][numComp] )
445 real64 dMob_dC[numComp]{};
447 upwindMobilityGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
465 dPhaseCapPressure_dPhaseVolFrac,
467 checkPhasePresenceInGravity,
474 assignToZero( fractionalFlow, dFractionalFlow_dP, dFractionalFlow_dC );
475 computeFractionalFlowAndDerivatives( k_up, mob, dMob_dP, dMob_dC,
476 totMob, dTotMob_dP, dTotMob_dC,
477 fractionalFlow, dFractionalFlow_dP, dFractionalFlow_dC );
480 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
483 computeFractionalFlowCapillary(
localIndex const numPhase,
485 localIndex const (&seri)[numFluxSupportPoints],
486 localIndex const (&sesri)[numFluxSupportPoints],
487 localIndex const (&sei)[numFluxSupportPoints],
488 real64 const (&transmissibility)[2],
489 real64 const (&dTrans_dPres)[2],
492 real64 const (&dTotMob_dP)[numFluxSupportPoints],
493 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
494 ElementViewConst< arrayView1d< real64 const > >
const & pres,
495 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
496 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
497 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
498 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
499 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
500 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
501 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
502 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
503 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
506 real64 ( & dFractionalFlow_dP)[numFluxSupportPoints],
507 real64 ( & dFractionalFlow_dC)[numFluxSupportPoints][numComp]
513 real64 dMob_dC[numComp]{};
515 upwindMobilityCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
532 dPhaseCapPressure_dPhaseVolFrac,
540 assignToZero( fractionalFlow, dFractionalFlow_dP, dFractionalFlow_dC );
541 computeFractionalFlowAndDerivatives( k_up, mob, dMob_dP, dMob_dC,
542 totMob, dTotMob_dP, dTotMob_dC,
543 fractionalFlow, dFractionalFlow_dP, dFractionalFlow_dC );
555 template< localIndex numComp, localIndex numFluxSupportPo
ints >
595 template< localIndex numComp, localIndex numFluxSupportPo
ints >
599 integer const checkPhasePresenceInGravity,
600 localIndex const (&seri)[numFluxSupportPoints],
601 localIndex const (&sesri)[numFluxSupportPoints],
602 localIndex const (&sei)[numFluxSupportPoints],
603 real64 const (&transmissibility)[2],
604 real64 const (&dTrans_dPres)[2],
618 real64 ( & dPot_dPres )[numFluxSupportPoints],
619 real64 ( & dPot_dComp )[numFluxSupportPoints][numComp] )
622 assignToZero( pot, dPot_dPres, dPot_dComp );
626 real64 dDensMean_dPres[numFluxSupportPoints]{};
627 real64 dDensMean_dComp[numFluxSupportPoints][numComp]{};
628 isothermalCompositionalMultiphaseFVMKernels::helpers::
629 calculateMeanDensity( ip, seri, sesri, sei,
630 checkPhasePresenceInGravity,
631 phaseVolFrac, dCompFrac_dCompDens,
632 phaseMassDens, dPhaseMassDens,
633 densMean, dDensMean_dPres, dDensMean_dComp );
636 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
642 real64 const gravD = transmissibility[i] * gravCoef[er][esr][ei];
643 real64 const dGravD_dP = dTrans_dPres[i] * gravCoef[er][esr][ei];
644 pot += densMean * gravD;
645 dPot_dPres[i] += densMean * dGravD_dP;
648 addToDerivativesScaled( dDensMean_dPres, dDensMean_dComp, gravD, dPot_dPres, dPot_dComp );
662 template< localIndex numComp, localIndex numFluxSupportPo
ints >
666 localIndex const (&seri)[numFluxSupportPoints],
667 localIndex const (&sesri)[numFluxSupportPoints],
668 localIndex const (&sei)[numFluxSupportPoints],
669 real64 const (&transmissibility)[2],
670 real64 const (&dTrans_dPres)[2],
683 real64 ( & dPot_dPres)[numFluxSupportPoints],
684 real64 (& dPot_dComp)[numFluxSupportPoints][numComp] )
687 assignToZero( pot, dPot_dPres, dPot_dComp );
689 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
695 real64 const capPres = phaseCapPressure[er][esr][ei][0][ip];
697 pot += transmissibility[i] * capPres;
699 dPot_dPres[i] += dTrans_dPres[i] * capPres;
704 real64 const dCapPressure_dS = dPhaseCapPressure_dPhaseVolFrac[er][esr][ei][0][ip][jp];
706 dPot_dPres[i] += transmissibility[i] * dCapPressure_dS * dPhaseVolFrac[er][esr][ei][jp][Deriv::dP];
710 dPot_dComp[i][jc] += transmissibility[i] * dCapPressure_dS * dPhaseVolFrac[er][esr][ei][jp][Deriv::dC + jc];
719 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
723 localIndex const (&seri)[numFluxSupportPoints],
724 localIndex const (&sesri)[numFluxSupportPoints],
725 localIndex const (&sei)[numFluxSupportPoints],
726 real64 const (&transmissibility)[2],
727 real64 const (&dTrans_dPres)[2],
730 real64 const (&dTotMob_dP)[numFluxSupportPoints],
731 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
744 integer const checkPhasePresenceInGravity,
746 real64 (& dPhaseFlux_dP)[numFluxSupportPoints],
747 real64 ( & dPhaseFlux_dC)[numFluxSupportPoints][numComp] )
751 real64 dFflow_dP[numFluxSupportPoints]{};
752 real64 dFflow_dC[numFluxSupportPoints][numComp]{};
755 real64 dPot_dP[numFluxSupportPoints]{};
756 real64 dPot_dC[numFluxSupportPoints][numComp]{};
759 UpwindHelpers::computePotentialGravity::compute< numComp, numFluxSupportPoints >( numPhase,
761 checkPhasePresenceInGravity,
775 dPhaseCapPressure_dPhaseVolFrac,
782 UpwindHelpers::computeFractionalFlowGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
803 dPhaseCapPressure_dPhaseVolFrac,
805 checkPhasePresenceInGravity,
817 real64 dPotOther_dP[numFluxSupportPoints]{};
818 real64 dPotOther_dC[numFluxSupportPoints][numComp]{};
821 UpwindHelpers::computePotentialGravity::compute< numComp, numFluxSupportPoints >( numPhase,
823 checkPhasePresenceInGravity,
837 dPhaseCapPressure_dPhaseVolFrac,
846 real64 dMobOther_dC[numComp]{};
851 UpwindHelpers::upwindMobilityGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
869 dPhaseCapPressure_dPhaseVolFrac,
871 checkPhasePresenceInGravity,
879 phaseFlux -= fflow * mobOther * (pot - potOther);
882 UpwindHelpers::addToDerivativesScaled( dMobOther_dP, dMobOther_dC, -fflow * (pot - potOther), dPhaseFlux_dP[k_up_o], dPhaseFlux_dC[k_up_o] );
885 UpwindHelpers::addToDerivativesScaled( dFflow_dP, dFflow_dC, -mobOther * (pot - potOther), dPhaseFlux_dP, dPhaseFlux_dC );
888 UpwindHelpers::addToDerivativesScaled( dPot_dP, dPot_dC, -fflow * mobOther, dPhaseFlux_dP, dPhaseFlux_dC );
889 UpwindHelpers::addToDerivativesScaled( dPotOther_dP, dPotOther_dC, fflow * mobOther, dPhaseFlux_dP, dPhaseFlux_dC );
895 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
897 static void computePotentialFluxesCapillary(
localIndex const numPhase,
899 localIndex const (&seri)[numFluxSupportPoints],
900 localIndex const (&sesri)[numFluxSupportPoints],
901 localIndex const (&sei)[numFluxSupportPoints],
902 real64 const (&transmissibility)[2],
903 real64 const (&dTrans_dPres)[2],
906 real64 const (&dTotMob_dP)[numFluxSupportPoints],
907 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
920 real64 (& dPhaseFlux_dP)[numFluxSupportPoints],
921 real64 ( & dPhaseFlux_dC)[numFluxSupportPoints][numComp] )
924 real64 dFflow_dP[numFluxSupportPoints]{};
925 real64 dFflow_dC[numFluxSupportPoints][numComp]{};
928 real64 dPot_dP[numFluxSupportPoints]{};
929 real64 dPot_dC[numFluxSupportPoints][numComp]{};
931 computePotentialCapillary::compute< numComp, numFluxSupportPoints >( numPhase,
945 dPhaseCapPressure_dPhaseVolFrac,
952 UpwindHelpers::computeFractionalFlowCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
972 dPhaseCapPressure_dPhaseVolFrac,
984 real64 dPotOther_dP[numFluxSupportPoints]{};
985 real64 dPotOther_dC[numFluxSupportPoints][numComp]{};
988 computePotentialCapillary::compute< numComp, numFluxSupportPoints >( numPhase,
1002 dPhaseCapPressure_dPhaseVolFrac,
1011 real64 dMobOther_dC[numComp]{};
1016 UpwindHelpers::upwindMobilityCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
1026 dCompFrac_dCompDens,
1033 dPhaseCapPressure_dPhaseVolFrac,
1042 phaseFlux -= fflow * mobOther * (pot - potOther);
1045 UpwindHelpers::addToDerivativesScaled( dMobOther_dP, dMobOther_dC, -fflow * (pot - potOther), dPhaseFlux_dP[k_up_o], dPhaseFlux_dC[k_up_o] );
1048 UpwindHelpers::addToDerivativesScaled( dFflow_dP, dFflow_dC, -mobOther * (pot - potOther), dPhaseFlux_dP, dPhaseFlux_dC );
1051 UpwindHelpers::addToDerivativesScaled( dPot_dP, dPot_dC, -fflow * mobOther, dPhaseFlux_dP, dPhaseFlux_dC );
1052 UpwindHelpers::addToDerivativesScaled( dPotOther_dP, dPotOther_dC, fflow * mobOther, dPhaseFlux_dP, dPhaseFlux_dC );
1087 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
1092 localIndex const (&seri)[numFluxSupportPoints],
1093 localIndex const (&sesri)[numFluxSupportPoints],
1094 localIndex const (&sei)[numFluxSupportPoints],
1095 real64 const (&transmissibility)[2],
1096 real64 const (&dTrans_dPres)[2],
1114 UPWIND::template computePotentialViscous< numComp, numFluxSupportPoints >( numPhase,
1125 dCompFrac_dCompDens,
1130 dPhaseCapPressure_dPhaseVolFrac,
1134 upwindDir = (pot > 0) ? 0 : 1;
1138 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
1142 localIndex const (&seri)[numFluxSupportPoints],
1143 localIndex const (&sesri)[numFluxSupportPoints],
1144 localIndex const (&sei)[numFluxSupportPoints],
1145 real64 const (&transmissibility)[2],
1146 real64 const (&dTrans_dPres)[2],
1159 integer const checkPhasePresenceInGravity,
1167 UPWIND::template computePotentialGravity< numComp, numFluxSupportPoints >( numPhase,
1178 dCompFrac_dCompDens,
1184 dPhaseCapPressure_dPhaseVolFrac,
1186 checkPhasePresenceInGravity,
1190 upwindDir = (pot >= 0) ? 0 : 1;
1194 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
1196 void getUpwindDirectionCapillary(
localIndex const numPhase,
1198 localIndex const (&seri)[numFluxSupportPoints],
1199 localIndex const (&sesri)[numFluxSupportPoints],
1200 localIndex const (&sei)[numFluxSupportPoints],
1201 real64 const (&transmissibility)[2],
1202 real64 const (&dTrans_dPres)[2],
1221 UPWIND::template computePotentialCapillary< numComp, numFluxSupportPoints >( numPhase,
1232 dCompFrac_dCompDens,
1237 dPhaseCapPressure_dPhaseVolFrac,
1242 upwindDir = (pot >= 0) ? 0 : 1;
1249 template< localIndex numComp, localIndex numFluxSupportPo
ints,
typename LAMBDA >
1253 localIndex const (&seri)[numFluxSupportPoints],
1254 localIndex const (&sesri)[numFluxSupportPoints],
1255 localIndex const (&sei)[numFluxSupportPoints],
1256 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
1257 real64 & weightedPotential,
1262 real64 pot_dP[numFluxSupportPoints]{};
1263 real64 pot_dC[numFluxSupportPoints][numComp]{};
1265 fn( ip, pot, pot_dP, pot_dC );
1271 for(
localIndex jp = 0; jp < numPhase; ++jp )
1284 real64 potOther_dP[numFluxSupportPoints]{};
1285 real64 potOther_dC[numFluxSupportPoints][numComp]{};
1287 fn( jp, potOther, potOther_dP, potOther_dC );
1289 real64 const mob_up = phaseMob[er_up][esr_up][ei_up][jp];
1290 real64 const mob_dw = phaseMob[er_dw][esr_dw][ei_dw][jp];
1292 weightedPotential += (pot - potOther >= 0) ? mob_dw * (potOther - pot) : mob_up * (potOther - pot);
1308 template< localIndex numComp, localIndex numFluxSupportPo
ints >
1311 void computePotentialViscous(
localIndex const numPhase,
1313 localIndex const (&seri)[numFluxSupportPoints],
1314 localIndex const (&sesri)[numFluxSupportPoints],
1315 localIndex const (&sei)[numFluxSupportPoints],
1316 real64 const (&transmissibility)[2],
1317 real64 const (&dTrans_dPres)[2],
1332 real64 dPot_dP[numFluxSupportPoints]{};
1333 real64 dPot_dC[numFluxSupportPoints][numComp]{};
1334 UpwindHelpers::computePotentialViscous::compute< numComp, numFluxSupportPoints >(
1344 dCompFrac_dCompDens,
1349 dPhaseCapPressure_dPhaseVolFrac,
1355 template< localIndex numComp, localIndex numFluxSupportPo
ints >
1358 void computePotentialGravity(
localIndex const numPhase,
1360 localIndex const (&seri)[numFluxSupportPoints],
1361 localIndex const (&sesri)[numFluxSupportPoints],
1362 localIndex const (&sei)[numFluxSupportPoints],
1363 real64 const (&transmissibility)[2],
1364 real64 const (&dTrans_dPres)[2],
1377 integer const checkPhasePresenceInGravity,
1385 UpwindScheme::template potential< numComp, numFluxSupportPoints >( numPhase, ip, seri, sesri, sei,
1386 phaseMob, potential,
1389 real64 (& dPotential_dP_)[numFluxSupportPoints],
1390 real64 (& dPotential_dC_)[numFluxSupportPoints][numComp] ) {
1392 UpwindHelpers::computePotentialGravity::compute< numComp, numFluxSupportPoints >(
1395 checkPhasePresenceInGravity,
1403 dCompFrac_dCompDens,
1409 dPhaseCapPressure_dPhaseVolFrac,
1418 template< localIndex numComp, localIndex numFluxSupportPo
ints >
1421 void computePotentialCapillary(
localIndex const numPhase,
1423 localIndex const (&seri)[numFluxSupportPoints],
1424 localIndex const (&sesri)[numFluxSupportPoints],
1425 localIndex const (&sei)[numFluxSupportPoints],
1426 real64 const (&transmissibility)[2],
1427 real64 const (&dTrans_dPres)[2],
1448 UpwindScheme::template potential< numComp, numFluxSupportPoints >( numPhase, ip, seri, sesri, sei,
1449 phaseMob, potential,
1452 real64 (& dPotential_dP_)[numFluxSupportPoints],
1453 real64 (& dPotential_dC_)[numFluxSupportPoints][numComp] )
1456 UpwindHelpers::computePotentialCapillary::compute< numComp, numFluxSupportPoints >(
1466 dCompFrac_dCompDens,
1471 dPhaseCapPressure_dPhaseVolFrac,
1487 static constexpr
double minTotMob = 1e-12;
1516 template<
integer numComp,
integer numFluxSupportPo
ints >
1522 integer const checkPhasePresenceInGravity,
1523 localIndex const ( &seri )[numFluxSupportPoints],
1524 localIndex const ( &sesri )[numFluxSupportPoints],
1525 localIndex const ( &sei )[numFluxSupportPoints],
1526 real64 const ( &trans )[2],
1527 real64 const ( &dTrans_dPres )[2],
1541 real64 ( & dPhaseFlux_dP )[numFluxSupportPoints],
1542 real64 ( & dPhaseFlux_dC )[numFluxSupportPoints][numComp] )
1547 real64 dTotFlux_dP[numFluxSupportPoints]{};
1548 real64 dTotFlux_dC[numFluxSupportPoints][numComp]{};
1552 real64 dTotMob_dP[numFluxSupportPoints]{};
1553 real64 dTotMob_dC[numFluxSupportPoints][numComp]{};
1556 real64 dPhaseFlux_dTrans;
1558 for(
integer jp = 0; jp < numPhase; ++jp )
1561 hasCapPressure, checkPhasePresenceInGravity,
1563 trans, dTrans_dPres,
1565 phaseMob, dPhaseMob,
1566 phaseVolFrac, dPhaseVolFrac,
1567 dCompFrac_dCompDens,
1568 phaseMassDens, dPhaseMassDens,
1569 phaseCapPressure, dPhaseCapPressure_dPhaseVolFrac,
1570 potGrad, phaseFlux, dPhaseFlux_dP, dPhaseFlux_dC, dPhaseFlux_dTrans );
1573 UpwindHelpers::addToValueAndDerivatives( phaseFlux, dPhaseFlux_dP, dPhaseFlux_dC,
1574 totFlux, dTotFlux_dP, dTotFlux_dC );
1590 localIndex const k_up = (phaseFlux >= 0) ? 0 : 1;
1592 UpwindHelpers::assignMobilityAndDerivatives( jp, k_up, seri, sesri, sei,
1593 phaseMob, dPhaseMob,
1594 totMob, dTotMob_dP[k_up], dTotMob_dC[k_up] );
1598 totMob = LvArray::math::max( totMob, minTotMob );
1601 UpwindHelpers::assignToZero( phaseFlux, dPhaseFlux_dP, dPhaseFlux_dC );
1608 real64 viscousPhaseFlux{};
1609 real64 dViscousPhaseFlux_dP[numFluxSupportPoints]{};
1610 real64 dViscousPhaseFlux_dC[numFluxSupportPoints][numComp]{};
1613 real64 dFractionalFlow_dP[numFluxSupportPoints]{};
1614 real64 dFractionalFlow_dC[numFluxSupportPoints][numComp]{};
1618 UpwindHelpers::computeFractionalFlowViscous< numComp, numFluxSupportPoints,
1632 dCompFrac_dCompDens,
1639 dPhaseCapPressure_dPhaseVolFrac,
1643 dFractionalFlow_dC );
1646 viscousPhaseFlux = fractionalFlow * totFlux;
1648 UpwindHelpers::addToDerivativesScaled( dFractionalFlow_dP, dFractionalFlow_dC,
1650 dViscousPhaseFlux_dP, dViscousPhaseFlux_dC );
1653 UpwindHelpers::addToDerivativesScaled( dTotFlux_dP, dTotFlux_dC,
1655 dViscousPhaseFlux_dP, dViscousPhaseFlux_dC );
1658 UpwindHelpers::addToValueAndDerivatives( viscousPhaseFlux, dViscousPhaseFlux_dP, dViscousPhaseFlux_dC,
1659 phaseFlux, dPhaseFlux_dP, dPhaseFlux_dC );
1663 real64 gravitationalPhaseFlux{};
1664 real64 gravitationalPhaseFlux_dP[numFluxSupportPoints]{};
1665 real64 gravitationalPhaseFlux_dC[numFluxSupportPoints][numComp]{};
1667 UpwindHelpers::computePotentialFluxesGravity< numComp,
1686 dCompFrac_dCompDens,
1690 dPhaseCapPressure_dPhaseVolFrac,
1692 checkPhasePresenceInGravity,
1693 gravitationalPhaseFlux,
1694 gravitationalPhaseFlux_dP,
1695 gravitationalPhaseFlux_dC );
1698 UpwindHelpers::addToValueAndDerivatives( gravitationalPhaseFlux, gravitationalPhaseFlux_dP, gravitationalPhaseFlux_dC,
1699 phaseFlux, dPhaseFlux_dP, dPhaseFlux_dC );
1701 if( hasCapPressure )
1705 real64 capillaryPhaseFlux{};
1706 real64 capillaryPhaseFlux_dP[numFluxSupportPoints]{};
1707 real64 capillaryPhaseFlux_dC[numFluxSupportPoints][numComp]{};
1709 UpwindHelpers::computePotentialFluxesCapillary< numComp,
1727 dCompFrac_dCompDens,
1731 dPhaseCapPressure_dPhaseVolFrac,
1734 capillaryPhaseFlux_dP,
1735 capillaryPhaseFlux_dC );
1738 UpwindHelpers::addToValueAndDerivatives( capillaryPhaseFlux, capillaryPhaseFlux_dP, capillaryPhaseFlux_dC,
1739 phaseFlux, dPhaseFlux_dP, dPhaseFlux_dC );
#define GEOS_HOST_DEVICE
Marks a host-device function.
#define GEOS_UNUSED_PARAM(X)
Mark an unused argument and silence compiler warnings.
static GEOS_HOST_DEVICE void computePotentialFluxesGravity(localIndex const numPhase, localIndex const ip, localIndex const (&seri)[numFluxSupportPoints], localIndex const (&sesri)[numFluxSupportPoints], localIndex const (&sei)[numFluxSupportPoints], real64 const (&transmissibility)[2], real64 const (&dTrans_dPres)[2], real64 const totFlux, real64 const totMob, real64 const (&dTotMob_dP)[numFluxSupportPoints], real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp], ElementViewConst< arrayView1d< real64 const > > const &pres, ElementViewConst< arrayView1d< real64 const > > const &gravCoef, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const &phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const &dPhaseMob, 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, constitutive::multifluid::USD_PHASE > > const &phaseMassDens, ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > > 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 const hasCapPressure, integer const checkPhasePresenceInGravity, real64 &phaseFlux, real64(&dPhaseFlux_dP)[numFluxSupportPoints], real64(&dPhaseFlux_dC)[numFluxSupportPoints][numComp])
Form potential-related parts of fluxes.
Class describing the Hybrid Upwind scheme as defined in "Consistent upwinding for sequential fully im...
Template base class for different upwind Scheme.
GEOS_HOST_DEVICE void getUpwindDirectionViscous(localIndex const numPhase, localIndex const ip, localIndex const (&seri)[numFluxSupportPoints], localIndex const (&sesri)[numFluxSupportPoints], localIndex const (&sei)[numFluxSupportPoints], real64 const (&transmissibility)[2], real64 const (&dTrans_dPres)[2], real64 const totFlux, ElementViewConst< arrayView1d< real64 const > > const &pres, ElementViewConst< arrayView1d< real64 const > > const &gravCoef, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const &phaseMob, 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< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const &dPhaseVolFrac, ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > > const &phaseCapPressure, ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > > const &dPhaseCapPressure_dPhaseVolFrac, integer const hasCapPressure, localIndex &upwindDir)
GEOS_HOST_DEVICE void getUpwindDirectionGravity(localIndex const numPhase, localIndex const ip, localIndex const (&seri)[numFluxSupportPoints], localIndex const (&sesri)[numFluxSupportPoints], localIndex const (&sei)[numFluxSupportPoints], real64 const (&transmissibility)[2], real64 const (&dTrans_dPres)[2], real64 const totFlux, ElementViewConst< arrayView1d< real64 const > > const &pres, ElementViewConst< arrayView1d< real64 const > > const &gravCoef, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const &phaseMob, 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< arrayView2d< real64 const, compflow::USD_PHASE > > const &phaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const &dPhaseVolFrac, ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > > const &phaseCapPressure, ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > > const &dPhaseCapPressure_dPhaseVolFrac, integer const hasCapPressure, integer const checkPhasePresenceInGravity, localIndex &upwindDir)
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
ArrayView< T, 4, USD > arrayView4d
Alias for 4D array view.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
int integer
Signed integer type.
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.
static GEOS_HOST_DEVICE void compute(integer const numPhase, integer const ip, integer const hasCapPressure, integer const checkPhasePresenceInGravity, localIndex const (&seri)[numFluxSupportPoints], localIndex const (&sesri)[numFluxSupportPoints], localIndex const (&sei)[numFluxSupportPoints], real64 const (&trans)[2], real64 const (&dTrans_dPres)[2], ElementViewConst< arrayView1d< real64 const > > const &pres, ElementViewConst< arrayView1d< real64 const > > const &gravCoef, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const &phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const &dPhaseMob, 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, constitutive::multifluid::USD_PHASE > > const &phaseMassDens, ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > > 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, real64(&phaseFlux), real64(&dPhaseFlux_dP)[numFluxSupportPoints], real64(&dPhaseFlux_dC)[numFluxSupportPoints][numComp])
Form the Implicit Hybrid Upwind from pressure gradient and gravitational head.
static GEOS_HOST_DEVICE void compute(integer const numPhase, integer const ip, integer const hasCapPressure, integer const checkPhasePresenceInGravity, localIndex const (&seri)[numFluxSupportPoints], localIndex const (&sesri)[numFluxSupportPoints], localIndex const (&sei)[numFluxSupportPoints], real64 const (&trans)[2], real64 const (&dTrans_dPres)[2], ElementViewConst< arrayView1d< real64 const > > const &pres, ElementViewConst< arrayView1d< real64 const > > const &gravCoef, ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const &phaseMob, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const &dPhaseMob, 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, constitutive::multifluid::USD_PHASE > > const &phaseMassDens, ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > > 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, real64 &phaseFlux, real64(&dPhaseFlux_dP)[numFluxSupportPoints], real64(&dPhaseFlux_dC)[numFluxSupportPoints][numComp], real64 &dPhaseFlux_dTrans)
Form the PhasePotentialUpwind from pressure gradient and gravitational head.
static GEOS_HOST_DEVICE void compute(localIndex const numPhase, localIndex const ip, localIndex const (&seri)[numFluxSupportPoints], localIndex const (&sesri)[numFluxSupportPoints], localIndex const (&sei)[numFluxSupportPoints], real64 const (&transmissibility)[2], real64 const (&dTrans_dPres)[2], real64 const GEOS_UNUSED_PARAM(totFlux), ElementViewConst< arrayView1d< real64 const > > const &GEOS_UNUSED_PARAM(gravCoef), ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const &GEOS_UNUSED_PARAM(dCompFrac_dCompDens), ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > > const &GEOS_UNUSED_PARAM(phaseMassDens), ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > > const &GEOS_UNUSED_PARAM(dPhaseMassDens), ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const &dPhaseVolFrac, ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > > const &phaseCapPressure, ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > > const &dPhaseCapPressure_dPhaseVolFrac, real64 &pot, real64(&dPot_dPres)[numFluxSupportPoints], real64(&dPot_dComp)[numFluxSupportPoints][numComp])
static GEOS_HOST_DEVICE void compute(localIndex const GEOS_UNUSED_PARAM(numPhase), localIndex const ip, integer const checkPhasePresenceInGravity, localIndex const (&seri)[numFluxSupportPoints], localIndex const (&sesri)[numFluxSupportPoints], localIndex const (&sei)[numFluxSupportPoints], real64 const (&transmissibility)[2], real64 const (&dTrans_dPres)[2], real64 const GEOS_UNUSED_PARAM(totFlux), ElementViewConst< arrayView1d< real64 const > > const &gravCoef, 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< arrayView2d< real64 const, compflow::USD_PHASE > > const &phaseVolFrac, ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > > const &GEOS_UNUSED_PARAM(dPhaseVolFrac), ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > > const &GEOS_UNUSED_PARAM(phaseCapPressure), ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > > const &GEOS_UNUSED_PARAM(dPhaseCapPressure_dPhaseVolFrac), real64 &pot, real64(&dPot_dPres)[numFluxSupportPoints], real64(&dPot_dComp)[numFluxSupportPoints][numComp])
Struct defining formation of potential from different Physics (flagged by enum type T) to be used in ...