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,
143 integer const checkPhasePresenceInGravity,
147 real64 ( & dMobility_dC)[numComp]
156 dMobility_dC[ic] = 0.0;
160 scheme.template getUpwindDirectionGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
177 dPhaseCapPressure_dPhaseVolFrac,
179 checkPhasePresenceInGravity,
186 if( std::fabs( phaseMob[er_up][esr_up][ei_up][ip] ) > 1e-20 )
188 mobility = phaseMob[er_up][esr_up][ei_up][ip];
189 dMobility_dP = dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dP];
192 dMobility_dC[ic] = dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dC + ic];
197 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
200 upwindMobilityCapillary(
localIndex const numPhase,
202 localIndex const (&seri)[numFluxSupportPoints],
203 localIndex const (&sesri)[numFluxSupportPoints],
204 localIndex const (&sei)[numFluxSupportPoints],
205 real64 const (&transmissibility)[2],
206 real64 const (&dTrans_dPres)[2],
208 ElementViewConst< arrayView1d< real64 const > >
const & pres,
209 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
210 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
211 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
212 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
213 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
214 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
215 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
216 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
217 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
222 real64 ( & dMobility_dC)[numComp]
231 dMobility_dC[ic] = 0.0;
235 scheme.template getUpwindDirectionCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
251 dPhaseCapPressure_dPhaseVolFrac,
259 if( std::fabs( phaseMob[er_up][esr_up][ei_up][ip] ) > 1e-20 )
261 mobility = phaseMob[er_up][esr_up][ei_up][ip];
262 dMobility_dP = dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dP];
265 dMobility_dC[ic] = dPhaseMob[er_up][esr_up][ei_up][ip][Deriv::dC + ic];
270 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
273 computeFractionalFlowViscous(
localIndex const numPhase,
275 localIndex const (&seri)[numFluxSupportPoints],
276 localIndex const (&sesri)[numFluxSupportPoints],
277 localIndex const (&sei)[numFluxSupportPoints],
278 real64 const (&transmissibility)[2],
279 real64 const (&dTrans_dPres)[2],
283 real64 const (&dTotMob_dP)[numFluxSupportPoints],
284 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
285 ElementViewConst< arrayView1d< real64 const > >
const & pres,
286 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
287 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
288 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
289 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
290 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
291 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
292 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
293 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
294 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
298 real64 ( & dFractionalFlow_dP)[numFluxSupportPoints],
299 real64 ( & dFractionalFlow_dC)[numFluxSupportPoints][numComp] )
304 real64 dMMob_dC[numComp]{};
314 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
316 dFractionalFlow_dP[ke] = 0;
319 dFractionalFlow_dC[ke][jc] = 0;
326 real64 dMob_dC[numComp]{};
328 upwindMobilityViscous< numComp, numFluxSupportPoints, UPWIND >( numPhase,
345 dPhaseCapPressure_dPhaseVolFrac,
357 dMMob_dC[ic] = dMob_dC[ic];
361 if( std::fabs( mainMob ) > 1e-20 )
363 fractionalFlow = mainMob / LvArray::math::max( totMob, minTotMob );
364 dFractionalFlow_dP[k_up_main] = dMMob_dP / LvArray::math::max( totMob, minTotMob );
367 dFractionalFlow_dC[k_up_main][jc] = dMMob_dC[jc] / totMob;
371 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
373 dFractionalFlow_dP[ke] -= fractionalFlow * dTotMob_dP[k_up_ppu] / LvArray::math::max( totMob, minTotMob );
377 dFractionalFlow_dC[ke][jc] -= fractionalFlow * dTotMob_dC[k_up_ppu][jc] / LvArray::math::max( totMob, minTotMob );
384 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
387 computeFractionalFlowGravity(
localIndex const numPhase,
389 localIndex const (&seri)[numFluxSupportPoints],
390 localIndex const (&sesri)[numFluxSupportPoints],
391 localIndex const (&sei)[numFluxSupportPoints],
392 real64 const (&transmissibility)[2],
393 real64 const (&dTrans_dPres)[2],
397 real64 const (&dTotMob_dP)[numFluxSupportPoints],
398 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
399 ElementViewConst< arrayView1d< real64 const > >
const & pres,
400 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
401 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
402 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
403 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
404 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
405 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
406 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseVolFrac,
407 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
408 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
409 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
411 integer const checkPhasePresenceInGravity,
414 real64 ( & dFractionalFlow_dP)[numFluxSupportPoints],
415 real64 ( & dFractionalFlow_dC)[numFluxSupportPoints][numComp]
421 real64 dMMob_dC[numComp]{};
427 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
429 dFractionalFlow_dP[ke] = 0;
432 dFractionalFlow_dC[ke][jc] = 0;
440 real64 dMob_dC[numComp]{};
442 upwindMobilityGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
460 dPhaseCapPressure_dPhaseVolFrac,
462 checkPhasePresenceInGravity,
473 dMMob_dC[ic] = dMob_dC[ic];
477 if( std::fabs( mainMob ) > 1e-20 )
479 fractionalFlow = mainMob / LvArray::math::max( totMob, minTotMob );
480 dFractionalFlow_dP[k_up_main] = dMMob_dP / LvArray::math::max( totMob, minTotMob );
483 dFractionalFlow_dC[k_up_main][jc] = dMMob_dC[jc] / totMob;
487 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
489 dFractionalFlow_dP[ke] -= fractionalFlow * dTotMob_dP[k_up_ppu] / LvArray::math::max( totMob, minTotMob );
493 dFractionalFlow_dC[ke][jc] -= fractionalFlow * dTotMob_dC[k_up_ppu][jc] / LvArray::math::max( totMob, minTotMob );
499 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
502 computeFractionalFlowCapillary(
localIndex const numPhase,
504 localIndex const (&seri)[numFluxSupportPoints],
505 localIndex const (&sesri)[numFluxSupportPoints],
506 localIndex const (&sei)[numFluxSupportPoints],
507 real64 const (&transmissibility)[2],
508 real64 const (&dTrans_dPres)[2],
512 real64 const (&dTotMob_dP)[numFluxSupportPoints],
513 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
514 ElementViewConst< arrayView1d< real64 const > >
const & pres,
515 ElementViewConst< arrayView1d< real64 const > >
const & gravCoef,
516 ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > >
const & dCompFrac_dCompDens,
517 ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > >
const & phaseMassDens,
518 ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_DC > >
const & dPhaseMassDens,
519 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
520 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseMob,
521 ElementViewConst< arrayView3d< real64 const, compflow::USD_PHASE_DC > >
const & dPhaseVolFrac,
522 ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > >
const & phaseCapPressure,
523 ElementViewConst< arrayView4d< real64 const, constitutive::cappres::USD_CAPPRES_DS > >
const & dPhaseCapPressure_dPhaseVolFrac,
527 real64 ( & dFractionalFlow_dP)[numFluxSupportPoints],
528 real64 ( & dFractionalFlow_dC)[numFluxSupportPoints][numComp]
534 real64 dMMob_dC[numComp]{};
540 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
542 dFractionalFlow_dP[ke] = 0;
545 dFractionalFlow_dC[ke][jc] = 0;
552 real64 dMob_dC[numComp]{};
554 upwindMobilityCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
571 dPhaseCapPressure_dPhaseVolFrac,
583 dMMob_dC[ic] = dMob_dC[ic];
587 if( std::fabs( mainMob ) > 1e-20 )
589 fractionalFlow = mainMob / LvArray::math::max( totMob, minTotMob );
590 dFractionalFlow_dP[k_up_main] = dMMob_dP / LvArray::math::max( totMob, minTotMob );
593 dFractionalFlow_dC[k_up_main][jc] = dMMob_dC[jc] / LvArray::math::max( totMob, minTotMob );
597 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
599 dFractionalFlow_dP[ke] -= fractionalFlow * dTotMob_dP[k_up_ppu] / LvArray::math::max( totMob, minTotMob );
603 dFractionalFlow_dC[ke][jc] -= fractionalFlow * dTotMob_dC[k_up_ppu][jc] / LvArray::math::max( totMob, minTotMob );
619 template< localIndex numComp, localIndex numFluxSupportPo
ints >
661 template< localIndex numComp, localIndex numFluxSupportPo
ints >
665 integer const checkPhasePresenceInGravity,
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],
684 real64 ( & dPot_dPres )[numFluxSupportPoints],
685 real64 (& dPot_dComp )[numFluxSupportPoints][numComp],
686 real64 ( & dProp_dComp )[numComp] )
690 real64 dDensMean_dPres[numFluxSupportPoints]{};
691 real64 dDensMean_dComp[numFluxSupportPoints][numComp]{};
695 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
700 dPot_dComp[i][jc] = 0.0;
701 dProp_dComp[jc] = 0.0;
705 calculateMeanDensity( checkPhasePresenceInGravity, ip, seri, sesri, sei,
706 phaseVolFrac, dCompFrac_dCompDens,
707 phaseMassDens, dPhaseMassDens, dProp_dComp,
708 densMean, dDensMean_dPres, dDensMean_dComp );
711 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
717 real64 const gravD = transmissibility[i] * gravCoef[er][esr][ei];
718 real64 const dGravD_dP = dTrans_dPres[i] * gravCoef[er][esr][ei];
719 pot += densMean * gravD;
722 for(
localIndex j = 0; j < numFluxSupportPoints; ++j )
724 dPot_dPres[j] += dDensMean_dPres[j] * gravD + densMean * dGravD_dP;
727 dPot_dComp[j][jc] += dDensMean_dComp[j][jc] * gravD;
733 template< localIndex numComp, localIndex numFluxSupportPo
ints >
735 static void calculateMeanDensity(
integer const checkPhasePresenceInGravity,
737 localIndex const (&seri)[numFluxSupportPoints],
738 localIndex const (&sesri)[numFluxSupportPoints],
739 localIndex const (&sei)[numFluxSupportPoints],
744 real64 (& dProp_dComp)[numComp],
745 real64 & densMean,
real64 (& dDensMean_dPres)[numFluxSupportPoints],
real64 (& dDensMean_dComp)[numFluxSupportPoints][numComp] )
748 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
754 bool const phaseExists = (phaseVolFrac[er][esr][ei][ip] > 0);
755 if( checkPhasePresenceInGravity && !phaseExists )
761 real64 const density = phaseMassDens[er][esr][ei][0][ip];
762 real64 const dDens_dPres = dPhaseMassDens[er][esr][ei][0][ip][Deriv::dP];
764 applyChainRule( numComp,
765 dCompFrac_dCompDens[er][esr][ei],
766 dPhaseMassDens[er][esr][ei][0][ip],
772 dDensMean_dPres[i] = dDens_dPres;
775 dDensMean_dComp[i][jc] = dProp_dComp[jc];
782 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
784 dDensMean_dPres[i] /= denom;
785 for(
integer jc = 0; jc < numComp; ++jc )
787 dDensMean_dComp[i][jc] /= denom;
802 template< localIndex numComp, localIndex numFluxSupportPo
ints >
806 localIndex const (&seri)[numFluxSupportPoints],
807 localIndex const (&sesri)[numFluxSupportPoints],
808 localIndex const (&sei)[numFluxSupportPoints],
809 real64 const (&transmissibility)[2],
810 real64 const (&dTrans_dPres)[2],
823 real64 ( & dPot_dPres)[numFluxSupportPoints],
824 real64 (& dPot_dComp)[numFluxSupportPoints][numComp],
829 for(
localIndex i = 0; i < numFluxSupportPoints; ++i )
835 pot += transmissibility[i] * phaseCapPressure[er][esr][ei][0][ip];
840 real64 const dCapPressure_dS = dPhaseCapPressure_dPhaseVolFrac[er][esr][ei][0][ip][jp];
842 transmissibility[i] * dCapPressure_dS * dPhaseVolFrac[er][esr][ei][jp][Deriv::dP]
843 + dTrans_dPres[i] * phaseCapPressure[er][esr][ei][0][jp];
847 dPot_dComp[i][jc] += transmissibility[i] * dCapPressure_dS *
848 dPhaseVolFrac[er][esr][ei][jp][Deriv::dC + jc];
857 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
861 localIndex const (&seri)[numFluxSupportPoints],
862 localIndex const (&sesri)[numFluxSupportPoints],
863 localIndex const (&sei)[numFluxSupportPoints],
864 real64 const (&transmissibility)[2],
865 real64 const (&dTrans_dPres)[2],
869 real64 const (&dTotMob_dP)[numFluxSupportPoints],
870 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
883 integer const checkPhasePresenceInGravity,
887 real64 (& dPhaseFlux_dP)[numFluxSupportPoints],
888 real64 ( & dPhaseFlux_dC)[numFluxSupportPoints][numComp] )
892 real64 dFflow_dP[numFluxSupportPoints]{};
893 real64 dFflow_dC[numFluxSupportPoints][numComp]{};
896 real64 dPot_dP[numFluxSupportPoints]{};
897 real64 dPot_dC[numFluxSupportPoints][numComp]{};
898 real64 dProp_dC[numComp]{};
901 UpwindHelpers::computePotentialGravity::compute< numComp, numFluxSupportPoints >( numPhase,
903 checkPhasePresenceInGravity,
917 dPhaseCapPressure_dPhaseVolFrac,
925 UpwindHelpers::computeFractionalFlowGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
947 dPhaseCapPressure_dPhaseVolFrac,
949 checkPhasePresenceInGravity,
962 real64 dPotOther_dP[numFluxSupportPoints]{};
963 real64 dPotOther_dC[numFluxSupportPoints][numComp]{};
964 real64 dPropOther_dC[numComp]{};
967 UpwindHelpers::computePotentialGravity::compute< numComp, numFluxSupportPoints >( numPhase,
969 checkPhasePresenceInGravity,
983 dPhaseCapPressure_dPhaseVolFrac,
992 real64 dMobOther_dC[numComp]{};
997 UpwindHelpers::upwindMobilityGravity< numComp, numFluxSupportPoints, UPWIND >( numPhase,
1007 dCompFrac_dCompDens,
1015 dPhaseCapPressure_dPhaseVolFrac,
1017 checkPhasePresenceInGravity,
1025 phaseFlux -= fflow * mobOther * (pot - potOther);
1026 dPhaseFlux_dP[k_up_o] -= fflow * dMobOther_dP * (pot - potOther);
1029 dPhaseFlux_dC[k_up_o][jc] -= fflow * dMobOther_dC[jc] * (pot - potOther);
1033 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1035 dPhaseFlux_dP[ke] -= dFflow_dP[ke] * mobOther * (pot - potOther);
1039 dPhaseFlux_dC[ke][jc] -= dFflow_dC[ke][jc] * mobOther * (pot - potOther);
1043 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1045 dPhaseFlux_dP[ke] -= fflow * mobOther * (dPot_dP[ke] - dPotOther_dP[ke]);
1048 dPhaseFlux_dC[ke][jc] -= fflow * mobOther * (dPot_dC[ke][jc] - dPotOther_dC[ke][jc]);
1056 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
1058 static void computePotentialFluxesCapillary(
localIndex const numPhase,
1060 localIndex const (&seri)[numFluxSupportPoints],
1061 localIndex const (&sesri)[numFluxSupportPoints],
1062 localIndex const (&sei)[numFluxSupportPoints],
1063 real64 const (&transmissibility)[2],
1064 real64 const (&dTrans_dPres)[2],
1068 real64 const (&dTotMob_dP)[numFluxSupportPoints],
1069 real64 const (&dTotMob_dC)[numFluxSupportPoints][numComp],
1084 real64 (& dPhaseFlux_dP)[numFluxSupportPoints],
1085 real64 ( & dPhaseFlux_dC)[numFluxSupportPoints][numComp] )
1089 real64 dFflow_dP[numFluxSupportPoints]{};
1090 real64 dFflow_dC[numFluxSupportPoints][numComp]{};
1093 real64 dPot_dP[numFluxSupportPoints]{};
1094 real64 dPot_dC[numFluxSupportPoints][numComp]{};
1095 real64 dProp_dC[numComp]{};
1097 UpwindHelpers::computePotentialCapillary::compute< numComp, numFluxSupportPoints >( numPhase,
1106 dCompFrac_dCompDens,
1111 dPhaseCapPressure_dPhaseVolFrac,
1119 UpwindHelpers::computeFractionalFlowCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
1133 dCompFrac_dCompDens,
1140 dPhaseCapPressure_dPhaseVolFrac,
1148 for(
localIndex jp = 0; jp < numPhase; ++jp )
1154 real64 dPotOther_dP[numFluxSupportPoints]{};
1155 real64 dPotOther_dC[numFluxSupportPoints][numComp]{};
1156 real64 dPropOther_dC[numComp]{};
1159 UpwindHelpers::computePotentialCapillary::compute< numComp, numFluxSupportPoints >( numPhase,
1168 dCompFrac_dCompDens,
1173 dPhaseCapPressure_dPhaseVolFrac,
1182 real64 dMobOther_dC[numComp]{};
1187 UpwindHelpers::upwindMobilityCapillary< numComp, numFluxSupportPoints, UPWIND >( numPhase,
1197 dCompFrac_dCompDens,
1204 dPhaseCapPressure_dPhaseVolFrac,
1213 phaseFlux -= fflow * mobOther * (pot - potOther);
1214 dPhaseFlux_dP[k_up_o] -= fflow * dMobOther_dP * (pot - potOther);
1217 dPhaseFlux_dC[k_up_o][jc] -= fflow * dMobOther_dC[jc] * (pot - potOther);
1221 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1223 dPhaseFlux_dP[ke] -= dFflow_dP[ke] * mobOther * (pot - potOther);
1227 dPhaseFlux_dC[ke][jc] -= dFflow_dC[ke][jc] * mobOther * (pot - potOther);
1231 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1233 dPhaseFlux_dP[ke] -= fflow * mobOther * (dPot_dP[ke] - dPotOther_dP[ke]);
1236 dPhaseFlux_dC[ke][jc] -= fflow * mobOther * (dPot_dC[ke][jc] - dPotOther_dC[ke][jc]);
1272 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
1277 localIndex const (&seri)[numFluxSupportPoints],
1278 localIndex const (&sesri)[numFluxSupportPoints],
1279 localIndex const (&sei)[numFluxSupportPoints],
1280 real64 const (&transmissibility)[2],
1281 real64 const (&dTrans_dPres)[2],
1300 UPWIND::template computePotentialViscous< numComp, numFluxSupportPoints >( numPhase,
1311 dCompFrac_dCompDens,
1316 dPhaseCapPressure_dPhaseVolFrac,
1321 upwindDir = (pot > 0) ? 0 : 1;
1325 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
1329 localIndex const (&seri)[numFluxSupportPoints],
1330 localIndex const (&sesri)[numFluxSupportPoints],
1331 localIndex const (&sei)[numFluxSupportPoints],
1332 real64 const (&transmissibility)[2],
1333 real64 const (&dTrans_dPres)[2],
1346 integer const checkPhasePresenceInGravity,
1354 UPWIND::template computePotentialGravity< numComp, numFluxSupportPoints >( numPhase,
1365 dCompFrac_dCompDens,
1371 dPhaseCapPressure_dPhaseVolFrac,
1373 checkPhasePresenceInGravity,
1377 upwindDir = (pot >= 0) ? 0 : 1;
1381 template< localIndex numComp, localIndex numFluxSupportPo
ints,
class UPWIND >
1383 void getUpwindDirectionCapillary(
localIndex const numPhase,
1385 localIndex const (&seri)[numFluxSupportPoints],
1386 localIndex const (&sesri)[numFluxSupportPoints],
1387 localIndex const (&sei)[numFluxSupportPoints],
1388 real64 const (&transmissibility)[2],
1389 real64 const (&dTrans_dPres)[2],
1409 UPWIND::template computePotentialCapillary< numComp, numFluxSupportPoints >( numPhase,
1420 dCompFrac_dCompDens,
1425 dPhaseCapPressure_dPhaseVolFrac,
1430 upwindDir = (pot >= 0) ? 0 : 1;
1437 template< localIndex numComp, localIndex numFluxSupportPo
ints,
typename LAMBDA >
1441 localIndex const (&seri)[numFluxSupportPoints],
1442 localIndex const (&sesri)[numFluxSupportPoints],
1443 localIndex const (&sei)[numFluxSupportPoints],
1444 ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > >
const & phaseMob,
1445 real64 & weightedPotential,
1450 real64 pot_dP[numFluxSupportPoints]{};
1451 real64 pot_dC[numFluxSupportPoints][numComp]{};
1452 real64 dProp_dC[numComp]{};
1454 fn( ip, pot, pot_dP, pot_dC, dProp_dC );
1460 for(
localIndex jp = 0; jp < numPhase; ++jp )
1473 real64 potOther_dP[numFluxSupportPoints]{};
1474 real64 potOther_dC[numFluxSupportPoints][numComp]{};
1475 real64 dPropOther_dC[numComp]{};
1477 fn( jp, potOther, potOther_dP, potOther_dC, dPropOther_dC );
1479 real64 const mob_up = phaseMob[er_up][esr_up][ei_up][jp];
1480 real64 const mob_dw = phaseMob[er_dw][esr_dw][ei_dw][jp];
1482 weightedPotential += (pot - potOther >= 0) ? mob_dw * (potOther - pot) : mob_up * (potOther - pot);
1498 template< localIndex numComp, localIndex numFluxSupportPo
ints >
1501 void computePotentialViscous(
localIndex const numPhase,
1503 localIndex const (&seri)[numFluxSupportPoints],
1504 localIndex const (&sesri)[numFluxSupportPoints],
1505 localIndex const (&sei)[numFluxSupportPoints],
1506 real64 const (&transmissibility)[2],
1507 real64 const (&dTrans_dPres)[2],
1523 real64 dPot_dP[numFluxSupportPoints]{};
1524 real64 dPot_dC[numFluxSupportPoints][numComp]{};
1525 real64 dProp_dC[numComp]{};
1528 UpwindHelpers::computePotentialViscous::compute< numComp, numFluxSupportPoints >(
1538 dCompFrac_dCompDens,
1543 dPhaseCapPressure_dPhaseVolFrac,
1550 template< localIndex numComp, localIndex numFluxSupportPo
ints >
1553 void computePotentialGravity(
localIndex const numPhase,
1555 localIndex const (&seri)[numFluxSupportPoints],
1556 localIndex const (&sesri)[numFluxSupportPoints],
1557 localIndex const (&sei)[numFluxSupportPoints],
1558 real64 const (&transmissibility)[2],
1559 real64 const (&dTrans_dPres)[2],
1572 integer const checkPhasePresenceInGravity,
1580 UpwindScheme::template potential< numComp, numFluxSupportPoints >( numPhase, ip, seri, sesri, sei,
1581 phaseMob, potential,
1584 real64 (& dPotential_dP_)[numFluxSupportPoints],
1585 real64 (& dPotential_dC_)[numFluxSupportPoints][numComp],
1586 real64 (& dProp_dC)[numComp] ) {
1588 UpwindHelpers::computePotentialGravity::compute< numComp, numFluxSupportPoints >(
1591 checkPhasePresenceInGravity,
1599 dCompFrac_dCompDens,
1605 dPhaseCapPressure_dPhaseVolFrac,
1615 template< localIndex numComp, localIndex numFluxSupportPo
ints >
1618 void computePotentialCapillary(
localIndex const numPhase,
1620 localIndex const (&seri)[numFluxSupportPoints],
1621 localIndex const (&sesri)[numFluxSupportPoints],
1622 localIndex const (&sei)[numFluxSupportPoints],
1623 real64 const (&transmissibility)[2],
1624 real64 const (&dTrans_dPres)[2],
1645 UpwindScheme::template potential< numComp, numFluxSupportPoints >( numPhase, ip, seri, sesri, sei,
1646 phaseMob, potential,
1649 real64 (& dPotential_dP_)[numFluxSupportPoints],
1650 real64 (& dPotential_dC_)[numFluxSupportPoints][numComp],
1651 real64 (& dProp_dC)[numComp] ) {
1653 UpwindHelpers::computePotentialCapillary::compute< numComp, numFluxSupportPoints >(
1663 dCompFrac_dCompDens,
1668 dPhaseCapPressure_dPhaseVolFrac,
1713 template<
integer numComp,
integer numFluxSupportPo
ints >
1719 integer const checkPhasePresenceInGravity,
1720 localIndex const ( &seri )[numFluxSupportPoints],
1721 localIndex const ( &sesri )[numFluxSupportPoints],
1722 localIndex const ( &sei )[numFluxSupportPoints],
1723 real64 const ( &trans )[2],
1724 real64 const ( &dTrans_dPres )[2],
1741 real64 ( & dPhaseFlux_dP )[numFluxSupportPoints],
1742 real64 ( & dPhaseFlux_dC )[numFluxSupportPoints][numComp],
1743 real64 ( & compFlux )[numComp],
1744 real64 ( & dCompFlux_dP )[numFluxSupportPoints][numComp],
1745 real64 ( & dCompFlux_dC )[numFluxSupportPoints][numComp][numComp] )
1750 real64 dTotFlux_dP[numFluxSupportPoints]{};
1751 real64 dTotFlux_dC[numFluxSupportPoints][numComp]{};
1755 real64 dTotMob_dP[numFluxSupportPoints]{};
1756 real64 dTotMob_dC[numFluxSupportPoints][numComp]{};
1761 real64 dDummy_dP[numFluxSupportPoints][numComp];
1762 real64 dDummy_dC[numFluxSupportPoints][numComp][numComp];
1765 for(
integer jp = 0; jp < numPhase; ++jp )
1768 hasCapPressure, checkPhasePresenceInGravity,
1770 trans, dTrans_dPres,
1772 phaseMob, dPhaseMob,
1773 phaseVolFrac, dPhaseVolFrac,
1774 phaseCompFrac, dPhaseCompFrac,
1775 dCompFrac_dCompDens,
1776 phaseMassDens, dPhaseMassDens,
1777 phaseCapPressure, dPhaseCapPressure_dPhaseVolFrac,
1779 phaseFlux, dPhaseFlux_dP, dPhaseFlux_dC,
1780 dummy, dDummy_dP, dDummy_dC );
1782 totFlux += phaseFlux;
1785 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1787 dTotFlux_dP[ke] += dPhaseFlux_dP[ke];
1788 totMob += phaseMob[seri[ke]][sesri[ke]][sei[ke]][jp];
1789 dTotMob_dP[ke] += dPhaseMob[seri[ke]][sesri[ke]][sei[ke]][jp][Deriv::dP];
1790 dPhaseFlux_dP[ke] = 0.;
1794 dTotFlux_dC[ke][jc] += dPhaseFlux_dC[ke][jc];
1795 dTotMob_dC[ke][jc] += dPhaseMob[seri[ke]][sesri[ke]][sei[ke]][jp][Deriv::dC + jc];
1796 dPhaseFlux_dC[ke][jc] = 0.;
1806 real64 viscousPhaseFlux{};
1807 real64 dViscousPhaseFlux_dP[numFluxSupportPoints]{};
1808 real64 dViscousPhaseFlux_dC[numFluxSupportPoints][numComp]{};
1811 real64 dFractionalFlow_dP[numFluxSupportPoints]{};
1812 real64 dFractionalFlow_dC[numFluxSupportPoints][numComp]{};
1816 UpwindHelpers::computeFractionalFlowViscous< numComp, numFluxSupportPoints,
1831 dCompFrac_dCompDens,
1838 dPhaseCapPressure_dPhaseVolFrac,
1843 dFractionalFlow_dC );
1847 viscousPhaseFlux = fractionalFlow * totFlux;
1848 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1850 dViscousPhaseFlux_dP[ke] += dFractionalFlow_dP[ke] * totFlux;
1855 dViscousPhaseFlux_dC[ke][jc] += dFractionalFlow_dC[ke][jc] * totFlux;
1860 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1862 dViscousPhaseFlux_dP[ke] += fractionalFlow * dTotFlux_dP[ke];
1867 dViscousPhaseFlux_dC[ke][jc] += fractionalFlow * dTotFlux_dC[ke][jc];
1873 phaseCompFrac, dPhaseCompFrac, dCompFrac_dCompDens,
1874 viscousPhaseFlux, dViscousPhaseFlux_dP, dViscousPhaseFlux_dC,
1875 compFlux, dCompFlux_dP, dCompFlux_dC );
1878 phaseFlux += viscousPhaseFlux;
1879 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1881 dPhaseFlux_dP[ke] += dViscousPhaseFlux_dP[ke];
1885 dPhaseFlux_dC[ke][ic] += dViscousPhaseFlux_dC[ke][ic];
1892 real64 gravitationalPhaseFlux{};
1893 real64 gravitationalPhaseFlux_dP[numFluxSupportPoints]{};
1894 real64 gravitationalPhaseFlux_dC[numFluxSupportPoints][numComp]{};
1896 UpwindHelpers::computePotentialFluxesGravity< numComp,
1916 dCompFrac_dCompDens,
1920 dPhaseCapPressure_dPhaseVolFrac,
1922 checkPhasePresenceInGravity,
1925 gravitationalPhaseFlux,
1926 gravitationalPhaseFlux_dP,
1927 gravitationalPhaseFlux_dC );
1934 phaseCompFrac, dPhaseCompFrac, dCompFrac_dCompDens,
1935 gravitationalPhaseFlux, gravitationalPhaseFlux_dP, gravitationalPhaseFlux_dC,
1936 compFlux, dCompFlux_dP, dCompFlux_dC );
1940 phaseFlux += gravitationalPhaseFlux;
1941 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
1943 dPhaseFlux_dP[ke] += gravitationalPhaseFlux_dP[ke];
1945 dPhaseFlux_dC[ke][ic] += gravitationalPhaseFlux_dC[ke][ic];
1949 if( hasCapPressure )
1955 real64 capillaryPhaseFlux{};
1956 real64 capillaryPhaseFlux_dP[numFluxSupportPoints]{};
1957 real64 capillaryPhaseFlux_dC[numFluxSupportPoints][numComp]{};
1959 UpwindHelpers::computePotentialFluxesCapillary< numComp,
1978 dCompFrac_dCompDens,
1982 dPhaseCapPressure_dPhaseVolFrac,
1987 capillaryPhaseFlux_dP,
1988 capillaryPhaseFlux_dC );
1993 phaseCompFrac, dPhaseCompFrac, dCompFrac_dCompDens,
1994 capillaryPhaseFlux, capillaryPhaseFlux_dP, capillaryPhaseFlux_dC,
1995 compFlux, dCompFlux_dP, dCompFlux_dC );
1999 phaseFlux += capillaryPhaseFlux;
2000 for(
localIndex ke = 0; ke < numFluxSupportPoints; ++ke )
2002 dPhaseFlux_dP[ke] += capillaryPhaseFlux_dP[ke];
2004 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 hasCapPressure, integer const checkPhasePresenceInGravity, 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 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.
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, 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< 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, 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< 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, 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], real64(&dProp_dComp)[numComp])
Struct defining formation of potential from different Physics (flagged by enum type T) to be used in ...