version 3.11-dev
Loading...
Searching...
No Matches
fieldstoragefine.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// SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12
13#ifndef DUMUX_TWOPVE_FINE_LEVEL_FIELDSTORAGE_HH
14#define DUMUX_TWOPVE_FINE_LEVEL_FIELDSTORAGE_HH
15
16#include <cstddef>
17#include <vector>
18
19#include <dune/grid/io/file/vtk/vtksequencewriter.hh>
20
22
23namespace Dumux {
24
33template<class GridGeometry, class Scalar, class FluidSystem>
35{
36private:
38 static constexpr int wettingPhaseIdx = FluidSystem::phase0Idx;
39 static constexpr int nonwettingPhaseIdx = FluidSystem::phase1Idx;
40 using GridView = typename GridGeometry::GridView;
41 using VTKSeqWriter = typename Dune::VTKSequenceWriter<GridView>;
42
43public:
44 std::vector<Scalar> saturationW;
45 std::vector<Scalar> saturationNw;
46 std::vector<Scalar> mobilityW;
47 std::vector<Scalar> mobilityNw;
48 std::vector<Scalar> pressureW;
49 std::vector<Scalar> pressureNw;
50 std::vector<Scalar> capillaryPressure;
51 std::vector<Scalar> permeability;
52 std::vector<Scalar> porosity;
53 std::vector<Scalar> densityW;
54 std::vector<Scalar> densityNw;
55 std::vector<Scalar> gasPlumeDistance;
56
57 explicit TwoPVEFineLevelFieldStorage(std::size_t size)
58 : saturationW(size),
59 saturationNw(size),
60 mobilityW(size),
61 mobilityNw(size),
62 pressureW(size),
63 pressureNw(size),
65 permeability(size),
66 porosity(size),
67 densityW(size),
68 densityNw(size),
70 {}
71
78 void set(std::size_t fineIdx,
79 const FineLevelElementState& fineElementState)
80 {
81 saturationW[fineIdx] = fineElementState.saturation(wettingPhaseIdx);
82 saturationNw[fineIdx] = fineElementState.saturation(nonwettingPhaseIdx);
83 mobilityW[fineIdx] = fineElementState.mobility(wettingPhaseIdx);
84 mobilityNw[fineIdx] = fineElementState.mobility(nonwettingPhaseIdx);
85 pressureW[fineIdx] = fineElementState.pressure(wettingPhaseIdx);
86 pressureNw[fineIdx] = fineElementState.pressure(nonwettingPhaseIdx);
87 capillaryPressure[fineIdx] = fineElementState.capillaryPressure();
88 permeability[fineIdx] = fineElementState.permeability();
89 porosity[fineIdx] = fineElementState.porosity();
90 densityW[fineIdx] = fineElementState.density(wettingPhaseIdx);
91 densityNw[fineIdx] = fineElementState.density(nonwettingPhaseIdx);
92 gasPlumeDistance[fineIdx] = fineElementState.gasPlumeDist();
93 }
94
100 void registerFields(VTKSeqWriter& vtkSequenceWriter) const
101 {
102 vtkSequenceWriter.addCellData(saturationW, "S_liq");
103 vtkSequenceWriter.addCellData(saturationNw, "S_gas");
104 vtkSequenceWriter.addCellData(mobilityW, "mob_liq");
105 vtkSequenceWriter.addCellData(mobilityNw, "mob_gas");
106 vtkSequenceWriter.addCellData(pressureW, "p_liq");
107 vtkSequenceWriter.addCellData(pressureNw, "p_gas");
108 vtkSequenceWriter.addCellData(capillaryPressure, "pc");
109 vtkSequenceWriter.addCellData(permeability, "permeability");
110 vtkSequenceWriter.addCellData(porosity, "porosity");
111 vtkSequenceWriter.addCellData(densityW, "rho_liq");
112 vtkSequenceWriter.addCellData(densityNw, "rho_gas");
113 vtkSequenceWriter.addCellData(gasPlumeDistance, "zp");
114 }
115};
116
117} // end namespace Dumux
118
119#endif
The quantities of a fine-level element reconstructed from the state of its coarse-level column.
Definition elementstatefine.hh:61
Scalar gasPlumeDist() const
Returns the gas plume distance within a coarse-level element.
Definition elementstatefine.hh:229
Scalar density(int phaseIdx) const
Returns the mass density of a given phase within the control volume in .
Definition elementstatefine.hh:191
Scalar permeability() const
Returns the permeability within the control volume in .
Definition elementstatefine.hh:206
Scalar capillaryPressure() const
Returns the capillary pressure within the control volume in .
Definition elementstatefine.hh:173
Scalar pressure(int phaseIdx) const
Returns the effective pressure of a given phase within the control volume in .
Definition elementstatefine.hh:157
Scalar saturation(int phaseIdx) const
Returns the saturation of a given phase within the control volume in .
Definition elementstatefine.hh:166
Scalar porosity() const
Returns the average porosity within the control volume in .
Definition elementstatefine.hh:212
Scalar mobility(int phaseIdx) const
Returns the effective mobility of a given phase within the control volume in .
Definition elementstatefine.hh:182
Mimics the volume variables structure of DuMux applied to the fine level of the VE scheme.
Definition adapt.hh:17
std::vector< Scalar > saturationW
Definition fieldstoragefine.hh:44
std::vector< Scalar > pressureW
Definition fieldstoragefine.hh:48
void set(std::size_t fineIdx, const FineLevelElementState &fineElementState)
Sets the fine-level fields to the provided fine-level element state.
Definition fieldstoragefine.hh:78
std::vector< Scalar > densityNw
Definition fieldstoragefine.hh:54
std::vector< Scalar > capillaryPressure
Definition fieldstoragefine.hh:50
std::vector< Scalar > mobilityNw
Definition fieldstoragefine.hh:47
std::vector< Scalar > mobilityW
Definition fieldstoragefine.hh:46
std::vector< Scalar > gasPlumeDistance
Definition fieldstoragefine.hh:55
std::vector< Scalar > porosity
Definition fieldstoragefine.hh:52
std::vector< Scalar > densityW
Definition fieldstoragefine.hh:53
TwoPVEFineLevelFieldStorage(std::size_t size)
Definition fieldstoragefine.hh:57
std::vector< Scalar > pressureNw
Definition fieldstoragefine.hh:49
std::vector< Scalar > saturationNw
Definition fieldstoragefine.hh:45
std::vector< Scalar > permeability
Definition fieldstoragefine.hh:51
void registerFields(VTKSeqWriter &vtkSequenceWriter) const
Registers fine-level fields to vtk writer, should be called when initializing the vtk writer.
Definition fieldstoragefine.hh:100