28#ifndef EWOMS_RICHARDS_BOUNDARY_RATE_VECTOR_HH
29#define EWOMS_RICHARDS_BOUNDARY_RATE_VECTOR_HH
31#include <opm/material/common/MathToolbox.hpp>
32#include <opm/material/common/Valgrind.hpp>
47template <
class TypeTag>
48class RichardsBoundaryRateVector :
public GetPropType<TypeTag, Properties::RateVector>
58 enum { contiEqIdx = Indices::contiEqIdx };
61 using Toolbox = MathToolbox<Evaluation>;
64 RichardsBoundaryRateVector() =
default;
78 RichardsBoundaryRateVector& operator=(
const RichardsBoundaryRateVector& value) =
default;
83 template <
class Context,
class Flu
idState>
85 unsigned timeIdx,
const FluidState& fluidState)
87 ExtensiveQuantities extQuants;
88 extQuants.updateBoundary(context, bfIdx, timeIdx, fluidState);
89 const auto& insideIntQuants = context.intensiveQuantities(bfIdx, timeIdx);
90 const unsigned focusDofIdx = context.focusDofIndex();
91 const unsigned interiorDofIdx = context.interiorScvIndex(bfIdx, timeIdx);
96 (*this) = Evaluation(0.0);
98 const unsigned phaseIdx = liquidPhaseIdx;
100 if (fluidState.pressure(phaseIdx) > insideIntQuants.fluidState().pressure(phaseIdx)) {
101 if (focusDofIdx == interiorDofIdx) {
102 density = fluidState.density(phaseIdx);
105 density = getValue(fluidState.density(phaseIdx));
108 else if (focusDofIdx == interiorDofIdx) {
109 density = insideIntQuants.fluidState().density(phaseIdx);
112 density = getValue(insideIntQuants.fluidState().density(phaseIdx));
117 (*this)[contiEqIdx] += extQuants.volumeFlux(phaseIdx) * density;
120 for (
unsigned i = 0; i < numEq; ++i) {
121 Valgrind::CheckDefined((*
this)[i]);
123 Valgrind::CheckDefined(*
this);
130 template <
class Context,
class Flu
idState>
134 const FluidState& fluidState)
136 this->
setFreeFlow(context, bfIdx, timeIdx, fluidState);
139 std::ranges::for_each(*
this,
140 [](
auto& val) { val = Toolbox::min(0.0, val); });
146 template <
class Context,
class Flu
idState>
150 const FluidState& fluidState)
152 this->
setFreeFlow(context, bfIdx, timeIdx, fluidState);
155 std::ranges::for_each(*
this,
156 [](
auto& val) { val = Toolbox::max(0.0, val); });
163 { (*this) = Evaluation(0.0); }
RichardsBoundaryRateVector(const RichardsBoundaryRateVector &value)=default
void setFreeFlow(const Context &context, unsigned bfIdx, unsigned timeIdx, const FluidState &fluidState)
Specify a free-flow boundary.
Definition richardsboundaryratevector.hh:84
void setOutFlow(const Context &context, unsigned bfIdx, unsigned timeIdx, const FluidState &fluidState)
Specify an outflow boundary.
Definition richardsboundaryratevector.hh:147
void setNoFlow()
Specify a no-flow boundary for all conserved quantities.
Definition richardsboundaryratevector.hh:162
void setInFlow(const Context &context, unsigned bfIdx, unsigned timeIdx, const FluidState &fluidState)
Specify an inflow boundary.
Definition richardsboundaryratevector.hh:131
RichardsBoundaryRateVector(const Evaluation &value)
Definition richardsboundaryratevector.hh:69
Declare the properties used by the infrastructure code of the finite volume discretizations.
Defines the common properties required by the porous medium multi-phase models.
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:45
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
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
Contains the property declarations for the Richards model.