blackoilbioeffectsmodules.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 OPM_BLACK_OIL_BIOEFFECTS_MODULE_HH
29#define OPM_BLACK_OIL_BIOEFFECTS_MODULE_HH
30
31#include <dune/common/fvector.hh>
32
35
37
38#include <cmath>
39#include <memory>
40#include <numeric>
41#include <stdexcept>
42
43namespace Opm {
91template <class TypeTag, bool enableBioeffectsV = getPropValue<TypeTag, Properties::EnableBioeffects>()>
93{
105
106 using Toolbox = MathToolbox<Evaluation>;
107
108 using TabulatedFunction = typename BlackOilBioeffectsParams<Scalar>::TabulatedFunction;
109
110 enum { gasCompIdx = FluidSystem::gasCompIdx };
111
112 static constexpr unsigned microbialConcentrationIdx = Indices::microbialConcentrationIdx;
113 static constexpr unsigned oxygenConcentrationIdx = Indices::oxygenConcentrationIdx;
114 static constexpr unsigned ureaConcentrationIdx = Indices::ureaConcentrationIdx;
115 static constexpr unsigned biofilmVolumeFractionIdx = Indices::biofilmVolumeFractionIdx;
116 static constexpr unsigned calciteVolumeFractionIdx = Indices::calciteVolumeFractionIdx;
117 static constexpr unsigned contiMicrobialEqIdx = Indices::contiMicrobialEqIdx;
118 static constexpr unsigned contiOxygenEqIdx = Indices::contiOxygenEqIdx;
119 static constexpr unsigned contiUreaEqIdx = Indices::contiUreaEqIdx;
120 static constexpr unsigned contiBiofilmEqIdx = Indices::contiBiofilmEqIdx;
121 static constexpr unsigned contiCalciteEqIdx = Indices::contiCalciteEqIdx;
122 static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx;
123
124 static constexpr unsigned enableBioeffects = enableBioeffectsV;
125 static constexpr bool enableMICP = Indices::enableMICP;
126
127 static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
128
129public:
132 {
133 params_ = params;
134 }
135
139 static void registerParameters()
140 {
141 if constexpr (enableBioeffects)
143 }
144
148 static void registerOutputModules(Model& model,
149 Simulator& simulator)
150 {
151 if constexpr (enableBioeffects)
152 model.addOutputModule(std::make_unique<VtkBlackOilBioeffectsModule<TypeTag>>(simulator));
153 }
154
155 static bool eqApplies(unsigned eqIdx)
156 {
157 if constexpr (enableBioeffects)
158 if constexpr (enableMICP)
159 return eqIdx == contiMicrobialEqIdx || eqIdx == contiOxygenEqIdx || eqIdx == contiUreaEqIdx
160 || eqIdx == contiBiofilmEqIdx || eqIdx == contiCalciteEqIdx;
161 else
162 return eqIdx == contiMicrobialEqIdx || eqIdx == contiBiofilmEqIdx;
163 else
164 return false;
165 }
166
167 static Scalar eqWeight([[maybe_unused]] unsigned eqIdx)
168 {
169 assert(eqApplies(eqIdx));
170
171 // TODO: it may be beneficial to chose this differently.
172 return static_cast<Scalar>(1.0);
173 }
174
175 // must be called after water storage is computed
176 template <class LhsEval>
177 static void addStorage(Dune::FieldVector<LhsEval, numEq>& storage,
178 const IntensiveQuantities& intQuants)
179 {
180 if constexpr (enableBioeffects) {
181 const auto& fs = intQuants.fluidState();
182 LhsEval surfaceVolumeWater = Toolbox::template decay<LhsEval>(fs.saturation(waterPhaseIdx)) *
183 Toolbox::template decay<LhsEval>(fs.invB(waterPhaseIdx)) *
184 Toolbox::template decay<LhsEval>(intQuants.porosity());
185 // avoid singular matrix if no water is present
186 surfaceVolumeWater = max(surfaceVolumeWater, 1e-10);
187 // suspended microbes in water phase
188 const LhsEval accumulationMicrobes = surfaceVolumeWater * Toolbox::template decay<LhsEval>(intQuants.microbialConcentration());
189 storage[contiMicrobialEqIdx] += accumulationMicrobes;
190 // biofilm
191 const LhsEval accumulationBiofilm = Toolbox::template decay<LhsEval>(intQuants.biofilmVolumeFraction());
192 storage[contiBiofilmEqIdx] += accumulationBiofilm;
193 if constexpr (enableMICP) {
194 // oxygen in water phase
195 const LhsEval accumulationOxygen = surfaceVolumeWater * Toolbox::template decay<LhsEval>(intQuants.oxygenConcentration());
196 storage[contiOxygenEqIdx] += accumulationOxygen;
197 // urea in water phase (applying the scaling factor for the urea equation)
198 const LhsEval accumulationUrea = surfaceVolumeWater * Toolbox::template decay<LhsEval>(intQuants.ureaConcentration());
199 storage[contiUreaEqIdx] += accumulationUrea;
200 storage[contiUreaEqIdx] *= getPropValue<TypeTag, Properties::BlackOilUreaScalingFactor>();
201 // calcite
202 const LhsEval accumulationCalcite = Toolbox::template decay<LhsEval>(intQuants.calciteVolumeFraction());
203 storage[contiCalciteEqIdx] += accumulationCalcite;
204 }
205 }
206 }
207
208 template <class UpEval>
209 static void addBioeffectsFluxes_(RateVector& flux,
210 unsigned phaseIdx,
211 const Evaluation& volumeFlux,
212 const IntensiveQuantities& upFs)
213 {
214 if (phaseIdx == waterPhaseIdx) {
215 if constexpr (enableBioeffects) {
216 flux[contiMicrobialEqIdx] =
217 decay<UpEval>(upFs.microbialConcentration())
218 * decay<UpEval>(upFs.fluidState().invB(waterPhaseIdx))
219 * volumeFlux;
220 if constexpr (enableMICP) {
221 flux[contiOxygenEqIdx] =
222 decay<UpEval>(upFs.oxygenConcentration())
223 * decay<UpEval>(upFs.fluidState().invB(waterPhaseIdx))
224 * volumeFlux;
225 flux[contiUreaEqIdx] =
226 decay<UpEval>(upFs.ureaConcentration())
227 * decay<UpEval>(upFs.fluidState().invB(waterPhaseIdx))
228 * volumeFlux;
229 }
230 }
231 }
232 }
233
234 // since the urea concentration can be much larger than 1, then we apply a scaling factor
235 static void applyScaling(RateVector& flux)
236 {
237 if constexpr (enableMICP) {
238 flux[contiUreaEqIdx] *= getPropValue<TypeTag, Properties::BlackOilUreaScalingFactor>();
239 }
240 }
241
242 static void computeFlux([[maybe_unused]] RateVector& flux,
243 [[maybe_unused]] const ElementContext& elemCtx,
244 [[maybe_unused]] unsigned scvfIdx,
245 [[maybe_unused]] unsigned timeIdx)
246 {
247 if constexpr (enableBioeffects) {
248 const auto& extQuants = elemCtx.extensiveQuantities(scvfIdx, timeIdx);
249 unsigned focusIdx = elemCtx.focusDofIndex();
250 unsigned upIdx = extQuants.upstreamIndex(waterPhaseIdx);
251 flux[contiMicrobialEqIdx] = 0.0;
252 if constexpr (enableMICP) {
253 flux[contiOxygenEqIdx] = 0.0;
254 flux[contiUreaEqIdx] = 0.0;
255 }
256 if (upIdx == focusIdx)
257 addBioeffectsFluxes_<Evaluation>(flux, elemCtx, scvfIdx, timeIdx);
258 else
259 addBioeffectsFluxes_<Scalar>(flux, elemCtx, scvfIdx, timeIdx);
260 }
261 }
262
263 template <class UpstreamEval>
264 static void addBioeffectsFluxes_(RateVector& flux,
265 const ElementContext& elemCtx,
266 unsigned scvfIdx,
267 unsigned timeIdx)
268 {
269 const auto& extQuants = elemCtx.extensiveQuantities(scvfIdx, timeIdx);
270 unsigned upIdx = extQuants.upstreamIndex(waterPhaseIdx);
271 const auto& up = elemCtx.intensiveQuantities(upIdx, timeIdx);
272 const auto& volFlux = extQuants.volumeFlux(waterPhaseIdx);
273 addBioeffectsFluxes_<UpstreamEval>(flux, waterPhaseIdx, volFlux, up);
274 }
275
276 static void addSource(RateVector& source,
277 const Problem& problem,
278 const IntensiveQuantities& intQuants,
279 unsigned globalSpaceIdex)
280 {
281 if constexpr (enableBioeffects) {
282 const auto b = intQuants.fluidState().invB(waterPhaseIdx);
283 unsigned satnumIdx = problem.satnumRegionIndex(globalSpaceIdex);
284 Scalar rho_b = densityBiofilm(satnumIdx);
285 Scalar k_d = microbialDeathRate(satnumIdx);
286 Scalar mu = maximumGrowthRate(satnumIdx);
287 Scalar k_n = halfVelocityGrowth(satnumIdx);
288 Scalar Y = yieldGrowthCoefficient(satnumIdx);
289 Scalar k_a = microbialAttachmentRate(satnumIdx);
290 Scalar k_str = detachmentRate(satnumIdx);
291 Scalar eta = detachmentExponent(satnumIdx);
292 const auto& velocityInf = problem.model().linearizer().getVelocityInfo();
293 auto velocityInfos = velocityInf[globalSpaceIdex];
294 Scalar normVelocityCell =
295 std::accumulate(velocityInfos.begin(), velocityInfos.end(), 0.0,
296 [](const auto acc, const auto& info)
297 { return max(acc, std::abs(info.velocity[waterPhaseIdx])); });
298 if constexpr (enableMICP) {
299 Scalar rho_c = densityCalcite(satnumIdx);
300 Scalar k_u = halfVelocityUrea(satnumIdx);
301 Scalar mu_u = maximumUreaUtilization(satnumIdx);
302 Scalar F = oxygenConsumptionFactor(satnumIdx);
303 Scalar Y_uc = yieldUreaToCalciteCoefficient(satnumIdx);
304
305 // compute Monod terms (the negative region is replaced by a straight line)
306 // Schäfer et al (1998) https://doi.org/10.1016/S0169-7722(97)00060-0
307 Evaluation k_g = mu * intQuants.oxygenConcentration() / (k_n + intQuants.oxygenConcentration());
308 Evaluation k_c = mu_u * intQuants.ureaConcentration() / (k_u + intQuants.ureaConcentration());
309 if (intQuants.oxygenConcentration() < 0) {
310 k_g = mu * intQuants.oxygenConcentration() / k_n;
311 }
312 if (intQuants.ureaConcentration() < 0) {
313 k_c = mu_u * intQuants.ureaConcentration() / k_u;
314 }
315
316 // compute the processes
317 // see https://doi.org/10.1016/j.ijggc.2021.103256 for the MICP processes in the model
318 source[Indices::contiMicrobialEqIdx] += intQuants.microbialConcentration() * intQuants.porosity() *
319 b * (Y * k_g - k_d - k_a) +
320 rho_b * intQuants.biofilmVolumeFraction() * k_str * pow(normVelocityCell / intQuants.porosity(), eta);
321
322 source[Indices::contiOxygenEqIdx] -= (intQuants.microbialConcentration() * intQuants.porosity() *
323 b + rho_b * intQuants.biofilmVolumeFraction()) * F * k_g;
324
325 source[Indices::contiUreaEqIdx] -= rho_b * intQuants.biofilmVolumeFraction() * k_c;
326
327 source[Indices::contiBiofilmEqIdx] += intQuants.biofilmVolumeFraction() * (Y * k_g - k_d -
328 k_str * pow(normVelocityCell / intQuants.porosity(), eta) - Y_uc * (rho_b / rho_c) *
329 intQuants.biofilmVolumeFraction() * k_c / (intQuants.porosity() +
330 intQuants.biofilmVolumeFraction())) + k_a * intQuants.microbialConcentration() *
331 intQuants.porosity() * b / rho_b;
332
333 source[Indices::contiCalciteEqIdx] += (rho_b / rho_c) * intQuants.biofilmVolumeFraction() * Y_uc * k_c;
334
335 // since the urea concentration can be much larger than 1, then we apply a scaling factor
336 source[Indices::contiUreaEqIdx] *= getPropValue<TypeTag, Properties::BlackOilUreaScalingFactor>();
337 }
338 else {
339 const Scalar normVelocityCellG =
340 std::accumulate(velocityInfos.begin(), velocityInfos.end(), 0.0,
341 [](const auto acc, const auto& info)
342 { return max(acc, std::abs(info.velocity[1])); });
343 normVelocityCell = max(normVelocityCellG, normVelocityCell);
344 // convert Rsw to concentration to use in source term
345 const auto& fs = intQuants.fluidState();
346 const auto& Sw = fs.saturation(waterPhaseIdx);
347 const auto& Rsw = fs.Rsw();
348 const auto& rhow = fs.density(waterPhaseIdx);
349 unsigned pvtRegionIndex = fs.pvtRegionIndex();
350
351 const auto& xG = RswToMassFraction(pvtRegionIndex, Rsw);
352
353 // get the porosity and and gas density for convenience
354 const Evaluation& poro = intQuants.porosity();
355 Scalar rho_gRef = FluidSystem::referenceDensity(FluidSystem::gasPhaseIdx, pvtRegionIndex);
356
357 // calculate biofilm growth rate
358 Evaluation k_g = mu * (xG * rhow * poro * Sw / (xG * rhow * poro * Sw + k_n));
359 if (xG < 0) {
360 k_g = mu * (xG * rhow * poro * Sw / k_n);
361 }
362
363 // compute source terms
364 // decay, detachment, and attachment rate of suspended microbes
365 source[contiMicrobialEqIdx] += Sw * intQuants.microbialConcentration() * intQuants.porosity() * b
366 * (- k_a - k_d)
367 + intQuants.biofilmVolumeFraction() * rho_b * k_str
368 * pow(normVelocityCell / intQuants.porosity(), eta);
369 // biofilm growth and decay rate
370 source[contiBiofilmEqIdx] += (k_g - k_d - k_str * pow(normVelocityCell / intQuants.porosity(), eta))
371 * intQuants.biofilmVolumeFraction()
372 + k_a * Sw * intQuants.microbialConcentration() * intQuants.porosity() * b / rho_b;
373
374 // biofilm consumption of dissolved gas is proportional to biofilm growth rate
375 unsigned activeGasCompIdx = FluidSystem::canonicalToActiveCompIdx(gasCompIdx);
376 source[activeGasCompIdx] -= intQuants.biofilmVolumeFraction() * rho_b * k_g / (Y * rho_gRef);
377 }
378 }
379 }
380
381 static void addSource([[maybe_unused]] RateVector& source,
382 [[maybe_unused]] const ElementContext& elemCtx,
383 [[maybe_unused]] unsigned dofIdx,
384 [[maybe_unused]] unsigned timeIdx)
385 {
386 if constexpr (enableMICP) {
387 const auto& problem = elemCtx.problem();
388 const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, timeIdx);
389 addSource(source, problem, intQuants, dofIdx);
390 }
391 }
392
393 static const Scalar densityBiofilm(unsigned satnumRegionIdx)
394 {
395 return params_.densityBiofilm_[satnumRegionIdx];
396 }
397
398 static const Scalar densityCalcite(unsigned satnumRegionIdx)
399 {
400 return params_.densityCalcite_[satnumRegionIdx];
401 }
402
403 static const Scalar detachmentRate(unsigned satnumRegionIdx)
404 {
405 return params_.detachmentRate_[satnumRegionIdx];
406 }
407
408 static const Scalar detachmentExponent(unsigned satnumRegionIdx)
409 {
410 return params_.detachmentExponent_[satnumRegionIdx];
411 }
412
413 static const Scalar halfVelocityGrowth(unsigned satnumRegionIdx)
414 {
415 return params_.halfVelocityGrowth_[satnumRegionIdx];
416 }
417
418 static const Scalar halfVelocityUrea(unsigned satnumRegionIdx)
419 {
420 return params_.halfVelocityUrea_[satnumRegionIdx];
421 }
422
423 static const Scalar maximumGrowthRate(unsigned satnumRegionIdx)
424 {
425 return params_.maximumGrowthRate_[satnumRegionIdx];
426 }
427
428 static const Scalar maximumUreaUtilization(unsigned satnumRegionIdx)
429 {
430 return params_.maximumUreaUtilization_[satnumRegionIdx];
431 }
432
433 static const Scalar microbialAttachmentRate(unsigned satnumRegionIdx)
434 {
435 return params_.microbialAttachmentRate_[satnumRegionIdx];
436 }
437
438 static const Scalar microbialDeathRate(unsigned satnumRegionIdx)
439 {
440 return params_.microbialDeathRate_[satnumRegionIdx];
441 }
442
443 static const Scalar oxygenConsumptionFactor(unsigned satnumRegionIdx)
444 {
445 return params_.oxygenConsumptionFactor_[satnumRegionIdx];
446 }
447
448 static const Scalar yieldGrowthCoefficient(unsigned satnumRegionIdx)
449 {
450 return params_.yieldGrowthCoefficient_[satnumRegionIdx];
451 }
452
453 static const Scalar yieldUreaToCalciteCoefficient(unsigned satnumRegionIdx)
454 {
455 return params_.yieldUreaToCalciteCoefficient_[satnumRegionIdx];
456 }
457
458 static const Scalar bioDiffCoefficient(unsigned pvtRegionIdx, unsigned compIdx)
459 {
460 return params_.bioDiffCoefficient_[pvtRegionIdx][compIdx];
461 }
462
463 static const TabulatedFunction& permfactTable(const ElementContext& elemCtx,
464 unsigned scvIdx,
465 unsigned timeIdx)
466 {
467 unsigned satnumRegionIdx = elemCtx.problem().satnumRegionIndex(elemCtx, scvIdx, timeIdx);
468 return params_.permfactTable_[satnumRegionIdx];
469 }
470
471 static const TabulatedFunction& permfactTable(unsigned satnumRegionIdx)
472 {
473 return params_.permfactTable_[satnumRegionIdx];
474 }
475
476 static const TabulatedFunction& pcfactTable(unsigned satnumRegionIdx)
477 {
478 return params_.pcfactTable_[satnumRegionIdx];
479 }
480
481 static bool hasPcfactTables()
482 {
483 if constexpr (enableBioeffects && !enableMICP) {
484 return !params_.pcfactTable_.empty();
485 }
486 else {
487 return false;
488 }
489 }
490
491private:
493
494 static Evaluation RswToMassFraction(unsigned regionIdx, const Evaluation& Rsw) {
495 Scalar rho_wRef = FluidSystem::referenceDensity(FluidSystem::waterPhaseIdx, regionIdx);
496 Scalar rho_gRef = FluidSystem::referenceDensity(FluidSystem::gasPhaseIdx, regionIdx);
497
498 const Evaluation rho_oG = Rsw * rho_gRef;
499
500 return rho_oG / (rho_wRef + rho_oG);
501 }
502};
503
504
505template <class TypeTag, bool enableBioeffectsV>
506BlackOilBioeffectsParams<typename BlackOilBioeffectsModule<TypeTag, enableBioeffectsV>::Scalar>
507BlackOilBioeffectsModule<TypeTag, enableBioeffectsV>::params_;
508
516template <class TypeTag, bool enableBioeffectsV = getPropValue<TypeTag, Properties::EnableBioeffects>()>
518{
520
526
528
529 static constexpr int microbialConcentrationIdx = Indices::microbialConcentrationIdx;
530 static constexpr int oxygenConcentrationIdx = Indices::oxygenConcentrationIdx;
531 static constexpr int ureaConcentrationIdx = Indices::ureaConcentrationIdx;
532 static constexpr int biofilmVolumeFractionIdx = Indices::biofilmVolumeFractionIdx;
533 static constexpr int calciteVolumeFractionIdx = Indices::calciteVolumeFractionIdx;
534 static constexpr bool enableMICP = Indices::enableMICP;
535
536public:
537
543 void bioeffectsPropertiesUpdate_(const ElementContext& elemCtx,
544 unsigned dofIdx,
545 unsigned timeIdx)
546 {
547 const auto linearizationType = elemCtx.linearizationType();
548 const PrimaryVariables& priVars = elemCtx.primaryVars(dofIdx, timeIdx);
549 const Scalar referencePorosity_ = elemCtx.problem().referencePorosity(dofIdx, timeIdx);
550 unsigned satnumRegionIdx = elemCtx.problem().satnumRegionIndex(elemCtx, dofIdx, timeIdx);
551
552 microbialConcentration_ = priVars.makeEvaluation(microbialConcentrationIdx, timeIdx, linearizationType);
553 biofilmVolumeFraction_ = priVars.makeEvaluation(biofilmVolumeFractionIdx, timeIdx, linearizationType);
556 if constexpr (enableMICP) {
557 oxygenConcentration_ = priVars.makeEvaluation(oxygenConcentrationIdx, timeIdx, linearizationType);
558 ureaConcentration_ = priVars.makeEvaluation(ureaConcentrationIdx, timeIdx, linearizationType);
559 calciteVolumeFraction_ = priVars.makeEvaluation(calciteVolumeFractionIdx, timeIdx, linearizationType);
561 }
562 const Evaluation poroFact = min(1.0 - (biofilmVolumeFraction_ + calciteVolumeFraction_) /
563 (referencePorosity_), 1.0); //phi/phi_0
564
565 const auto& permfactTable = BioeffectsModule::permfactTable(satnumRegionIdx);
566 permFactor_ = permfactTable.eval(poroFact, /*extrapolation=*/true);
567 }
568
569 const Evaluation& microbialConcentration() const
570 { return microbialConcentration_; }
571
572 const Evaluation& oxygenConcentration() const
573 { return oxygenConcentration_; }
574
575 const Evaluation& ureaConcentration() const
576 { return ureaConcentration_; }
577
578 const Evaluation& biofilmVolumeFraction() const
579 { return biofilmVolumeFraction_; }
580
581 const Evaluation& calciteVolumeFraction() const
582 { return calciteVolumeFraction_; }
583
584 const Evaluation biofilmMass() const
585 { return biofilmMass_; }
586
587 const Evaluation calciteMass() const
588 { return calciteMass_; }
589
590 const Evaluation& permFactor() const
591 { return permFactor_; }
592
593protected:
599 Evaluation biofilmMass_;
600 Evaluation calciteMass_;
601 Evaluation permFactor_;
602 Evaluation pcFactor_;
603
604};
605
606template <class TypeTag>
608{
612
613public:
614 void bioeffectsPropertiesUpdate_(const ElementContext&,
615 unsigned,
616 unsigned)
617 {}
618
619 const Evaluation& microbialConcentration() const
620 { throw std::logic_error("microbialConcentration() called but MICP is disabled"); }
621
622 const Evaluation& oxygenConcentration() const
623 { throw std::logic_error("oxygenConcentration() called but MICP is disabled"); }
624
625 const Evaluation& ureaConcentration() const
626 { throw std::logic_error("ureaConcentration() called but MICP is disabled"); }
627
628 const Evaluation& biofilmVolumeFraction() const
629 { throw std::logic_error("biofilmVolumeFraction() called but biofilm/MICP is disabled"); }
630
631 const Evaluation& calciteVolumeFraction() const
632 { throw std::logic_error("calciteVolumeFraction() called but MICP is disabled"); }
633
634 const Evaluation& biofilmMass() const
635 { throw std::logic_error("biofilmMass() called but biofilm/MICP is disabled"); }
636
637 const Evaluation& calciteMass() const
638 { throw std::logic_error("calciteMass() called but MICP is disabled"); }
639
640 const Evaluation& permFactor() const
641 { throw std::logic_error("permFactor() called but biofilm/MICP is disabled"); }
642};
643
651template <class TypeTag, bool enableBioeffectsV = getPropValue<TypeTag, Properties::EnableBioeffects>()>
653{
654};
655
656template <class TypeTag>
658
659} // namespace Opm
660
661#endif
Contains the parameters required to extend the black-oil model by bioeffects.
Declares the properties required by the black oil model.
Provides the bioeffects specific extensive quantities to the generic black-oil module's extensive qua...
Definition: blackoilbioeffectsmodules.hh:653
const Evaluation & biofilmVolumeFraction() const
Definition: blackoilbioeffectsmodules.hh:628
const Evaluation & oxygenConcentration() const
Definition: blackoilbioeffectsmodules.hh:622
const Evaluation & ureaConcentration() const
Definition: blackoilbioeffectsmodules.hh:625
void bioeffectsPropertiesUpdate_(const ElementContext &, unsigned, unsigned)
Definition: blackoilbioeffectsmodules.hh:614
const Evaluation & microbialConcentration() const
Definition: blackoilbioeffectsmodules.hh:619
const Evaluation & calciteVolumeFraction() const
Definition: blackoilbioeffectsmodules.hh:631
const Evaluation & biofilmMass() const
Definition: blackoilbioeffectsmodules.hh:634
const Evaluation & permFactor() const
Definition: blackoilbioeffectsmodules.hh:640
const Evaluation & calciteMass() const
Definition: blackoilbioeffectsmodules.hh:637
Provides the volumetric quantities required for the equations needed by the bioeffects extension of t...
Definition: blackoilbioeffectsmodules.hh:518
Evaluation calciteMass_
Definition: blackoilbioeffectsmodules.hh:600
const Evaluation & ureaConcentration() const
Definition: blackoilbioeffectsmodules.hh:575
Evaluation microbialConcentration_
Definition: blackoilbioeffectsmodules.hh:594
const Evaluation & calciteVolumeFraction() const
Definition: blackoilbioeffectsmodules.hh:581
const Evaluation & oxygenConcentration() const
Definition: blackoilbioeffectsmodules.hh:572
const Evaluation & permFactor() const
Definition: blackoilbioeffectsmodules.hh:590
const Evaluation biofilmMass() const
Definition: blackoilbioeffectsmodules.hh:584
void bioeffectsPropertiesUpdate_(const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx)
Update the intensive properties needed to handle bioeffects from the primary variables.
Definition: blackoilbioeffectsmodules.hh:543
const Evaluation calciteMass() const
Definition: blackoilbioeffectsmodules.hh:587
Evaluation pcFactor_
Definition: blackoilbioeffectsmodules.hh:602
const Evaluation & biofilmVolumeFraction() const
Definition: blackoilbioeffectsmodules.hh:578
Evaluation calciteVolumeFraction_
Definition: blackoilbioeffectsmodules.hh:598
Evaluation biofilmMass_
Definition: blackoilbioeffectsmodules.hh:599
Evaluation biofilmVolumeFraction_
Definition: blackoilbioeffectsmodules.hh:597
Evaluation ureaConcentration_
Definition: blackoilbioeffectsmodules.hh:596
const Evaluation & microbialConcentration() const
Definition: blackoilbioeffectsmodules.hh:569
Evaluation permFactor_
Definition: blackoilbioeffectsmodules.hh:601
Evaluation oxygenConcentration_
Definition: blackoilbioeffectsmodules.hh:595
Contains the high level supplements required to extend the black oil model by bioeffects.
Definition: blackoilbioeffectsmodules.hh:93
static const Scalar microbialAttachmentRate(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:433
static void setParams(BlackOilBioeffectsParams< Scalar > &&params)
Set parameters.
Definition: blackoilbioeffectsmodules.hh:131
static const Scalar maximumGrowthRate(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:423
static void applyScaling(RateVector &flux)
Definition: blackoilbioeffectsmodules.hh:235
static const TabulatedFunction & permfactTable(const ElementContext &elemCtx, unsigned scvIdx, unsigned timeIdx)
Definition: blackoilbioeffectsmodules.hh:463
static bool hasPcfactTables()
Definition: blackoilbioeffectsmodules.hh:481
static const Scalar halfVelocityGrowth(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:413
static void addStorage(Dune::FieldVector< LhsEval, numEq > &storage, const IntensiveQuantities &intQuants)
Definition: blackoilbioeffectsmodules.hh:177
static const Scalar maximumUreaUtilization(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:428
static Scalar eqWeight(unsigned eqIdx)
Definition: blackoilbioeffectsmodules.hh:167
static void addBioeffectsFluxes_(RateVector &flux, unsigned phaseIdx, const Evaluation &volumeFlux, const IntensiveQuantities &upFs)
Definition: blackoilbioeffectsmodules.hh:209
static bool eqApplies(unsigned eqIdx)
Definition: blackoilbioeffectsmodules.hh:155
static const Scalar halfVelocityUrea(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:418
static const Scalar oxygenConsumptionFactor(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:443
static const Scalar densityBiofilm(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:393
static void addSource(RateVector &source, const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx)
Definition: blackoilbioeffectsmodules.hh:381
static const Scalar bioDiffCoefficient(unsigned pvtRegionIdx, unsigned compIdx)
Definition: blackoilbioeffectsmodules.hh:458
static const Scalar detachmentExponent(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:408
static void registerParameters()
Register all run-time parameters for the black-oil bioeffects module.
Definition: blackoilbioeffectsmodules.hh:139
static void addSource(RateVector &source, const Problem &problem, const IntensiveQuantities &intQuants, unsigned globalSpaceIdex)
Definition: blackoilbioeffectsmodules.hh:276
static void addBioeffectsFluxes_(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
Definition: blackoilbioeffectsmodules.hh:264
static const Scalar detachmentRate(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:403
static const TabulatedFunction & permfactTable(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:471
static const Scalar yieldGrowthCoefficient(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:448
static const Scalar yieldUreaToCalciteCoefficient(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:453
static void computeFlux(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
Definition: blackoilbioeffectsmodules.hh:242
static const Scalar densityCalcite(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:398
static const Scalar microbialDeathRate(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:438
static void registerOutputModules(Model &model, Simulator &simulator)
Register all bioeffects specific VTK and ECL output modules.
Definition: blackoilbioeffectsmodules.hh:148
static const TabulatedFunction & pcfactTable(unsigned satnumRegionIdx)
Definition: blackoilbioeffectsmodules.hh:476
VTK output module for the Bioeffect model's related quantities.
Definition: vtkblackoilbioeffectsmodule.hpp:53
Definition: blackoilbioeffectsmodules.hh:43
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:233
Struct holding the parameters for the BlackOilBioeffectsModule class.
Definition: blackoilbioeffectsparams.hpp:44
Tabulated1DFunction< Scalar > TabulatedFunction
Definition: blackoilbioeffectsparams.hpp:50