24#ifndef DUMUX_ELEMENTDATA2P2C_ADAPTIVE_HH
25#define DUMUX_ELEMENTDATA2P2C_ADAPTIVE_HH
27#include <dune/common/float_cmp.hh>
28#include <dune/grid/utility/persistentcontainer.hh>
43template<
class TypeTag>
49 using Grid =
typename GridView::Grid;
51 using FluidState =
typename GET_PROP_TYPE(TypeTag, FluidState);
55 dim = GridView::dimension
58 using Indices =
typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
62 wPhaseIdx = Indices::wPhaseIdx, nPhaseIdx = Indices::nPhaseIdx,
63 wCompIdx = Indices::wCompIdx, nCompIdx = Indices::nCompIdx
69 using Element =
typename GridView::Traits::template Codim<0>::Entity;
72 static constexpr int pressureType =
GET_PROP_VALUE(TypeTag, PressureFormulation);
73 int upwindError_[numPhases];
114 for (
int i = 0; i < numPhases;i++)
135 adaptedValues.
cellVolume = element.geometry().volume();
152 const Element& fatherElement)
159 Scalar fatherVolume = fatherElement.geometry().volume();
160 if(adaptedValuesFather.
count == 1 << dim)
165 adaptedValuesFather.
cellVolume = fatherVolume;
228 const Element& father,
const Element& son,
const Problem& problem)
241 Scalar gTimesHeight = problem.gravity()
242 * (son.geometry().center() - father.geometry().center());
244 problem.spatialParams().porosity(son);
249 if(pressureType == wPhaseIdx)
253 Scalar pc = adaptedValuesFather.
pressure_[nPhaseIdx] / adaptedValuesFather.
count
259 = pc + adaptedValues.
pressure_[wPhaseIdx];
266 - adaptedValuesFather.
pressure_[wPhaseIdx] / adaptedValuesFather.
count;
271 = adaptedValues.
pressure_[nPhaseIdx] - pc;
#define GET_PROP_VALUE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:282
#define GET_PROP_TYPE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:283
Storage container for discretized data for multi-physics models.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Property tag NumPhases
Number of phases in the system.
Definition: porousmediumflow/sequential/properties.hh:69
void volumeDerivativesAvailable(bool value)
Specifies if volume derivatives are computed and available.
Definition: 2p2c/sequential/celldata.hh:390
bool & wasRefined()
Indicates if current cell was refined at this time step.
Definition: 2p2c/sequential/celldata.hh:399
const Scalar massConcentration(int compIdx) const
Returns the total mass concentration of a component .
Definition: 2p2c/sequential/celldata.hh:156
void setMassConcentration(int compIdx, Scalar value)
Sets the total mass concentration of a component .
Definition: 2p2c/sequential/celldata.hh:173
Scalar & dv_dp()
Return the derivative of specific volume w.r.t. pressure For details, see description of FVPressureCo...
Definition: 2p2c/sequential/celldata.hh:253
FluxData & fluxData()
Acess to flux data, representing information living on the intersections.
Definition: 2p2c/sequential/celldata.hh:101
Scalar & dv(int compIdx)
Return the derivative of spec. volume w.r.t. change of mass For details, see description of FVPressur...
Definition: 2p2c/sequential/celldata.hh:269
Class including the data of a grid cell needed if an adaptive grid is used.
Definition: c/sequential/celldataadaptive.hh:45
CellData2P2CAdaptive()
Constructs an adaptive CellData object.
Definition: c/sequential/celldataadaptive.hh:112
void setAdaptionValues(AdaptedValues &adaptedValues, const Element &element)
Set adapted values in CellData This methods stores reconstructed values into the cellData object,...
Definition: c/sequential/celldataadaptive.hh:185
static void storeAdaptionValues(AdaptedValues &adaptedValues, AdaptedValues &adaptedValuesFather, const Element &fatherElement)
Adds cell information to father element for possible averaging / coarsening Sum up the adaptedValues ...
Definition: c/sequential/celldataadaptive.hh:150
void storeAdaptionValues(AdaptedValues &adaptedValues, const Element &element)
Stores leaf cell primary variables to transfer to new indexing Stores values to be adapted from the c...
Definition: c/sequential/celldataadaptive.hh:126
static void reconstructAdaptionValues(Dune::PersistentContainer< Grid, AdaptedValues > &adaptationMap, const Element &father, const Element &son, const Problem &problem)
Reconstructs sons entries from data of father cell Reconstructs an new solution from a father cell in...
Definition: c/sequential/celldataadaptive.hh:227
A container for all necessary variables to map an old solution to a new grid If the primary variables...
Definition: c/sequential/celldataadaptive.hh:88
FluxData2P2C< TypeTag > fluxData_
Information on old flux direction.
Definition: c/sequential/celldataadaptive.hh:94
Dune::FieldVector< Scalar, 2 > totalConcentration_
Transport primary variables.
Definition: c/sequential/celldataadaptive.hh:89
Dune::FieldVector< Scalar, 2 > pressure_
Definition: c/sequential/celldataadaptive.hh:90
Dune::FieldVector< Scalar, 3 > volumeDerivatives_
Storage for volume derivatives, as transport estimate on old pressure field is not correct after refi...
Definition: c/sequential/celldataadaptive.hh:92
int subdomain
subdomain
Definition: c/sequential/celldataadaptive.hh:95
int count
counts the number of cells averaged
Definition: c/sequential/celldataadaptive.hh:96
Scalar cellVolume
Cell volume for transformation of volume-specific primary variables.
Definition: c/sequential/celldataadaptive.hh:93
AdaptedValues()
Definition: c/sequential/celldataadaptive.hh:98
int isRefined
Indicates if cell is refined.
Definition: c/sequential/celldataadaptive.hh:97
Storage container for discretized data for multiphysics models.
Definition: celldatamultiphysics.hh:45
Scalar pressure(int phaseIdx)
DOC ME!
Definition: celldatamultiphysics.hh:79
void setPressure(int phaseIdx, Scalar value)
Modify the phase pressure.
Definition: celldatamultiphysics.hh:99
int & subdomain()
Return subdomain information.
Definition: celldatamultiphysics.hh:118
void setSubdomainAndFluidStateType(int index)
Specify subdomain information and fluidStateType.
Definition: celldatamultiphysics.hh:136
Class including the variables and data of discretized data of the constitutive relations.
Definition: 2p2c/sequential/fluxdata.hh:43
Storage container for discretized data of the constitutive relations for one element.