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