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 static constexpr
double minTotMob = 1e-12;
47 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
50 upwindMobilityViscous(
localIndex const numPhase,
52 localIndex const (&seri)[numFluxSupportPoints],
53 localIndex const (&sesri)[numFluxSupportPoints],
55 real64 const (&transmissibility)[2],
56 real64 const (&dTrans_dPres)[2],
58 ElementViewConst< arrayView1d< real64 const > >
const & pres,
59 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
60 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
61 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
62 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
63 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
64 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
65 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
66 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
67 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
72 real64 ( & dMobility_dC)[numComp]
81 dMobility_dC[ic] = 0.0;
85 scheme.template getUpwindDirectionViscous< numComp, numFluxSupportPoints, UPWIND >( numPhase,
101 dPhaseCapPressure_dPhaseVolFrac,
109 if( std::fabs( phaseMob[er_up][esr_up][ei_up][ip] ) > 1e-20 )
111 mobility = phaseMob[er_up][esr_up][ei_up][ip];
112 dMobility_dP = dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dP];
115 dMobility_dC[ic] = dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dC + ic];
120 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
123 upwindMobilityGravity(
localIndex const numPhase,
125 localIndex const (&seri)[numFluxSupportPoints],
126 localIndex const (&sesri)[numFluxSupportPoints],
127 localIndex const (&sei)[numFluxSupportPoints],
128 real64 const (&transmissibility)[2],
129 real64 const (&dTrans_dPres)[2],
131 ElementViewConst< arrayView1d< real64 const > >
const & pres,
132 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
133 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
134 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
135 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
136 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
137 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
138 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseVolFrac,
139 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
140 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
141 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
146 real64 ( & dMobility_dC)[numComp]
155 dMobility_dC[ic] = 0.0;
159 scheme.template getUpwindDirectionGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
176 dPhaseCapPressure_dPhaseVolFrac,
184 if( std::fabs( phaseMob[er_up][esr_up][ei_up][ip] ) > 1e-20 )
186 mobility = phaseMob[er_up][esr_up][ei_up][ip];
187 dMobility_dP = dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dP];
190 dMobility_dC[ic] = dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dC + ic];
195 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
198 upwindMobilityCapillary(
localIndex const numPhase,
200 localIndex const (&seri)[numFluxSupportPoints],
201 localIndex const (&sesri)[numFluxSupportPoints],
202 localIndex const (&sei)[numFluxSupportPoints],
203 real64 const (&transmissibility)[2],
204 real64 const (&dTrans_dPres)[2],
206 ElementViewConst< arrayView1d< real64 const > >
const & pres,
207 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
208 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
209 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
210 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
211 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
212 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
213 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
214 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
215 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
220 real64 ( & dMobility_dC)[numComp]
229 dMobility_dC[ic] = 0.0;
233 scheme.template getUpwindDirectionCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
249 dPhaseCapPressure_dPhaseVolFrac,
257 if( std::fabs( phaseMob[er_up][esr_up][ei_up][ip] ) > 1e-20 )
259 mobility = phaseMob[er_up][esr_up][ei_up][ip];
260 dMobility_dP = dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dP];
263 dMobility_dC[ic] = dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dC + ic];
268 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
271 computeFractionalFlowViscous(
localIndex const numPhase,
273 localIndex const (&seri)[numFluxSupportPoints],
274 localIndex const (&sesri)[numFluxSupportPoints],
275 localIndex const (&sei)[numFluxSupportPoints],
276 real64 const (&transmissibility)[2],
277 real64 const (&dTrans_dPres)[2],
281 real64 const (&dTotMob_dP)[numFluxSupportPoints],
282 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
283 ElementViewConst< arrayView1d< real64 const > >
const & pres,
284 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
285 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
286 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
287 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
288 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
289 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
290 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
291 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
292 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
296 real64 ( & dFractionalFlow_dP)[numFluxSupportPoints],
297 real64 ( & dFractionalFlow_dC)[numFluxSupportPoints][numComp] )
302 real64 dMMob_dC[numComp]{};
312 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
314 dFractionalFlow_dP[ke] = 0;
317 dFractionalFlow_dC[ke][jc] = 0;
324 real64 dMob_dC[numComp]{};
326 upwindMobilityViscous< numComp, numFluxSupportPoints, UPWIND >( numPhase,
343 dPhaseCapPressure_dPhaseVolFrac,
355 dMMob_dC[ic] = dMob_dC[ic];
359 if( std::fabs( mainMob ) > 1e-20 )
361 fractionalFlow = mainMob / LvArray::math::max( totMob, minTotMob );
362 dFractionalFlow_dP[k_up_main] = dMMob_dP / LvArray::math::max( totMob, minTotMob );
365 dFractionalFlow_dC[k_up_main][jc] = dMMob_dC[jc] / totMob;
369 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
371 dFractionalFlow_dP[ke] -= fractionalFlow * dTotMob_dP[k_up_ppu] / LvArray::math::max( totMob, minTotMob );
375 dFractionalFlow_dC[ke][jc] -= fractionalFlow * dTotMob_dC[k_up_ppu][jc] / LvArray::math::max( totMob, minTotMob );
382 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
385 computeFractionalFlowGravity(
localIndex const numPhase,
387 localIndex const (&seri)[numFluxSupportPoints],
388 localIndex const (&sesri)[numFluxSupportPoints],
389 localIndex const (&sei)[numFluxSupportPoints],
390 real64 const (&transmissibility)[2],
391 real64 const (&dTrans_dPres)[2],
395 real64 const (&dTotMob_dP)[numFluxSupportPoints],
396 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
397 ElementViewConst< arrayView1d< real64 const > >
const & pres,
398 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
399 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
400 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
401 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
402 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
403 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
404 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseVolFrac,
405 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
406 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
407 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
411 real64 ( & dFractionalFlow_dP)[numFluxSupportPoints],
412 real64 ( & dFractionalFlow_dC)[numFluxSupportPoints][numComp]
418 real64 dMMob_dC[numComp]{};
424 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
426 dFractionalFlow_dP[ke] = 0;
429 dFractionalFlow_dC[ke][jc] = 0;
437 real64 dMob_dC[numComp]{};
439 upwindMobilityGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
457 dPhaseCapPressure_dPhaseVolFrac,
469 dMMob_dC[ic] = dMob_dC[ic];
473 if( std::fabs( mainMob ) > 1e-20 )
475 fractionalFlow = mainMob / LvArray::math::max( totMob, minTotMob );
476 dFractionalFlow_dP[k_up_main] = dMMob_dP / LvArray::math::max( totMob, minTotMob );
479 dFractionalFlow_dC[k_up_main][jc] = dMMob_dC[jc] / totMob;
483 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
485 dFractionalFlow_dP[ke] -= fractionalFlow * dTotMob_dP[k_up_ppu] / LvArray::math::max( totMob, minTotMob );
489 dFractionalFlow_dC[ke][jc] -= fractionalFlow * dTotMob_dC[k_up_ppu][jc] / LvArray::math::max( totMob, minTotMob );
495 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
498 computeFractionalFlowCapillary(
localIndex const numPhase,
500 localIndex const (&seri)[numFluxSupportPoints],
501 localIndex const (&sesri)[numFluxSupportPoints],
502 localIndex const (&sei)[numFluxSupportPoints],
503 real64 const (&transmissibility)[2],
504 real64 const (&dTrans_dPres)[2],
508 real64 const (&dTotMob_dP)[numFluxSupportPoints],
509 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
510 ElementViewConst< arrayView1d< real64 const > >
const & pres,
511 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
512 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
513 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
514 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
515 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
516 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
517 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
518 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
519 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
523 real64 ( & dFractionalFlow_dP)[numFluxSupportPoints],
524 real64 ( & dFractionalFlow_dC)[numFluxSupportPoints][numComp]
530 real64 dMMob_dC[numComp]{};
536 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
538 dFractionalFlow_dP[ke] = 0;
541 dFractionalFlow_dC[ke][jc] = 0;
548 real64 dMob_dC[numComp]{};
550 upwindMobilityCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
567 dPhaseCapPressure_dPhaseVolFrac,
579 dMMob_dC[ic] = dMob_dC[ic];
583 if( std::fabs( mainMob ) > 1e-20 )
585 fractionalFlow = mainMob / LvArray::math::max( totMob, minTotMob );
586 dFractionalFlow_dP[k_up_main] = dMMob_dP / LvArray::math::max( totMob, minTotMob );
589 dFractionalFlow_dC[k_up_main][jc] = dMMob_dC[jc] / LvArray::math::max( totMob, minTotMob );
593 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
595 dFractionalFlow_dP[ke] -= fractionalFlow * dTotMob_dP[k_up_ppu] / LvArray::math::max( totMob, minTotMob );
599 dFractionalFlow_dC[ke][jc] -= fractionalFlow * dTotMob_dC[k_up_ppu][jc] / LvArray::math::max( totMob, minTotMob );
615 template< localIndex numComp, localIndex numFluxSupportPo
ints >
657 template< localIndex numComp, localIndex numFluxSupportPo
ints >
661 localIndex const (&seri)[numFluxSupportPoints],
662 localIndex const (&sesri)[numFluxSupportPoints],
663 localIndex const (&sei)[numFluxSupportPoints],
664 real64 const (&transmissibility)[2],
665 real64 const (&dTrans_dPres)[2],
679 real64 ( & dPot_dPres )[numFluxSupportPoints],
680 real64 (& dPot_dComp )[numFluxSupportPoints][numComp],
681 real64 ( & dProp_dComp )[numComp] )
685 real64 dDensMean_dPres[numFluxSupportPoints]{};
686 real64 dDensMean_dComp[numFluxSupportPoints][numComp]{};
690 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
695 dPot_dComp[i][jc] = 0.0;
696 dProp_dComp[jc] = 0.0;
702 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
708 bool const phaseExists = (phaseVolFrac[er][esr][ei][ip] > 0);
715 real64 const density = phaseMassDens[er][esr][ei][0][ip];
716 real64 const dDens_dPres = dPhaseMassDens[er][esr][ei][0][ip][Deriv::dP];
718 applyChainRule( numComp,
719 dCompFrac_dCompDens[er][esr][ei],
720 dPhaseMassDens[er][esr][ei][0][ip],
726 dDensMean_dPres[i] = dDens_dPres;
729 dDensMean_dComp[i][jc] = dProp_dComp[jc];
736 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
738 dDensMean_dPres[i] /= denom;
739 for(
integer jc = 0; jc < numComp; ++jc )
741 dDensMean_dComp[i][jc] /= denom;
747 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
753 real64 const gravD = transmissibility[i] * gravCoef[er][esr][ei];
754 real64 const dGravD_dP = dTrans_dPres[i] * gravCoef[er][esr][ei];
755 pot += densMean * gravD;
758 for(
localIndex j = 0; j < numFluxSupportPoints; ++j )
760 dPot_dPres[j] += dDensMean_dPres[j] * gravD + densMean * dGravD_dP;
763 dPot_dComp[j][jc] += dDensMean_dComp[j][jc] * gravD;
779 template< localIndex numComp, localIndex numFluxSupportPo
ints >
783 localIndex const (&seri)[numFluxSupportPoints],
784 localIndex const (&sesri)[numFluxSupportPoints],
785 localIndex const (&sei)[numFluxSupportPoints],
786 real64 const (&transmissibility)[2],
787 real64 const (&dTrans_dPres)[2],
800 real64 ( & dPot_dPres)[numFluxSupportPoints],
801 real64 (& dPot_dComp)[numFluxSupportPoints][numComp],
806 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
812 pot += transmissibility[i] * phaseCapPressure[er][esr][ei][0][ip];
817 real64 const dCapPressure_dS = dPhaseCapPressure_dPhaseVolFrac[er][esr][ei][0][ip][jp];
819 transmissibility[i] * dCapPressure_dS * dPhaseVolFrac[er][esr][ei][jp][Deriv::dP]
820 + dTrans_dPres[i] * phaseCapPressure[er][esr][ei][0][jp];
824 dPot_dComp[i][jc] += transmissibility[i] * dCapPressure_dS *
825 dPhaseVolFrac[er][esr][ei][jp][Deriv::dC + jc];
834 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
838 localIndex const (&seri)[numFluxSupportPoints],
839 localIndex const (&sesri)[numFluxSupportPoints],
840 localIndex const (&sei)[numFluxSupportPoints],
841 real64 const (&transmissibility)[2],
842 real64 const (&dTrans_dPres)[2],
846 real64 const (&dTotMob_dP)[numFluxSupportPoints],
847 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
863 real64 (& dPhaseFlux_dP)[numFluxSupportPoints],
864 real64 ( & dPhaseFlux_dC)[numFluxSupportPoints][numComp] )
868 real64 dFflow_dP[numFluxSupportPoints]{};
869 real64 dFflow_dC[numFluxSupportPoints][numComp]{};
872 real64 dPot_dP[numFluxSupportPoints]{};
873 real64 dPot_dC[numFluxSupportPoints][numComp]{};
874 real64 dProp_dC[numComp]{};
877 UpwindHelpers::computePotentialGravity::compute< numComp, numFluxSupportPoints >( numPhase,
892 dPhaseCapPressure_dPhaseVolFrac,
900 UpwindHelpers::computeFractionalFlowGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
922 dPhaseCapPressure_dPhaseVolFrac,
936 real64 dPotOther_dP[numFluxSupportPoints]{};
937 real64 dPotOther_dC[numFluxSupportPoints][numComp]{};
938 real64 dPropOther_dC[numComp]{};
941 UpwindHelpers::computePotentialGravity::compute< numComp, numFluxSupportPoints >( numPhase,
956 dPhaseCapPressure_dPhaseVolFrac,
965 real64 dMobOther_dC[numComp]{};
970 UpwindHelpers::upwindMobilityGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
988 dPhaseCapPressure_dPhaseVolFrac,
997 phaseFlux -= fflow * mobOther * (pot - potOther);
998 dPhaseFlux_dP[k_up_o] -= fflow * dMobOther_dP * (pot - potOther);
1001 dPhaseFlux_dC[k_up_o][jc] -= fflow * dMobOther_dC[jc] * (pot - potOther);
1005 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1007 dPhaseFlux_dP[ke] -= dFflow_dP[ke] * mobOther * (pot - potOther);
1011 dPhaseFlux_dC[ke][jc] -= dFflow_dC[ke][jc] * mobOther * (pot - potOther);
1015 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1017 dPhaseFlux_dP[ke] -= fflow * mobOther * (dPot_dP[ke] - dPotOther_dP[ke]);
1020 dPhaseFlux_dC[ke][jc] -= fflow * mobOther * (dPot_dC[ke][jc] - dPotOther_dC[ke][jc]);
1028 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
1030 static void computePotentialFluxesCapillary(
localIndex const numPhase,
1032 localIndex const (&seri)[numFluxSupportPoints],
1033 localIndex const (&sesri)[numFluxSupportPoints],
1034 localIndex const (&sei)[numFluxSupportPoints],
1035 real64 const (&transmissibility)[2],
1036 real64 const (&dTrans_dPres)[2],
1040 real64 const (&dTotMob_dP)[numFluxSupportPoints],
1041 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
1056 real64 (& dPhaseFlux_dP)[numFluxSupportPoints],
1057 real64 ( & dPhaseFlux_dC)[numFluxSupportPoints][numComp] )
1061 real64 dFflow_dP[numFluxSupportPoints]{};
1062 real64 dFflow_dC[numFluxSupportPoints][numComp]{};
1065 real64 dPot_dP[numFluxSupportPoints]{};
1066 real64 dPot_dC[numFluxSupportPoints][numComp]{};
1067 real64 dProp_dC[numComp]{};
1069 UpwindHelpers::computePotentialCapillary::compute< numComp, numFluxSupportPoints >( numPhase,
1078 dCompFrac_dCompDens,
1083 dPhaseCapPressure_dPhaseVolFrac,
1091 UpwindHelpers::computeFractionalFlowCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
1105 dCompFrac_dCompDens,
1112 dPhaseCapPressure_dPhaseVolFrac,
1120 for(
localIndex jp = 0; jp < numPhase; ++jp )
1126 real64 dPotOther_dP[numFluxSupportPoints]{};
1127 real64 dPotOther_dC[numFluxSupportPoints][numComp]{};
1128 real64 dPropOther_dC[numComp]{};
1131 UpwindHelpers::computePotentialCapillary::compute< numComp, numFluxSupportPoints >( numPhase,
1140 dCompFrac_dCompDens,
1145 dPhaseCapPressure_dPhaseVolFrac,
1154 real64 dMobOther_dC[numComp]{};
1159 UpwindHelpers::upwindMobilityCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
1169 dCompFrac_dCompDens,
1176 dPhaseCapPressure_dPhaseVolFrac,
1185 phaseFlux -= fflow * mobOther * (pot - potOther);
1186 dPhaseFlux_dP[k_up_o] -= fflow * dMobOther_dP * (pot - potOther);
1189 dPhaseFlux_dC[k_up_o][jc] -= fflow * dMobOther_dC[jc] * (pot - potOther);
1193 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1195 dPhaseFlux_dP[ke] -= dFflow_dP[ke] * mobOther * (pot - potOther);
1199 dPhaseFlux_dC[ke][jc] -= dFflow_dC[ke][jc] * mobOther * (pot - potOther);
1203 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1205 dPhaseFlux_dP[ke] -= fflow * mobOther * (dPot_dP[ke] - dPotOther_dP[ke]);
1208 dPhaseFlux_dC[ke][jc] -= fflow * mobOther * (dPot_dC[ke][jc] - dPotOther_dC[ke][jc]);
1244 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
1249 localIndex const (&seri)[numFluxSupportPoints],
1250 localIndex const (&sesri)[numFluxSupportPoints],
1251 localIndex const (&sei)[numFluxSupportPoints],
1252 real64 const (&transmissibility)[2],
1253 real64 const (&dTrans_dPres)[2],
1264 integer const capPressureFlag,
1272 UPWIND::template computePotentialViscous< numComp, numFluxSupportPoints >( numPhase,
1283 dCompFrac_dCompDens,
1288 dPhaseCapPressure_dPhaseVolFrac,
1293 upwindDir = (pot > 0) ? 0 : 1;
1297 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
1301 localIndex const (&seri)[numFluxSupportPoints],
1302 localIndex const (&sesri)[numFluxSupportPoints],
1303 localIndex const (&sei)[numFluxSupportPoints],
1304 real64 const (&transmissibility)[2],
1305 real64 const (&dTrans_dPres)[2],
1317 integer const capPressureFlag,
1325 UPWIND::template computePotentialGravity< numComp, numFluxSupportPoints >( numPhase,
1336 dCompFrac_dCompDens,
1342 dPhaseCapPressure_dPhaseVolFrac,
1347 upwindDir = (pot >= 0) ? 0 : 1;
1351 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
1353 void getUpwindDirectionCapillary(
localIndex const numPhase,
1355 localIndex const (&seri)[numFluxSupportPoints],
1356 localIndex const (&sesri)[numFluxSupportPoints],
1357 localIndex const (&sei)[numFluxSupportPoints],
1358 real64 const (&transmissibility)[2],
1359 real64 const (&dTrans_dPres)[2],
1371 integer const capPressureFlag,
1379 UPWIND::template computePotentialCapillary< numComp, numFluxSupportPoints >( numPhase,
1390 dCompFrac_dCompDens,
1395 dPhaseCapPressure_dPhaseVolFrac,
1400 upwindDir = (pot >= 0) ? 0 : 1;
1407 template< localIndex numComp, localIndex numFluxSupportPo
ints,
typename LAMBDA >
1411 localIndex const (&seri)[numFluxSupportPoints],
1412 localIndex const (&sesri)[numFluxSupportPoints],
1413 localIndex const (&sei)[numFluxSupportPoints],
1414 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
1415 real64 & weightedPotential,
1420 real64 pot_dP[numFluxSupportPoints]{};
1421 real64 pot_dC[numFluxSupportPoints][numComp]{};
1422 real64 dProp_dC[numComp]{};
1424 fn( ip, pot, pot_dP, pot_dC, dProp_dC );
1430 for(
localIndex jp = 0; jp < numPhase; ++jp )
1443 real64 potOther_dP[numFluxSupportPoints]{};
1444 real64 potOther_dC[numFluxSupportPoints][numComp]{};
1445 real64 dPropOther_dC[numComp]{};
1447 fn( jp, potOther, potOther_dP, potOther_dC, dPropOther_dC );
1449 real64 const mob_up = phaseMob[er_up][esr_up][ei_up][jp];
1450 real64 const mob_dw = phaseMob[er_dw][esr_dw][ei_dw][jp];
1452 weightedPotential += (pot - potOther >= 0) ? mob_dw * (potOther - pot) : mob_up * (potOther - pot);
1468 template< localIndex numComp, localIndex numFluxSupportPo
ints >
1471 void computePotentialViscous(
localIndex const numPhase,
1473 localIndex const (&seri)[numFluxSupportPoints],
1474 localIndex const (&sesri)[numFluxSupportPoints],
1475 localIndex const (&sei)[numFluxSupportPoints],
1476 real64 const (&transmissibility)[2],
1477 real64 const (&dTrans_dPres)[2],
1493 real64 dPot_dP[numFluxSupportPoints]{};
1494 real64 dPot_dC[numFluxSupportPoints][numComp]{};
1495 real64 dProp_dC[numComp]{};
1498 UpwindHelpers::computePotentialViscous::compute< numComp, numFluxSupportPoints >(
1508 dCompFrac_dCompDens,
1513 dPhaseCapPressure_dPhaseVolFrac,
1520 template< localIndex numComp, localIndex numFluxSupportPo
ints >
1523 void computePotentialGravity(
localIndex const numPhase,
1525 localIndex const (&seri)[numFluxSupportPoints],
1526 localIndex const (&sesri)[numFluxSupportPoints],
1527 localIndex const (&sei)[numFluxSupportPoints],
1528 real64 const (&transmissibility)[2],
1529 real64 const (&dTrans_dPres)[2],
1550 UpwindScheme::template potential< numComp, numFluxSupportPoints >( numPhase, ip, seri, sesri, sei,
1551 phaseMob, potential,
1554 real64 (& dPotential_dP_)[numFluxSupportPoints],
1555 real64 (& dPotential_dC_)[numFluxSupportPoints][numComp],
1556 real64 (& dProp_dC)[numComp] ) {
1558 UpwindHelpers::computePotentialGravity::compute< numComp, numFluxSupportPoints >(
1568 dCompFrac_dCompDens,
1574 dPhaseCapPressure_dPhaseVolFrac,
1584 template< localIndex numComp, localIndex numFluxSupportPo
ints >
1587 void computePotentialCapillary(
localIndex const numPhase,
1589 localIndex const (&seri)[numFluxSupportPoints],
1590 localIndex const (&sesri)[numFluxSupportPoints],
1591 localIndex const (&sei)[numFluxSupportPoints],
1592 real64 const (&transmissibility)[2],
1593 real64 const (&dTrans_dPres)[2],
1614 UpwindScheme::template potential< numComp, numFluxSupportPoints >( numPhase, ip, seri, sesri, sei,
1615 phaseMob, potential,
1618 real64 (& dPotential_dP_)[numFluxSupportPoints],
1619 real64 (& dPotential_dC_)[numFluxSupportPoints][numComp],
1620 real64 (& dProp_dC)[numComp] ) {
1622 UpwindHelpers::computePotentialCapillary::compute< numComp, numFluxSupportPoints >(
1632 dCompFrac_dCompDens,
1637 dPhaseCapPressure_dPhaseVolFrac,
1682 template<
integer numComp,
integer numFluxSupportPo
ints >
1688 localIndex const ( &seri )[numFluxSupportPoints],
1689 localIndex const ( &sesri )[numFluxSupportPoints],
1690 localIndex const ( &sei )[numFluxSupportPoints],
1691 real64 const ( &trans )[2],
1692 real64 const ( &dTrans_dPres )[2],
1709 real64 ( & dPhaseFlux_dP )[numFluxSupportPoints],
1710 real64 ( & dPhaseFlux_dC )[numFluxSupportPoints][numComp],
1711 real64 ( & compFlux )[numComp],
1712 real64 ( & dCompFlux_dP )[numFluxSupportPoints][numComp],
1713 real64 ( & dCompFlux_dC )[numFluxSupportPoints][numComp][numComp] )
1718 real64 dTotFlux_dP[numFluxSupportPoints]{};
1719 real64 dTotFlux_dC[numFluxSupportPoints][numComp]{};
1723 real64 dTotMob_dP[numFluxSupportPoints]{};
1724 real64 dTotMob_dC[numFluxSupportPoints][numComp]{};
1729 real64 dDummy_dP[numFluxSupportPoints][numComp];
1730 real64 dDummy_dC[numFluxSupportPoints][numComp][numComp];
1733 for(
integer jp = 0; jp < numPhase; ++jp )
1737 trans, dTrans_dPres,
1739 phaseMob, dPhaseMob,
1740 phaseVolFrac, dPhaseVolFrac,
1741 phaseCompFrac, dPhaseCompFrac,
1742 dCompFrac_dCompDens,
1743 phaseMassDens, dPhaseMassDens,
1744 phaseCapPressure, dPhaseCapPressure_dPhaseVolFrac,
1746 phaseFlux, dPhaseFlux_dP, dPhaseFlux_dC,
1747 dummy, dDummy_dP, dDummy_dC );
1749 totFlux += phaseFlux;
1752 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1754 dTotFlux_dP[ke] += dPhaseFlux_dP[ke];
1755 totMob += phaseMob[seri[ke]][sesri[ke]][sei[ke]][jp];
1756 dTotMob_dP[ke] += dPhaseMob[seri[ke]][sesri[ke]][sei[ke]][jp][Deriv::dP];
1757 dPhaseFlux_dP[ke] = 0.;
1761 dTotFlux_dC[ke][jc] += dPhaseFlux_dC[ke][jc];
1762 dTotMob_dC[ke][jc] += dPhaseMob[seri[ke]][sesri[ke]][sei[ke]][jp][Deriv::dC + jc];
1763 dPhaseFlux_dC[ke][jc] = 0.;
1773 real64 viscousPhaseFlux{};
1774 real64 dViscousPhaseFlux_dP[numFluxSupportPoints]{};
1775 real64 dViscousPhaseFlux_dC[numFluxSupportPoints][numComp]{};
1778 real64 dFractionalFlow_dP[numFluxSupportPoints]{};
1779 real64 dFractionalFlow_dC[numFluxSupportPoints][numComp]{};
1783 UpwindHelpers::computeFractionalFlowViscous< numComp, numFluxSupportPoints,
1798 dCompFrac_dCompDens,
1805 dPhaseCapPressure_dPhaseVolFrac,
1810 dFractionalFlow_dC );
1814 viscousPhaseFlux = fractionalFlow * totFlux;
1815 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1817 dViscousPhaseFlux_dP[ke] += dFractionalFlow_dP[ke] * totFlux;
1822 dViscousPhaseFlux_dC[ke][jc] += dFractionalFlow_dC[ke][jc] * totFlux;
1827 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1829 dViscousPhaseFlux_dP[ke] += fractionalFlow * dTotFlux_dP[ke];
1834 dViscousPhaseFlux_dC[ke][jc] += fractionalFlow * dTotFlux_dC[ke][jc];
1840 phaseCompFrac, dPhaseCompFrac, dCompFrac_dCompDens,
1841 viscousPhaseFlux, dViscousPhaseFlux_dP, dViscousPhaseFlux_dC,
1842 compFlux, dCompFlux_dP, dCompFlux_dC );
1845 phaseFlux += viscousPhaseFlux;
1846 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1848 dPhaseFlux_dP[ke] += dViscousPhaseFlux_dP[ke];
1852 dPhaseFlux_dC[ke][ic] += dViscousPhaseFlux_dC[ke][ic];
1859 real64 gravitationalPhaseFlux{};
1860 real64 gravitationalPhaseFlux_dP[numFluxSupportPoints]{};
1861 real64 gravitationalPhaseFlux_dC[numFluxSupportPoints][numComp]{};
1863 UpwindHelpers::computePotentialFluxesGravity< numComp,
1883 dCompFrac_dCompDens,
1887 dPhaseCapPressure_dPhaseVolFrac,
1891 gravitationalPhaseFlux,
1892 gravitationalPhaseFlux_dP,
1893 gravitationalPhaseFlux_dC );
1900 phaseCompFrac, dPhaseCompFrac, dCompFrac_dCompDens,
1901 gravitationalPhaseFlux, gravitationalPhaseFlux_dP, gravitationalPhaseFlux_dC,
1902 compFlux, dCompFlux_dP, dCompFlux_dC );
1906 phaseFlux += gravitationalPhaseFlux;
1907 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1909 dPhaseFlux_dP[ke] += gravitationalPhaseFlux_dP[ke];
1911 dPhaseFlux_dC[ke][ic] += gravitationalPhaseFlux_dC[ke][ic];
1915 if( hasCapPressure )
1921 real64 capillaryPhaseFlux{};
1922 real64 capillaryPhaseFlux_dP[numFluxSupportPoints]{};
1923 real64 capillaryPhaseFlux_dC[numFluxSupportPoints][numComp]{};
1925 UpwindHelpers::computePotentialFluxesCapillary< numComp,
1944 dCompFrac_dCompDens,
1948 dPhaseCapPressure_dPhaseVolFrac,
1953 capillaryPhaseFlux_dP,
1954 capillaryPhaseFlux_dC );
1959 phaseCompFrac, dPhaseCompFrac, dCompFrac_dCompDens,
1960 capillaryPhaseFlux, capillaryPhaseFlux_dP, capillaryPhaseFlux_dC,
1961 compFlux, dCompFlux_dP, dCompFlux_dC );
1965 phaseFlux += capillaryPhaseFlux;
1966 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1968 dPhaseFlux_dP[ke] += capillaryPhaseFlux_dP[ke];
1970 dPhaseFlux_dC[ke][ic] += capillaryPhaseFlux_dC[ke][ic];
#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], localIndex const &k_up_ppu, 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 capPressureFlag, localIndex(&k_up), localIndex(&k_up_o), 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 capPressureFlag, 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 capPressureFlag, localIndex &upwindDir)
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
ArrayView< T, 5, USD > arrayView5d
Alias for 5D array view.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
std::int32_t integer
Signed integer type.
ArrayView< T, 4, USD > arrayView4d
Alias for 4D array view.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
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, 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< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_COMP > > const &phaseCompFrac, ElementViewConst< arrayView5d< real64 const, constitutive::multifluid::USD_PHASE_COMP_DC > > const &dPhaseCompFrac, 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 &k_up, real64 &potGrad, real64(&phaseFlux), real64(&dPhaseFlux_dP)[numFluxSupportPoints], real64(&dPhaseFlux_dC)[numFluxSupportPoints][numComp], real64(&compFlux)[numComp], real64(&dCompFlux_dP)[numFluxSupportPoints][numComp], real64(&dCompFlux_dC)[numFluxSupportPoints][numComp][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, 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< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_COMP > > const &phaseCompFrac, ElementViewConst< arrayView5d< real64 const, constitutive::multifluid::USD_PHASE_COMP_DC > > const &dPhaseCompFrac, 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 &k_up, real64 &potGrad, real64(&phaseFlux), real64(&dPhaseFlux_dP)[numFluxSupportPoints], real64(&dPhaseFlux_dC)[numFluxSupportPoints][numComp], real64(&compFlux)[numComp], real64(&dCompFlux_dP)[numFluxSupportPoints][numComp], real64(&dCompFlux_dC)[numFluxSupportPoints][numComp][numComp])
Form the PhasePotentialUpwind from pressure gradient and gravitational head.
static GEOS_HOST_DEVICE void compute(localIndex const ip, localIndex const k_up, 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< arrayView3d< real64 const, compflow::USD_COMP_DC > > const &dCompFrac_dCompDens, real64 const &phaseFlux, real64 const (&dPhaseFlux_dP)[numFluxSupportPoints], real64 const (&dPhaseFlux_dC)[numFluxSupportPoints][numComp], real64(&compFlux)[numComp], real64(&dCompFlux_dP)[numFluxSupportPoints][numComp], real64(&dCompFlux_dC)[numFluxSupportPoints][numComp][numComp])
Compute the component flux for a given phase.
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], real64(&GEOS_UNUSED_PARAM(dProp_dComp))[numComp])
static GEOS_HOST_DEVICE void compute(localIndex const GEOS_UNUSED_PARAM(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 &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], real64(&dProp_dComp)[numComp])
Struct defining formation of potential from different Physics (flagged by enum type T) to be used in ...