29#ifndef EWOMS_QUANTITY_CALLBACKS_HH
30#define EWOMS_QUANTITY_CALLBACKS_HH
34#include <opm/material/common/MathToolbox.hpp>
35#include <opm/material/common/Valgrind.hpp>
47template <
class TypeTag>
53 using IQFluidState =
decltype(std::declval<IntensiveQuantities>().fluidState());
54 using ResultRawType =
decltype(std::declval<IQFluidState>().temperature(0));
57 using ResultType = std::remove_const_t<std::remove_reference_t<ResultRawType>>;
58 using ResultValueType =
typename MathToolbox<ResultType>::ValueType;
72 {
return elemCtx_.intensiveQuantities(dofIdx, 0).fluidState().temperature(0); }
75 const ElementContext& elemCtx_;
83template <
class TypeTag>
89 using IQFluidState =
decltype(std::declval<IntensiveQuantities>().fluidState());
90 using ResultRawType =
decltype(std::declval<IQFluidState>().pressure(0));
93 using ResultType = std::remove_const_t<std::remove_reference_t<ResultRawType>>;
94 using ResultValueType =
typename MathToolbox<ResultType>::ValueType;
98 { Valgrind::SetUndefined(phaseIdx_); }
102 , phaseIdx_(
static_cast<unsigned short>(
phaseIdx))
110 { phaseIdx_ =
static_cast<unsigned short>(
phaseIdx); }
118 Valgrind::CheckDefined(phaseIdx_);
119 return elemCtx_.intensiveQuantities(dofIdx, 0).fluidState().pressure(phaseIdx_);
123 const ElementContext& elemCtx_;
124 unsigned short phaseIdx_;
132template <
class TypeTag,
class Flu
idState>
139 using IQRawFluidState =
decltype(std::declval<IntensiveQuantities>().fluidState());
140 using IQFluidState = std::remove_const_t<std::remove_reference_t<IQRawFluidState>>;
141 using IQScalar =
typename IQFluidState::Scalar;
145 using ResultType = IQScalar;
150 { Valgrind::SetUndefined(phaseIdx_); }
157 , phaseIdx_(
static_cast<unsigned short>(
phaseIdx))
165 { phaseIdx_ =
static_cast<unsigned short>(
phaseIdx); }
173 Valgrind::CheckDefined(phaseIdx_);
174 return elemCtx_.intensiveQuantities(dofIdx, 0).fluidState().pressure(phaseIdx_);
177 IQScalar boundaryValue()
const
179 Valgrind::CheckDefined(phaseIdx_);
180 return boundaryFs_.pressure(phaseIdx_);
184 const ElementContext& elemCtx_;
185 const FluidState& boundaryFs_;
186 unsigned short phaseIdx_;
194template <
class TypeTag>
200 using IQFluidState =
decltype(std::declval<IntensiveQuantities>().fluidState());
201 using ResultRawType =
decltype(std::declval<IQFluidState>().density(0));
204 using ResultType = std::remove_const_t<std::remove_reference_t<ResultRawType>>;
205 using ResultValueType =
typename MathToolbox<ResultType>::ValueType;
209 { Valgrind::SetUndefined(phaseIdx_); }
213 , phaseIdx_(
static_cast<unsigned short>(
phaseIdx))
221 { phaseIdx_ =
static_cast<unsigned short>(
phaseIdx); }
229 Valgrind::CheckDefined(phaseIdx_);
230 return elemCtx_.intensiveQuantities(dofIdx, 0).fluidState().density(phaseIdx_);
234 const ElementContext& elemCtx_;
235 unsigned short phaseIdx_;
243template <
class TypeTag>
249 using IQFluidState =
decltype(std::declval<IntensiveQuantities>().fluidState());
252 using ResultType =
decltype(std::declval<IQFluidState>().molarDensity(0));
253 using ResultValueType =
typename MathToolbox<ResultType>::ValueType;
257 { Valgrind::SetUndefined(phaseIdx_); }
261 , phaseIdx_(
static_cast<unsigned short>(
phaseIdx))
269 { phaseIdx_ =
static_cast<unsigned short>(
phaseIdx); }
277 Valgrind::CheckDefined(phaseIdx_);
278 return elemCtx_.intensiveQuantities(dofIdx, 0).fluidState().molarDensity(phaseIdx_);
282 const ElementContext& elemCtx_;
283 unsigned short phaseIdx_;
291template <
class TypeTag>
297 using IQFluidState =
decltype(std::declval<IntensiveQuantities>().fluidState());
298 using ResultRawType =
decltype(std::declval<IQFluidState>().viscosity(0));
301 using ResultType = std::remove_const_t<std::remove_reference_t<ResultRawType>>;
302 using ResultValueType =
typename MathToolbox<ResultType>::ValueType;
306 { Valgrind::SetUndefined(phaseIdx_); }
310 , phaseIdx_(
static_cast<unsigned short>(
phaseIdx))
318 { phaseIdx_ =
static_cast<unsigned short>(
phaseIdx); }
326 Valgrind::CheckDefined(phaseIdx_);
327 return elemCtx_.intensiveQuantities(dofIdx, 0).fluidState().viscosity(phaseIdx_);
331 const ElementContext& elemCtx_;
332 unsigned short phaseIdx_;
340template <
class TypeTag>
347 using ResultRawType =
decltype(IntensiveQuantities().velocityCenter());
349 enum { dim = GridView::dimensionworld };
352 using ResultType = std::remove_const_t<std::remove_reference_t<ResultRawType>>;
353 using ResultFieldType =
typename ResultType::field_type;
354 using ResultFieldValueType =
typename MathToolbox<ResultFieldType>::ValueType;
365 {
return elemCtx_.intensiveQuantities(dofIdx, 0).velocityCenter(); }
368 const ElementContext& elemCtx_;
376template <
class TypeTag>
382 using ResultRawType =
decltype(IntensiveQuantities().velocityCenter()[0]);
385 using ResultType = std::remove_const_t<std::remove_reference_t<ResultRawType>>;
386 using ResultValueType =
typename MathToolbox<ResultType>::ValueType;
390 { Valgrind::SetUndefined(dimIdx_); }
410 Valgrind::CheckDefined(dimIdx_);
411 return elemCtx_.intensiveQuantities(dofIdx, 0).velocityCenter()[dimIdx_];
415 const ElementContext& elemCtx_;
424template <
class TypeTag>
430 using IQFluidState =
decltype(std::declval<IntensiveQuantities>().fluidState());
431 using ResultRawType =
decltype(std::declval<IQFluidState>().moleFraction(0, 0));
434 using ResultType = std::remove_const_t<std::remove_reference_t<ResultRawType>>;
435 using ResultValueType =
typename MathToolbox<ResultType>::ValueType;
440 Valgrind::SetUndefined(phaseIdx_);
441 Valgrind::SetUndefined(compIdx_);
446 , phaseIdx_(
static_cast<unsigned short>(
phaseIdx))
447 , compIdx_(
static_cast<unsigned short>(
compIdx))
455 { phaseIdx_ =
static_cast<unsigned short>(
phaseIdx); }
462 { compIdx_ =
static_cast<unsigned short>(
compIdx); }
470 Valgrind::CheckDefined(phaseIdx_);
471 Valgrind::CheckDefined(compIdx_);
472 return elemCtx_.intensiveQuantities(dofIdx, 0).fluidState().moleFraction(phaseIdx_, compIdx_);
476 const ElementContext& elemCtx_;
477 unsigned short phaseIdx_;
478 unsigned short compIdx_;
Callback class for a phase pressure.
Definition quantitycallbacks.hh:134
void setPhaseIndex(unsigned phaseIdx)
Set the index of the fluid phase for which the pressure should be returned.
Definition quantitycallbacks.hh:164
ResultType operator()(unsigned dofIdx) const
Return the pressure of a phase given the index of a degree of freedom within an element context.
Definition quantitycallbacks.hh:171
Callback class for the density of a phase.
Definition quantitycallbacks.hh:196
void setPhaseIndex(unsigned phaseIdx)
Set the index of the fluid phase for which the density should be returned.
Definition quantitycallbacks.hh:220
ResultType operator()(unsigned dofIdx) const
Return the density of a phase given the index of a degree of freedom within an element context.
Definition quantitycallbacks.hh:227
Callback class for the molar density of a phase.
Definition quantitycallbacks.hh:245
void setPhaseIndex(unsigned phaseIdx)
Set the index of the fluid phase for which the molar density should be returned.
Definition quantitycallbacks.hh:268
ResultType operator()(unsigned dofIdx) const
Return the molar density of a phase given the index of a degree of freedom within an element context.
Definition quantitycallbacks.hh:275
Callback class for a mole fraction of a component in a phase.
Definition quantitycallbacks.hh:426
void setComponentIndex(unsigned compIdx)
Set the index of the component for which the mole fraction should be returned.
Definition quantitycallbacks.hh:461
void setPhaseIndex(unsigned phaseIdx)
Set the index of the fluid phase for which a mole fraction should be returned.
Definition quantitycallbacks.hh:454
ResultType operator()(unsigned dofIdx) const
Return the mole fraction of a component in a phase given the index of a degree of freedom within an e...
Definition quantitycallbacks.hh:468
Callback class for a phase pressure.
Definition quantitycallbacks.hh:85
ResultType operator()(unsigned dofIdx) const
Return the pressure of the specified phase given the index of a degree of freedom within an element c...
Definition quantitycallbacks.hh:116
void setPhaseIndex(unsigned phaseIdx)
Set the index of the fluid phase for which the pressure should be returned.
Definition quantitycallbacks.hh:109
Callback class for temperature.
Definition quantitycallbacks.hh:49
ResultType operator()(unsigned dofIdx) const
Return the temperature given the index of a degree of freedom within an element context.
Definition quantitycallbacks.hh:71
Callback class for the velocity of a phase at the center of a DOF.
Definition quantitycallbacks.hh:342
ResultType operator()(unsigned dofIdx) const
Return the velocity of a phase given the index of a degree of freedom within an element context.
Definition quantitycallbacks.hh:364
Callback class for the velocity of a phase at the center of a DOF.
Definition quantitycallbacks.hh:378
void setDimIndex(unsigned dimIdx)
Set the index of the component of the velocity which should be returned.
Definition quantitycallbacks.hh:401
ResultType operator()(unsigned dofIdx) const
Return the velocity of a phase given the index of a degree of freedom within an element context.
Definition quantitycallbacks.hh:408
Callback class for the viscosity of a phase.
Definition quantitycallbacks.hh:293
ResultType operator()(unsigned dofIdx) const
Return the viscosity of a phase given the index of a degree of freedom within an element context.
Definition quantitycallbacks.hh:324
void setPhaseIndex(unsigned phaseIdx)
Set the index of the fluid phase for which the viscosity should be returned.
Definition quantitycallbacks.hh:317
Declare the properties used by the infrastructure code of the finite volume discretizations.
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
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