blackoilfoammodules.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
28#ifndef EWOMS_BLACK_OIL_FOAM_MODULE_HH
29#define EWOMS_BLACK_OIL_FOAM_MODULE_HH
30
31#include "blackoilproperties.hh"
32
33#include <opm/common/OpmLog/OpmLog.hpp>
34
36
37#if HAVE_ECL_INPUT
38#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
39#include <opm/input/eclipse/EclipseState/Tables/FoamadsTable.hpp>
40#include <opm/input/eclipse/EclipseState/Tables/FoammobTable.hpp>
41#endif
42
43#include <dune/common/fvector.hh>
44
45#include <string>
46#include <math.h>
47
48namespace Opm {
49
55template <class TypeTag, bool enableFoamV = getPropValue<TypeTag, Properties::EnableFoam>()>
57{
70
71 using Toolbox = MathToolbox<Evaluation>;
72
73 using TabulatedFunction = typename BlackOilFoamParams<Scalar>::TabulatedFunction;
74
75 static constexpr unsigned foamConcentrationIdx = Indices::foamConcentrationIdx;
76 static constexpr unsigned contiFoamEqIdx = Indices::contiFoamEqIdx;
77 static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
78 static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx;
79
80 static constexpr unsigned enableFoam = enableFoamV;
81 static constexpr bool enableVtkOutput = getPropValue<TypeTag, Properties::EnableVtkOutput>();
82
83 static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
84 static constexpr unsigned numPhases = FluidSystem::numPhases;
85
86 enum { enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>() };
87
88public:
89#if HAVE_ECL_INPUT
93 static void initFromState(const EclipseState& eclState)
94 {
95 // some sanity checks: if foam is enabled, the FOAM keyword must be
96 // present, if foam is disabled the keyword must not be present.
97 if (enableFoam && !eclState.runspec().phases().active(Phase::FOAM)) {
98 throw std::runtime_error("Non-trivial foam treatment requested at compile time, but "
99 "the deck does not contain the FOAM keyword");
100 }
101 else if (!enableFoam && eclState.runspec().phases().active(Phase::FOAM)) {
102 throw std::runtime_error("Foam treatment disabled at compile time, but the deck "
103 "contains the FOAM keyword");
104 }
105
106 if (!eclState.runspec().phases().active(Phase::FOAM)) {
107 return; // foam treatment is supposed to be disabled
108 }
109
110 params_.transport_phase_ = eclState.getInitConfig().getFoamConfig().getTransportPhase();
111
112 if (eclState.getInitConfig().getFoamConfig().getMobilityModel() != FoamConfig::MobilityModel::TAB) {
113 throw std::runtime_error("In FOAMOPTS, only TAB is allowed for the gas mobility factor reduction model.");
114 }
115
116 const auto& tableManager = eclState.getTableManager();
117 const unsigned int numSatRegions = tableManager.getTabdims().getNumSatTables();
118 params_.setNumSatRegions(numSatRegions);
119 const unsigned int numPvtRegions = tableManager.getTabdims().getNumPVTTables();
120 params_.gasMobilityMultiplierTable_.resize(numPvtRegions);
121
122 // Get and check FOAMROCK data.
123 const FoamConfig& foamConf = eclState.getInitConfig().getFoamConfig();
124 if (numSatRegions != foamConf.size()) {
125 throw std::runtime_error("Inconsistent sizes, number of saturation regions differ from the number of elements "
126 "in FoamConfig, which typically corresponds to the number of records in FOAMROCK.");
127 }
128
129 // Get and check FOAMADS data.
130 const auto& foamadsTables = tableManager.getFoamadsTables();
131 if (foamadsTables.empty()) {
132 throw std::runtime_error("FOAMADS must be specified in FOAM runs");
133 }
134 if (numSatRegions != foamadsTables.size()) {
135 throw std::runtime_error("Inconsistent sizes, number of saturation regions differ from the "
136 "number of FOAMADS tables.");
137 }
138
139 // Set data that vary with saturation region.
140 for (std::size_t satReg = 0; satReg < numSatRegions; ++satReg) {
141 const auto& rec = foamConf.getRecord(satReg);
142 params_.foamCoefficients_[satReg] = typename BlackOilFoamParams<Scalar>::FoamCoefficients();
143 params_.foamCoefficients_[satReg].fm_min = rec.minimumSurfactantConcentration();
144 params_.foamCoefficients_[satReg].fm_surf = rec.referenceSurfactantConcentration();
145 params_.foamCoefficients_[satReg].ep_surf = rec.exponent();
146 params_.foamRockDensity_[satReg] = rec.rockDensity();
147 params_.foamAllowDesorption_[satReg] = rec.allowDesorption();
148 const auto& foamadsTable = foamadsTables.template getTable<FoamadsTable>(satReg);
149 const auto& conc = foamadsTable.getFoamConcentrationColumn();
150 const auto& ads = foamadsTable.getAdsorbedFoamColumn();
151 params_.adsorbedFoamTable_[satReg].setXYContainers(conc, ads);
152 }
153
154 // Get and check FOAMMOB data.
155 const auto& foammobTables = tableManager.getFoammobTables();
156 if (foammobTables.empty()) {
157 // When in the future adding support for the functional
158 // model, FOAMMOB will not be required anymore (functional
159 // family of keywords can be used instead, FOAMFSC etc.).
160 throw std::runtime_error("FOAMMOB must be specified in FOAM runs");
161 }
162 if (numPvtRegions != foammobTables.size()) {
163 throw std::runtime_error("Inconsistent sizes, number of PVT regions differ from the "
164 "number of FOAMMOB tables.");
165 }
166
167 // Set data that vary with PVT region.
168 for (std::size_t pvtReg = 0; pvtReg < numPvtRegions; ++pvtReg) {
169 const auto& foammobTable = foammobTables.template getTable<FoammobTable>(pvtReg);
170 const auto& conc = foammobTable.getFoamConcentrationColumn();
171 const auto& mobMult = foammobTable.getMobilityMultiplierColumn();
172 params_.gasMobilityMultiplierTable_[pvtReg].setXYContainers(conc, mobMult);
173 }
174 }
175#endif
176
180 static void registerParameters()
181 {
182 }
183
187 static void registerOutputModules(Model&,
188 Simulator&)
189 {
190 if constexpr (enableFoam) {
191 if (enableVtkOutput) {
192 OpmLog::warning("VTK output requested, currently unsupported by the foam module.");
193 }
194 }
195 //model.addOutputModule(new VtkBlackOilFoamModule<TypeTag>(simulator));
196 }
197
198 static bool primaryVarApplies(unsigned pvIdx)
199 {
200 if constexpr (enableFoam)
201 return pvIdx == foamConcentrationIdx;
202 else
203 return false;
204 }
205
206 static std::string primaryVarName([[maybe_unused]] unsigned pvIdx)
207 {
208 assert(primaryVarApplies(pvIdx));
209 return "foam_concentration";
210 }
211
212 static Scalar primaryVarWeight([[maybe_unused]] unsigned pvIdx)
213 {
214 assert(primaryVarApplies(pvIdx));
215
216 // TODO: it may be beneficial to chose this differently.
217 return static_cast<Scalar>(1.0);
218 }
219
220 static bool eqApplies(unsigned eqIdx)
221 {
222 if constexpr (enableFoam)
223 return eqIdx == contiFoamEqIdx;
224 else
225 return false;
226
227 }
228
229 static std::string eqName([[maybe_unused]] unsigned eqIdx)
230 {
231 assert(eqApplies(eqIdx));
232
233 return "conti^foam";
234 }
235
236 static Scalar eqWeight([[maybe_unused]] unsigned eqIdx)
237 {
238 assert(eqApplies(eqIdx));
239
240 // TODO: it may be beneficial to chose this differently.
241 return static_cast<Scalar>(1.0);
242 }
243
244 // must be called after water storage is computed
245 template <class LhsEval>
246 static void addStorage(Dune::FieldVector<LhsEval, numEq>& storage,
247 const IntensiveQuantities& intQuants)
248 {
249 if constexpr (enableFoam) {
250 const auto& fs = intQuants.fluidState();
251
252 LhsEval surfaceVolume = Toolbox::template decay<LhsEval>(intQuants.porosity());
253 if (params_.transport_phase_ == Phase::WATER) {
254 surfaceVolume *= (Toolbox::template decay<LhsEval>(fs.saturation(waterPhaseIdx))
255 * Toolbox::template decay<LhsEval>(fs.invB(waterPhaseIdx)));
256 } else if (params_.transport_phase_ == Phase::GAS) {
257 surfaceVolume *= (Toolbox::template decay<LhsEval>(fs.saturation(gasPhaseIdx))
258 * Toolbox::template decay<LhsEval>(fs.invB(gasPhaseIdx)));
259 } else if (params_.transport_phase_ == Phase::SOLVENT) {
260 if constexpr (enableSolvent) {
261 surfaceVolume *= (Toolbox::template decay<LhsEval>( intQuants.solventSaturation())
262 * Toolbox::template decay<LhsEval>(intQuants.solventInverseFormationVolumeFactor()));
263 }
264 } else {
265 throw std::runtime_error("Transport phase is GAS/WATER/SOLVENT");
266 }
267
268 // Avoid singular matrix if no gas is present.
269 surfaceVolume = max(surfaceVolume, 1e-10);
270
271 // Foam/surfactant in free phase.
272 const LhsEval freeFoam = surfaceVolume
273 * Toolbox::template decay<LhsEval>(intQuants.foamConcentration());
274
275 // Adsorbed foam/surfactant.
276 const LhsEval adsorbedFoam =
277 Toolbox::template decay<LhsEval>(1.0 - intQuants.porosity())
278 * Toolbox::template decay<LhsEval>(intQuants.foamRockDensity())
279 * Toolbox::template decay<LhsEval>(intQuants.foamAdsorbed());
280
281 LhsEval accumulationFoam = freeFoam + adsorbedFoam;
282 storage[contiFoamEqIdx] += accumulationFoam;
283 }
284 }
285
286 static void computeFlux([[maybe_unused]] RateVector& flux,
287 [[maybe_unused]] const ElementContext& elemCtx,
288 [[maybe_unused]] unsigned scvfIdx,
289 [[maybe_unused]] unsigned timeIdx)
290
291 {
292 if constexpr (enableFoam) {
293 const auto& extQuants = elemCtx.extensiveQuantities(scvfIdx, timeIdx);
294 const unsigned inIdx = extQuants.interiorIndex();
295
296 // The effect of the mobility reduction factor is
297 // incorporated in the mobility for the relevant phase,
298 // so fluxes do not need modification here.
299 switch (transportPhase()) {
300 case Phase::WATER: {
301 const unsigned upIdx = extQuants.upstreamIndex(waterPhaseIdx);
302 const auto& up = elemCtx.intensiveQuantities(upIdx, timeIdx);
303 if (upIdx == inIdx) {
304 flux[contiFoamEqIdx] =
305 extQuants.volumeFlux(waterPhaseIdx)
306 *up.fluidState().invB(waterPhaseIdx)
307 *up.foamConcentration();
308 } else {
309 flux[contiFoamEqIdx] =
310 extQuants.volumeFlux(waterPhaseIdx)
311 *decay<Scalar>(up.fluidState().invB(waterPhaseIdx))
312 *decay<Scalar>(up.foamConcentration());
313 }
314 break;
315 }
316 case Phase::GAS: {
317 const unsigned upIdx = extQuants.upstreamIndex(gasPhaseIdx);
318 const auto& up = elemCtx.intensiveQuantities(upIdx, timeIdx);
319 if (upIdx == inIdx) {
320 flux[contiFoamEqIdx] =
321 extQuants.volumeFlux(gasPhaseIdx)
322 *up.fluidState().invB(gasPhaseIdx)
323 *up.foamConcentration();
324 } else {
325 flux[contiFoamEqIdx] =
326 extQuants.volumeFlux(gasPhaseIdx)
327 *decay<Scalar>(up.fluidState().invB(gasPhaseIdx))
328 *decay<Scalar>(up.foamConcentration());
329 }
330 break;
331 }
332 case Phase::SOLVENT: {
333 if constexpr (enableSolvent) {
334 const unsigned upIdx = extQuants.solventUpstreamIndex();
335 const auto& up = elemCtx.intensiveQuantities(upIdx, timeIdx);
336 if (upIdx == inIdx) {
337 flux[contiFoamEqIdx] =
338 extQuants.solventVolumeFlux()
339 *up.solventInverseFormationVolumeFactor()
340 *up.foamConcentration();
341 } else {
342 flux[contiFoamEqIdx] =
343 extQuants.solventVolumeFlux()
344 *decay<Scalar>(up.solventInverseFormationVolumeFactor())
345 *decay<Scalar>(up.foamConcentration());
346 }
347 } else {
348 throw std::runtime_error("Foam transport phase is SOLVENT but SOLVENT is not activated.");
349 }
350 break;
351 }
352 default: {
353 throw std::runtime_error("Foam transport phase must be GAS/WATER/SOLVENT.");
354 }
355 }
356 }
357 }
358
362 static Scalar computeUpdateError(const PrimaryVariables&,
363 const EqVector&)
364 {
365 // do not consider the change of foam primary variables for convergence
366 // TODO: maybe this should be changed
367 return static_cast<Scalar>(0.0);
368 }
369
370 template <class DofEntity>
371 static void serializeEntity([[maybe_unused]] const Model& model,
372 [[maybe_unused]] std::ostream& outstream,
373 [[maybe_unused]] const DofEntity& dof)
374 {
375 if constexpr (enableFoam) {
376 unsigned dofIdx = model.dofMapper().index(dof);
377 const PrimaryVariables& priVars = model.solution(/*timeIdx=*/0)[dofIdx];
378 outstream << priVars[foamConcentrationIdx];
379 }
380 }
381
382 template <class DofEntity>
383 static void deserializeEntity([[maybe_unused]] Model& model,
384 [[maybe_unused]] std::istream& instream,
385 [[maybe_unused]] const DofEntity& dof)
386 {
387 if constexpr (enableFoam) {
388 unsigned dofIdx = model.dofMapper().index(dof);
389 PrimaryVariables& priVars0 = model.solution(/*timeIdx=*/0)[dofIdx];
390 PrimaryVariables& priVars1 = model.solution(/*timeIdx=*/1)[dofIdx];
391
392 instream >> priVars0[foamConcentrationIdx];
393
394 // set the primary variables for the beginning of the current time step.
395 priVars1[foamConcentrationIdx] = priVars0[foamConcentrationIdx];
396 }
397 }
398
399 static const Scalar foamRockDensity(const ElementContext& elemCtx,
400 unsigned scvIdx,
401 unsigned timeIdx)
402 {
403 unsigned satnumRegionIdx = elemCtx.problem().satnumRegionIndex(elemCtx, scvIdx, timeIdx);
404 return params_.foamRockDensity_[satnumRegionIdx];
405 }
406
407 static bool foamAllowDesorption(const ElementContext& elemCtx,
408 unsigned scvIdx,
409 unsigned timeIdx)
410 {
411 unsigned satnumRegionIdx = elemCtx.problem().satnumRegionIndex(elemCtx, scvIdx, timeIdx);
412 return params_.foamAllowDesorption_[satnumRegionIdx];
413 }
414
415 static const TabulatedFunction& adsorbedFoamTable(const ElementContext& elemCtx,
416 unsigned scvIdx,
417 unsigned timeIdx)
418 {
419 unsigned satnumRegionIdx = elemCtx.problem().satnumRegionIndex(elemCtx, scvIdx, timeIdx);
420 return params_.adsorbedFoamTable_[satnumRegionIdx];
421 }
422
423 static const TabulatedFunction& gasMobilityMultiplierTable(const ElementContext& elemCtx,
424 unsigned scvIdx,
425 unsigned timeIdx)
426 {
427 unsigned pvtnumRegionIdx = elemCtx.problem().pvtRegionIndex(elemCtx, scvIdx, timeIdx);
428 return params_.gasMobilityMultiplierTable_[pvtnumRegionIdx];
429 }
430
432 foamCoefficients(const ElementContext& elemCtx,
433 const unsigned scvIdx,
434 const unsigned timeIdx)
435 {
436 unsigned satnumRegionIdx = elemCtx.problem().satnumRegionIndex(elemCtx, scvIdx, timeIdx);
437 return params_.foamCoefficients_[satnumRegionIdx];
438 }
439
440 static Phase transportPhase() {
441 return params_.transport_phase_;
442 }
443
444private:
445 static BlackOilFoamParams<Scalar> params_;
446};
447
448template <class TypeTag, bool enableFoam>
449BlackOilFoamParams<typename BlackOilFoamModule<TypeTag, enableFoam>::Scalar>
450BlackOilFoamModule<TypeTag, enableFoam>::params_;
451
459template <class TypeTag, bool enableFoam = getPropValue<TypeTag, Properties::EnableFoam>()>
461{
463
471
473
474 enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
475 enum { enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>() };
476
477 static constexpr int foamConcentrationIdx = Indices::foamConcentrationIdx;
478 static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx;
479 static constexpr unsigned oilPhaseIdx = FluidSystem::oilPhaseIdx;
480 static constexpr int gasPhaseIdx = FluidSystem::gasPhaseIdx;
481
482public:
483
489 void foamPropertiesUpdate_(const ElementContext& elemCtx,
490 unsigned dofIdx,
491 unsigned timeIdx)
492 {
493 const PrimaryVariables& priVars = elemCtx.primaryVars(dofIdx, timeIdx);
494 foamConcentration_ = priVars.makeEvaluation(foamConcentrationIdx, timeIdx);
495 const auto& fs = asImp_().fluidState_;
496
497 // Compute gas mobility reduction factor
498 Evaluation mobilityReductionFactor = 1.0;
499 if (false) {
500 // The functional model is used.
501 // TODO: allow this model.
502 // In order to do this we must allow transport to be in the water phase, not just the gas phase.
503 const auto& foamCoefficients = FoamModule::foamCoefficients(elemCtx, dofIdx, timeIdx);
504
505 const Scalar fm_mob = foamCoefficients.fm_mob;
506
507 const Scalar fm_surf = foamCoefficients.fm_surf;
508 const Scalar ep_surf = foamCoefficients.ep_surf;
509
510 const Scalar fm_oil = foamCoefficients.fm_oil;
511 const Scalar fl_oil = foamCoefficients.fl_oil;
512 const Scalar ep_oil = foamCoefficients.ep_oil;
513
514 const Scalar fm_dry = foamCoefficients.fm_dry;
515 const Scalar ep_dry = foamCoefficients.ep_dry;
516
517 const Scalar fm_cap = foamCoefficients.fm_cap;
518 const Scalar ep_cap = foamCoefficients.ep_cap;
519
520 const Evaluation C_surf = foamConcentration_;
521 const Evaluation Ca = 1e10; // TODO: replace with proper capillary number.
522 const Evaluation S_o = fs.saturation(oilPhaseIdx);
523 const Evaluation S_w = fs.saturation(waterPhaseIdx);
524
525 Evaluation F1 = pow(C_surf/fm_surf, ep_surf);
526 Evaluation F2 = pow((fm_oil-S_o)/(fm_oil-fl_oil), ep_oil);
527 Evaluation F3 = pow(fm_cap/Ca, ep_cap);
528 Evaluation F7 = 0.5 + atan(ep_dry*(S_w-fm_dry))/M_PI;
529
530 mobilityReductionFactor = 1./(1. + fm_mob*F1*F2*F3*F7);
531 } else {
532 // The tabular model is used.
533 // Note that the current implementation only includes the effect of foam concentration (FOAMMOB),
534 // and not the optional pressure dependence (FOAMMOBP) or shear dependence (FOAMMOBS).
535 const auto& gasMobilityMultiplier = FoamModule::gasMobilityMultiplierTable(elemCtx, dofIdx, timeIdx);
536 mobilityReductionFactor = gasMobilityMultiplier.eval(foamConcentration_, /* extrapolate = */ true);
537 }
538
539 // adjust mobility
540 switch (FoamModule::transportPhase()) {
541 case Phase::WATER: {
542 asImp_().mobility_[waterPhaseIdx] *= mobilityReductionFactor;
543 break;
544 }
545 case Phase::GAS: {
546 asImp_().mobility_[gasPhaseIdx] *= mobilityReductionFactor;
547 break;
548 }
549 case Phase::SOLVENT: {
550 if constexpr (enableSolvent) {
551 asImp_().solventMobility_ *= mobilityReductionFactor;
552 } else {
553 throw std::runtime_error("Foam transport phase is SOLVENT but SOLVENT is not activated.");
554 }
555 break;
556 }
557 default: {
558 throw std::runtime_error("Foam transport phase must be GAS/WATER/SOLVENT.");
559 }
560 }
561
562 foamRockDensity_ = FoamModule::foamRockDensity(elemCtx, dofIdx, timeIdx);
563
564 const auto& adsorbedFoamTable = FoamModule::adsorbedFoamTable(elemCtx, dofIdx, timeIdx);
565 foamAdsorbed_ = adsorbedFoamTable.eval(foamConcentration_, /*extrapolate=*/true);
566 if (!FoamModule::foamAllowDesorption(elemCtx, dofIdx, timeIdx)) {
567 throw std::runtime_error("Foam module does not support the 'no desorption' option.");
568 }
569 }
570
571 const Evaluation& foamConcentration() const
572 { return foamConcentration_; }
573
574 Scalar foamRockDensity() const
575 { return foamRockDensity_; }
576
577 const Evaluation& foamAdsorbed() const
578 { return foamAdsorbed_; }
579
580protected:
581 Implementation& asImp_()
582 { return *static_cast<Implementation*>(this); }
583
586 Evaluation foamAdsorbed_;
587};
588
589template <class TypeTag>
591{
595
596public:
597 void foamPropertiesUpdate_(const ElementContext&,
598 unsigned,
599 unsigned)
600 { }
601
602
603 const Evaluation& foamConcentration() const
604 { throw std::runtime_error("foamConcentration() called but foam is disabled"); }
605
606 Scalar foamRockDensity() const
607 { throw std::runtime_error("foamRockDensity() called but foam is disabled"); }
608
609 Scalar foamAdsorbed() const
610 { throw std::runtime_error("foamAdsorbed() called but foam is disabled"); }
611};
612
613} // namespace Opm
614
615#endif
Contains the parameters to extend the black-oil model to include the effects of foam.
Declares the properties required by the black oil model.
Scalar foamRockDensity() const
Definition: blackoilfoammodules.hh:606
const Evaluation & foamConcentration() const
Definition: blackoilfoammodules.hh:603
void foamPropertiesUpdate_(const ElementContext &, unsigned, unsigned)
Definition: blackoilfoammodules.hh:597
Scalar foamAdsorbed() const
Definition: blackoilfoammodules.hh:609
Provides the volumetric quantities required for the equations needed by the polymers extension of the...
Definition: blackoilfoammodules.hh:461
const Evaluation & foamConcentration() const
Definition: blackoilfoammodules.hh:571
Implementation & asImp_()
Definition: blackoilfoammodules.hh:581
Scalar foamRockDensity_
Definition: blackoilfoammodules.hh:585
const Evaluation & foamAdsorbed() const
Definition: blackoilfoammodules.hh:577
Evaluation foamAdsorbed_
Definition: blackoilfoammodules.hh:586
Evaluation foamConcentration_
Definition: blackoilfoammodules.hh:584
Scalar foamRockDensity() const
Definition: blackoilfoammodules.hh:574
void foamPropertiesUpdate_(const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx)
Update the intensive properties needed to handle polymers from the primary variables.
Definition: blackoilfoammodules.hh:489
Contains the high level supplements required to extend the black oil model to include the effects of ...
Definition: blackoilfoammodules.hh:57
static bool eqApplies(unsigned eqIdx)
Definition: blackoilfoammodules.hh:220
static void registerOutputModules(Model &, Simulator &)
Register all foam specific VTK and ECL output modules.
Definition: blackoilfoammodules.hh:187
static void registerParameters()
Register all run-time parameters for the black-oil foam module.
Definition: blackoilfoammodules.hh:180
static std::string primaryVarName(unsigned pvIdx)
Definition: blackoilfoammodules.hh:206
static Scalar eqWeight(unsigned eqIdx)
Definition: blackoilfoammodules.hh:236
static void deserializeEntity(Model &model, std::istream &instream, const DofEntity &dof)
Definition: blackoilfoammodules.hh:383
static std::string eqName(unsigned eqIdx)
Definition: blackoilfoammodules.hh:229
static bool primaryVarApplies(unsigned pvIdx)
Definition: blackoilfoammodules.hh:198
static void addStorage(Dune::FieldVector< LhsEval, numEq > &storage, const IntensiveQuantities &intQuants)
Definition: blackoilfoammodules.hh:246
static bool foamAllowDesorption(const ElementContext &elemCtx, unsigned scvIdx, unsigned timeIdx)
Definition: blackoilfoammodules.hh:407
static Scalar primaryVarWeight(unsigned pvIdx)
Definition: blackoilfoammodules.hh:212
static const BlackOilFoamParams< Scalar >::FoamCoefficients & foamCoefficients(const ElementContext &elemCtx, const unsigned scvIdx, const unsigned timeIdx)
Definition: blackoilfoammodules.hh:432
static void computeFlux(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
Definition: blackoilfoammodules.hh:286
static Scalar computeUpdateError(const PrimaryVariables &, const EqVector &)
Return how much a Newton-Raphson update is considered an error.
Definition: blackoilfoammodules.hh:362
static const Scalar foamRockDensity(const ElementContext &elemCtx, unsigned scvIdx, unsigned timeIdx)
Definition: blackoilfoammodules.hh:399
static void serializeEntity(const Model &model, std::ostream &outstream, const DofEntity &dof)
Definition: blackoilfoammodules.hh:371
static const TabulatedFunction & adsorbedFoamTable(const ElementContext &elemCtx, unsigned scvIdx, unsigned timeIdx)
Definition: blackoilfoammodules.hh:415
static Phase transportPhase()
Definition: blackoilfoammodules.hh:440
static const TabulatedFunction & gasMobilityMultiplierTable(const ElementContext &elemCtx, unsigned scvIdx, unsigned timeIdx)
Definition: blackoilfoammodules.hh:423
Definition: blackoilboundaryratevector.hh:37
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:242
Definition: blackoilfoamparams.hh:59
Struct holding the parameters for the BlackoilFoamModule class.
Definition: blackoilfoamparams.hh:40
Tabulated1DFunction< Scalar > TabulatedFunction
Definition: blackoilfoamparams.hh:41