Commit 265edfb5 authored by Alexander Kissinger's avatar Alexander Kissinger
Browse files

The co2 and co2ni now work for box and cc. Additionally the folder co2ni

contains an interesting comparison between box and cc for an
unstructured grid after running the test for 1e9 s, compare cct1e9.vtu and boxt1e9.vtu.
Reviewed by Lena.



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@10048 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent c9d3f445
......@@ -395,8 +395,10 @@ file(COPY test/implicit/2p2c/test_box2p2c.input DESTINATION test/implicit/2p2c)
file(COPY test/implicit/2p2cni/test_box2p2cni.input DESTINATION test/implicit/2p2cni)
file(COPY test/implicit/3p3c/test_box3p3c.input DESTINATION test/implicit/3p3c)
file(COPY test/implicit/3p3cni/test_box3p3cni.input DESTINATION test/implicit/3p3cni)
file(COPY test/implicit/co2/test_co2.input DESTINATION test/implicit/co2)
file(COPY test/implicit/co2ni/test_co2ni.input DESTINATION test/implicit/co2ni)
file(COPY test/implicit/co2/test_ccco2.input DESTINATION test/implicit/co2)
file(COPY test/implicit/co2/test_boxco2.input DESTINATION test/implicit/co2)
file(COPY test/implicit/co2ni/test_ccco2ni.input DESTINATION test/implicit/co2ni)
file(COPY test/implicit/co2ni/test_boxco2ni.input DESTINATION test/implicit/co2ni)
file(COPY test/implicit/mpnc/test_boxmpnc.input DESTINATION test/implicit/mpnc)
file(COPY test/implicit/mpnc/test_forchheimer1p.input DESTINATION test/implicit/mpnc)
file(COPY test/implicit/mpnc/test_forchheimer2p.input DESTINATION test/implicit/mpnc)
......@@ -458,9 +460,11 @@ add_test(test_box3p3c bin/runTest.sh references/infiltrationbox-reference.vt
add_test(test_cc3p3c bin/runTest.sh references/infiltrationcc-reference.vtu infiltrationcc-00006.vtu test/implicit/3p3c/test_cc3p3c -Grid.File test/implicit/3p3c/grids/test_3p3c_coarse.dgf -TimeManager.TEnd 8.64e5 -TimeManager.DtInitial 8.64e4)
add_test(test_box3p3cni bin/runTest.sh references/column3p3cnibox-reference.vtu columnxylolbox-00060.vtu test/implicit/3p3cni/test_box3p3cni -Grid.File test/implicit/3p3cni/grids/column.dgf)
add_test(test_cc3p3cni bin/runTest.sh references/column3p3cnicc-reference.vtu columnxylolcc-00054.vtu test/implicit/3p3cni/test_cc3p3cni -Grid.File test/implicit/3p3cni/grids/column.dgf)
add_test(test_co2 bin/runTest.sh references/co2-reference.vtu heterogeneous-00020.vtu test/implicit/co2/test_co2 -Grid.File test/implicit/co2/grids/heterogeneousSmall.dgf)
add_test(test_ccco2 bin/runTest.sh references/co2cc-reference.vtu heterogeneouscc-00019.vtu test/implicit/co2/test_ccco2 -Grid.File test/implicit/co2/grids/heterogeneousSmall.dgf)
add_test(test_boxco2 bin/runTest.sh references/co2box-reference.vtu heterogeneousbox-00020.vtu test/implicit/co2/test_boxco2 -Grid.File test/implicit/co2/grids/heterogeneousSmall.dgf)
add_test(test_restart bin/runTest.sh references/co2-reference.vtu heterogeneous-00020.vtu test/implicit/co2/test_co2 -Grid.File test/implicit/co2/grids/heterogeneousSmall.dgf -Restart 42008.6 -TimeManager.DtInitial 23452.1)
add_test(test_co2ni bin/runTest.sh references/co2ni-reference.vtu heterogeneousni-00020.vtu test/implicit/co2ni/test_co2ni -Grid.File test/implicit/co2ni/grids/heterogeneousSmall.dgf)
add_test(test_ccco2ni bin/runTest.sh references/co2nicc-reference.vtu heterogeneousnicc-00019.vtu test/implicit/co2ni/test_ccco2ni -Grid.File test/implicit/co2ni/grids/heterogeneousSmall.dgf)
add_test(test_boxco2ni bin/runTest.sh references/co2nibox-reference.vtu heterogeneousnibox-00020.vtu test/implicit/co2ni/test_boxco2ni -Grid.File test/implicit/co2ni/grids/heterogeneousSmall.dgf)
add_test(test_boxmpnc bin/runTest.sh references/obstaclebox-reference.vtu obstaclebox-00010.vtu test/implicit/mpnc/test_boxmpnc -Grid.File test/implicit/mpnc/grids/obstacle_24x16.dgf -TimeManager.TEnd 1e4 -TimeManager.DtInitial 250)
add_test(test_ccmpnc bin/runTest.sh references/obstaclecc-reference.vtu obstaclecc-00010.vtu test/implicit/mpnc/test_ccmpnc -Grid.File test/implicit/mpnc/grids/obstacle_24x16.dgf -TimeManager.TEnd 1e4 -TimeManager.DtInitial 250)
add_test(test_forchheimer1p bin/runTest.sh references/forchheimer1p-reference.vtp test_forchheimer1p-00002.vtp test/implicit/mpnc/test_forchheimer1p -Grid.File test/implicit/mpnc/grids/forchheimer1d.dgf)
......
# build target for the CO2 test problem
add_executable("test_co2" test_co2.cc)
target_link_libraries("test_co2" ${DumuxLinkLibraries})
add_executable("test_boxco2" test_boxco2.cc)
target_link_libraries("test_boxco2" ${DumuxLinkLibraries})
add_executable("test_ccco2" test_ccco2.cc)
target_link_libraries("test_ccco2" ${DumuxLinkLibraries})
# add required libraries and includes to the build flags
link_directories(${DumuxLinkDirectories})
include_directories(${DumuxIncludeDirectories})
# make sure the grids are present in the build directory
add_custom_command(TARGET "test_co2"
add_custom_command(TARGET "test_boxco2"
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_directory
......
check_PROGRAMS = test_co2
check_PROGRAMS = test_boxco2 test_ccco2
noinst_HEADERS = *.hh
EXTRA_DIST = CMakeLists.txt *reference.vtu *.input grids/*.dgf co2values.inc
test_co2_SOURCES = test_co2.cc
test_boxco2_SOURCES = test_boxco2.cc
test_ccco2_SOURCES = test_ccco2.cc
include $(top_srcdir)/am/global-rules
......@@ -38,6 +38,7 @@
#include <dumux/implicit/common/implicitporousmediaproblem.hh>
#include <dumux/implicit/box/intersectiontovertexbc.hh>
#include "heterogeneousspatialparameters.hh"
#include "heterogeneousco2tables.hh"
......@@ -49,10 +50,13 @@ class HeterogeneousProblem;
namespace Properties
{
NEW_TYPE_TAG(HeterogeneousProblem, INHERITS_FROM(BoxTwoPTwoC, HeterogeneousSpatialParams));
NEW_TYPE_TAG(HeterogeneousProblem, INHERITS_FROM(TwoPTwoC, HeterogeneousSpatialParams));
NEW_TYPE_TAG(HeterogeneousBoxProblem, INHERITS_FROM(BoxModel, HeterogeneousProblem));
NEW_TYPE_TAG(HeterogeneousCCProblem, INHERITS_FROM(CCModel, HeterogeneousProblem));
//NEW_PROP_TAG(BaseProblem);
//SET_TYPE_PROP(HeterogeneousBoxProblem, BaseProblem, ImplicitPorousMediaProblem<TypeTag>);
//SET_TYPE_PROP(HeterogeneousCCProblem, BaseProblem, ImplicitPorousMediaProblem<TypeTag>);
//// Set the grid type
//SET_PROP(HeterogeneousProblem, Grid)
//{
......@@ -74,7 +78,7 @@ SET_TYPE_PROP(HeterogeneousProblem, Grid, Dune::YaspGrid<2>);
// Set the problem property
SET_PROP(HeterogeneousProblem, Problem)
{
typedef Dumux::HeterogeneousProblem<TTAG(HeterogeneousProblem)> type;
typedef Dumux::HeterogeneousProblem<TypeTag> type;
};
// Set fluid configuration
......@@ -120,11 +124,11 @@ SET_BOOL_PROP(HeterogeneousProblem, VtkAddVelocity, false);
* To run the simulation execute the following line in shell:
* <tt>./test_co2 </tt>
*/
template <class TypeTag = TTAG(HeterogeneousProblem)>
template <class TypeTag >
class HeterogeneousProblem : public ImplicitPorousMediaProblem<TypeTag>
{
typedef ImplicitPorousMediaProblem<TypeTag> ParentType;
typedef ImplicitPorousMediaProblem<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
typedef Dune::GridPtr<Grid> GridPointer;
......@@ -168,6 +172,8 @@ class HeterogeneousProblem : public ImplicitPorousMediaProblem<TypeTag>
typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(CO2Table)) CO2Table;
typedef Dumux::CO2<Scalar, CO2Table> CO2;
enum { isBox = GET_PROP_VALUE(TypeTag, ImplicitIsBox) };
enum { dofCodim = isBox ? dim : 0 };
public:
/*!
......@@ -253,52 +259,52 @@ public:
void addOutputVtkFields()
{
typedef Dune::BlockVector<Dune::FieldVector<double, 1> > ScalarField;
unsigned numVertices = this->gridView().size(dim);
//create required scalar fields
ScalarField *Kxx = this->resultWriter().allocateManagedBuffer(numVertices);
ScalarField *boxVolume = this->resultWriter().allocateManagedBuffer(numVertices);
(*boxVolume) = 0;
//Fill the scalar fields with values
unsigned numElements = this->gridView().size(0);
ScalarField *rank = this->resultWriter().allocateManagedBuffer(numElements);
FVElementGeometry fvElemGeom;
VolumeVariables volVars;
ElementIterator elemIt = this->gridView().template begin<0>();
ElementIterator elemEndIt = this->gridView().template end<0>();
for (; elemIt != elemEndIt; ++elemIt)
{
int idx = this->elementMapper().map(*elemIt);
(*rank)[idx] = this->gridView().comm().rank();
fvElemGeom.update(this->gridView(), *elemIt);
int numVerts = elemIt->template count<dim> ();
for (int i = 0; i < numVerts; ++i)
{
int globalIdx = this->vertexMapper().map(*elemIt, i, dim);
volVars.update(this->model().curSol()[globalIdx],
*this,
*elemIt,
fvElemGeom,
i,
false);
(*boxVolume)[globalIdx] += fvElemGeom.subContVol[i].volume;
Scalar perm = this->spatialParams().intrinsicPermeability(*elemIt, fvElemGeom, i);
(*Kxx)[globalIdx] = perm;
// (*Kzz)[globalIdx] = perm[dim-1][dim-1];
}
}
//pass the scalar fields to the vtkwriter
this->resultWriter().attachVertexData(*boxVolume, "boxVolume");
this->resultWriter().attachVertexData(*Kxx, "Kxx");
typedef Dune::BlockVector<Dune::FieldVector<double, 1> > ScalarField;
// get the number of degrees of freedom
unsigned numDofs = this->model().numDofs();
unsigned numElements = this->gridView().size(0);
//create required scalar fields
ScalarField *Kxx = this->resultWriter().allocateManagedBuffer(numElements);
ScalarField *cellPorosity = this->resultWriter().allocateManagedBuffer(numElements);
ScalarField *boxVolume = this->resultWriter().allocateManagedBuffer(numDofs);
(*boxVolume) = 0;
//Fill the scalar fields with values
ScalarField *rank = this->resultWriter().allocateManagedBuffer(numElements);
FVElementGeometry fvGeometry;
VolumeVariables volVars;
ElementIterator elemIt = this->gridView().template begin<0>();
ElementIterator elemEndIt = this->gridView().template end<0>();
for (; elemIt != elemEndIt; ++elemIt)
{
int idx = this->elementMapper().map(*elemIt);
(*rank)[idx] = this->gridView().comm().rank();
fvGeometry.update(this->gridView(), *elemIt);
for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx)
{
int globalIdx = this->model().dofMapper().map(*elemIt, scvIdx, dofCodim);
volVars.update(this->model().curSol()[globalIdx],
*this,
*elemIt,
fvGeometry,
scvIdx,
false);
(*boxVolume)[globalIdx] += fvGeometry.subContVol[scvIdx].volume;
}
(*Kxx)[idx] = this->spatialParams().intrinsicPermeability(*elemIt, fvGeometry, /*element data*/ 0);
(*cellPorosity)[idx] = this->spatialParams().porosity(*elemIt, fvGeometry, /*element data*/ 0);
}
//pass the scalar fields to the vtkwriter
this->resultWriter().attachDofData(*Kxx, "Kxx", false); //element data
this->resultWriter().attachDofData(*cellPorosity, "cellwisePorosity", false); //element data
this->resultWriter().attachDofData(*boxVolume, "boxVolume", isBox);
}
/*!
* \name Problem parameters
......@@ -394,6 +400,21 @@ public:
initial_(values, globalPos);
}
/*!
* \brief Evaluate the boundary conditions for a dirichlet
* boundary segment.
*
* \param values The dirichlet values for the primary variables
* \param is The intersection between element and boundary
*
* For this method, the \a values parameter stores primary variables.
*/
void dirichletAtPos(PrimaryVariables &values, const GlobalPosition &globalPos) const
{
initial_(values, globalPos);
}
/*!
* \brief Evaluate the boundary conditions for a neumann
* boundary segment.
......
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* Copyright (C) 2008-2012 by Andreas Lauser *
* Institute for Modelling Hydraulic and Environmental Systems *
* University of Stuttgart, Germany *
* email: <givenname>.<name>@iws.uni-stuttgart.de *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief Test for the CO2 box model.
*/
#include "config.h"
#include "heterogeneousproblem.hh"
#include <dumux/common/start.hh>
/*!
* \brief Provides an interface for customizing error messages associated with
* reading in parameters.
*
* \param progName The name of the program, that was tried to be started.
* \param errorMsg The error message that was issued by the start function.
* Comprises the thing that went wrong and a general help message.
*/
void usage(const char *progName, const std::string &errorMsg)
{
if (errorMsg.size() > 0) {
std::string errorMessageOut = "\nUsage: ";
errorMessageOut += progName;
errorMessageOut += " [options]\n";
errorMessageOut += errorMsg;
errorMessageOut += "\n\nThe List of Mandatory arguments for this program is:\n"
"\t-tEnd The end of the simulation. [s] \n"
"\t-dtInitial The initial timestep size. [s] \n"
"\t-gridFile The file name of the file containing the grid \n"
"\t definition in DGF format\n"
"\t-FluidSystem.nTemperature Number of tabularization entries [-] \n"
"\t-FluidSystem.nPressure Number of tabularization entries [-] \n"
"\t-FluidSystem.pressureLow Low end for tabularization of fluid properties [Pa] \n"
"\t-FluidSystem.pressureHigh High end for tabularization of fluid properties [Pa] \n"
"\t-FluidSystem.temperatureLow Low end for tabularization of fluid properties [Pa] \n"
"\t-FluidSystem.temperatureHigh High end for tabularization of fluid properties [Pa] \n"
"\t-SimulationControl.name The name of the output files [-] \n"
"\t-InitialConditions.temperature Initial temperature in the reservoir [K] \n"
"\t-InitialConditions.depthBOR Depth below ground surface [m] \n";
std::cout << errorMessageOut
<< "\n";
}
}
int main(int argc, char** argv)
{
#if HAVE_ALUGRID
typedef TTAG(HeterogeneousBoxProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
std::cout << "Test skipped, it needs ALUGrid." << std::endl;
return 77;
#endif
}
##########################################################################
# Parameter file for test_boxco2
# Everything behind a '#' is a comment
# Groups can be ordered e.g. : [BoundaryConditions]
# Parameters in groups have to be accessed hierarchically e.g.: FluidSystem.pressureLow
##########################################################################
####################################################################
# Mandatory arguments
####################################################################
[TimeManager]
DtInitial = 250# [s]
TEnd = 1e6# [s]
####################################################################
[Grid]
File = ./grids/heterogeneousSmall.dgf # relative path to the grid file
####################################################################
[FluidSystem]
NTemperature = 100 # [-] number of tabularization entries
NPressure = 100 # [-] number of tabularization entries
PressureLow = 1e5# [Pa] low end for tabularization of fluid properties
PressureHigh = 3e7# [Pa] high end for tabularization of fluid properties
TemperatureLow = 290.00 # [Pa] low end for tabularization of fluid properties
TemperatureHigh = 331.00 # [Pa] high end for tabularization of fluid properties
####################################################################
[Problem]
Name = heterogeneousbox # [-] the name of the output files
DepthBOR = 1200# [m] depth below ground surface
InjectionRate = 1e-4 # [kg/sq/s]
####################################################################
[LinearSolver]
ResidualReduction = 1e-10
# Simulation restart
#
# DuMux simulations can be restarted from *.drs files
# Set restart to the value of a specific file, e.g.: 'restart = 27184.1'
# for the restart file
# name_time = 27184.1_rank = 0.drs
# Please comment in the below value, if restart is desired.
####################################################################
# restart = ...
......@@ -67,7 +67,7 @@ void usage(const char *progName, const std::string &errorMsg)
int main(int argc, char** argv)
{
#if HAVE_ALUGRID
typedef TTAG(HeterogeneousProblem) ProblemTypeTag;
typedef TTAG(HeterogeneousCCProblem) ProblemTypeTag;
return Dumux::start<ProblemTypeTag>(argc, argv, usage);
#else
std::cout << "Test skipped, it needs ALUGrid." << std::endl;
......
##########################################################################
# Parameter file for test_2p2c
# Parameter file for test_ccco2
# Everything behind a '#' is a comment
# Groups can be ordered e.g. : [BoundaryConditions]
# Parameters in groups have to be accessed hierarchically e.g.: FluidSystem.pressureLow
......@@ -27,7 +27,7 @@ TemperatureHigh = 331.00 # [Pa] high end for tabularization of fluid propert
####################################################################
[Problem]
Name = heterogeneous # [-] the name of the output files
Name = heterogeneouscc # [-] the name of the output files
DepthBOR = 1200# [m] depth below ground surface
InjectionRate = 1e-4 # [kg/sq/s]
####################################################################
......
# build target for the CO2 non-isothermal test problem
add_executable("test_co2ni" test_co2ni.cc)
target_link_libraries("test_co2ni" ${DumuxLinkLibraries})
add_executable("test_boxco2ni" test_boxco2ni.cc)
target_link_libraries("test_boxco2ni" ${DumuxLinkLibraries})
add_executable("test_ccco2ni" test_ccco2ni.cc)
target_link_libraries("test_ccco2ni" ${DumuxLinkLibraries})
# add required libraries and includes to the build flags
link_directories(${DumuxLinkDirectories})
include_directories(${DumuxIncludeDirectories})
# make sure the grids are present in the build directory
add_custom_command(TARGET "test_co2ni"
add_custom_command(TARGET "test_boxco2ni"
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_directory
......
check_PROGRAMS = test_co2ni
check_PROGRAMS = test_boxco2ni test_ccco2ni
noinst_HEADERS = *.hh
EXTRA_DIST = CMakeLists.txt *reference.vtu *.input grids/*.dgf co2values.inc
test_co2ni_SOURCES = test_co2ni.cc
test_boxco2ni_SOURCES = test_boxco2ni.cc
test_ccco2ni_SOURCES = test_ccco2ni.cc
include $(top_srcdir)/am/global-rules
This diff is collapsed.
This diff is collapsed.
......@@ -51,8 +51,9 @@ class HeterogeneousProblem;
namespace Properties
{
NEW_TYPE_TAG(HeterogeneousProblem, INHERITS_FROM(BoxTwoPTwoCNI, HeterogeneousSpatialParams));
NEW_TYPE_TAG(HeterogeneousProblem, INHERITS_FROM(TwoPTwoCNI, HeterogeneousSpatialParams));
NEW_TYPE_TAG(HeterogeneousBoxProblem, INHERITS_FROM(BoxModel, HeterogeneousProblem));
NEW_TYPE_TAG(HeterogeneousCCProblem, INHERITS_FROM(CCModel, HeterogeneousProblem));
// Set the grid type
......@@ -65,7 +66,7 @@ SET_TYPE_PROP(HeterogeneousProblem, Grid, Dune::YaspGrid<2>);
// Set the problem property
SET_PROP(HeterogeneousProblem, Problem)
{
typedef Dumux::HeterogeneousProblem<TTAG(HeterogeneousProblem)> type;
typedef Dumux::HeterogeneousProblem<TypeTag> type;
};
// Set fluid configuration
......@@ -111,7 +112,7 @@ SET_BOOL_PROP(HeterogeneousProblem, VtkAddVelocity, false);
* To run the simulation execute the following line in shell:
* <tt>./test_co2 </tt>
*/
template <class TypeTag = TTAG(HeterogeneousProblem)>
template <class TypeTag >
class HeterogeneousProblem : public ImplicitPorousMediaProblem<TypeTag>
{
typedef ImplicitPorousMediaProblem<TypeTag> ParentType;
......@@ -164,6 +165,8 @@ class HeterogeneousProblem : public ImplicitPorousMediaProblem<TypeTag>
typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition;
typedef typename GET_PROP_TYPE(TypeTag, PTAG(CO2Table)) CO2Table;
typedef Dumux::CO2<Scalar, CO2Table> CO2;
enum { isBox = GET_PROP_VALUE(TypeTag, ImplicitIsBox) };
enum { dofCodim = isBox ? dim : 0 };
public:
/*!
......@@ -255,20 +258,24 @@ public:
void addOutputVtkFields()
{
typedef Dune::BlockVector<Dune::FieldVector<double, 1> > ScalarField;
unsigned numVertices = this->gridView().size(dim);
// get the number of degrees of freedom
unsigned numDofs = this->model().numDofs();
unsigned numElements = this->gridView().size(0);
//create required scalar fields
ScalarField *Kxx = this->resultWriter().allocateManagedBuffer(numVertices);
ScalarField *boxVolume = this->resultWriter().allocateManagedBuffer(numVertices);
ScalarField *enthalpyW = this->resultWriter().allocateManagedBuffer(numVertices);
ScalarField *enthalpyN = this->resultWriter().allocateManagedBuffer(numVertices);
ScalarField *Kxx = this->resultWriter().allocateManagedBuffer(numElements);
ScalarField *cellPorosity = this->resultWriter().allocateManagedBuffer(numElements);
ScalarField *boxVolume = this->resultWriter().allocateManagedBuffer(numDofs);
ScalarField *enthalpyW = this->resultWriter().allocateManagedBuffer(numDofs);
ScalarField *enthalpyN = this->resultWriter().allocateManagedBuffer(numDofs);
(*boxVolume) = 0;
//Fill the scalar fields with values
unsigned numElements = this->gridView().size(0);
ScalarField *rank = this->resultWriter().allocateManagedBuffer(numElements);
FVElementGeometry fvElemGeom;
FVElementGeometry fvGeometry;
VolumeVariables volVars;
ElementIterator elemIt = this->gridView().template begin<0>();
......@@ -277,32 +284,32 @@ public:
{
int idx = this->elementMapper().map(*elemIt);
(*rank)[idx] = this->gridView().comm().rank();
fvElemGeom.update(this->gridView(), *elemIt);
fvGeometry.update(this->gridView(), *elemIt);
int numVerts = elemIt->template count<dim> ();
for (int i = 0; i < numVerts; ++i)
for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx)
{
int globalIdx = this->vertexMapper().map(*elemIt, i, dim);
int globalIdx = this->model().dofMapper().map(*elemIt, scvIdx, dofCodim);
volVars.update(this->model().curSol()[globalIdx],
*this,
*elemIt,
fvElemGeom,
i,
fvGeometry,
scvIdx,
false);
(*boxVolume)[globalIdx] += fvElemGeom.subContVol[i].volume;
Scalar perm = this->spatialParams().intrinsicPermeability(*elemIt, fvElemGeom, i);
(*Kxx)[globalIdx] = perm;
(*boxVolume)[globalIdx] += fvGeometry.subContVol[scvIdx].volume;
(*enthalpyW)[globalIdx] = volVars.enthalpy(lPhaseIdx);
(*enthalpyN)[globalIdx] = volVars.enthalpy(gPhaseIdx);
}
(*Kxx)[idx] = this->spatialParams().intrinsicPermeability(*elemIt, fvGeometry, /*element data*/ 0);
(*cellPorosity)[idx] = this->spatialParams().porosity(*elemIt, fvGeometry, /*element data*/ 0);
}
//pass the scalar fields to the vtkwriter
this->resultWriter().attachVertexData(*boxVolume, "boxVolume");
this->resultWriter().attachVertexData(*Kxx, "Kxx");
this->resultWriter().attachVertexData(*enthalpyW, "enthalpyW");
this->resultWriter().attachVertexData(*enthalpyN, "enthalpyN");
this->resultWriter().attachDofData(*boxVolume, "boxVolume", isBox);
this->resultWriter().attachDofData(*Kxx, "Kxx", false); //element data
this->resultWriter().attachDofData(*cellPorosity, "cellwisePorosity", false); //element data
this->resultWriter().attachDofData(*enthalpyW, "enthalpyW", isBox);
this->resultWriter().attachDofData(*enthalpyN, "enthalpyN", isBox);
}
......@@ -314,18 +321,22 @@ public:
const std::string name() const
{ return name_; }
/*!
* \brief Returns the temperature within the domain.
*
* This problem assumes a temperature of 10 degrees Celsius.
*/
Scalar boxTemperature(const Element &element,
const FVElementGeometry &fvElemGeom,
int scvIdx) const
{
const GlobalPosition globalPos = fvElemGeom.subContVol[scvIdx].global;
return temperature_(globalPos);
};
}
// /*!
// * \brief Returns the temperature within the domain.
// * \param globalPos The global position
// */
// Scalar temperatureAtPos(const GlobalPosition globalPos) const
// {
// return temperature_(globalPos);
// };
void sourceAtPos(PrimaryVariables &values,
const GlobalPosition &globalPos) const
......@@ -393,6 +404,19 @@ public:
initial_(values, globalPos);
}
/*!
* \brief Evaluate the boundary conditions for a dirichlet
* boundary segment.
*
* \param values The dirichlet values for the primary variables
* \param globalPos The global position
*
* For this method, the \a values parameter stores primary variables.
*/
void dirichletAtPos(PrimaryVariables &values, const GlobalPosition &globalPos) const
{
initial_(values, globalPos);