3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Public Member Functions | List of all members
Dumux::TestTransportProblem< TypeTag > Class Template Reference

test problem for the explicit transport model More...

#include <test/porousmediumflow/2p/sequential/test_transportproblem.hh>

Inheritance diagram for Dumux::TestTransportProblem< TypeTag >:
Inheritance graph

Description

template<class TypeTag>
class Dumux::TestTransportProblem< TypeTag >

test problem for the explicit transport model

A unit "fluid" is injected from the left side into a rectangular 2D domain also this testing fluid. Upper and lower boundary are closed (Neumann = 0), and there is free outflow on the right side.

This test solely applies the 2p transport on a given velocity field, without a pressure field being solved.

To run the simulation execute the following line in shell: ./test_transport -parameterFile ./test_transport.input, where the arguments define the parameter file.

Public Member Functions

 TestTransportProblem (TimeManager &timeManager, Grid &grid)
 
void init ()
 set initial velocity field -> v_total is assumed to be constant in this test! More...
 
void boundaryTypes (BoundaryTypes &bcTypes, const Intersection &intersection) const
 Specifies which kind of boundary condition should be used for which equation on a given boundary segment. More...
 
void dirichlet (PrimaryVariables &values, const Intersection &intersection) const
 Evaluate the boundary conditions for a dirichlet control volume. More...
 
void neumann (PrimaryVariables &values, const Intersection &intersection) const
 Evaluate the boundary conditions for a neumann boundary segment. More...
 
void source (PrimaryVariables &values, const Element &element) const
 Evaluate the source term. More...
 
void initial (PrimaryVariables &values, const Element &element) const
 Evaluate the initial value for a control volume. More...
 
void preTimeStep ()
 Called by TimeManager just before the time integration. More...
 
void postTimeStep ()
 Called by TimeManager whenever a solution for a timestep has been computed and the simulation time has been updated. More...
 
void advanceTimeLevel ()
 Called by the time manager after everything which can be done about the current time step is finished and the model should be prepared to do the next time integration. More...
 
Scalar maxTimeStepSize () const
 Returns the user specified maximum time step size. More...
 
Scalar timeStepSize () const
 Returns the current time step size [seconds]. More...
 
void setTimeStepSize (Scalar dt)
 Sets the current time step size [seconds]. More...
 
Scalar nextTimeStepSize (Scalar dt)
 Called by TimeManager whenever a solution for a timestep has been computed and the simulation time has been updated. More...
 
void setOutputTimeInterval (const Scalar timeInterval)
 Sets a time interval for Output. More...
 
void setOutputInterval (int interval)
 Sets the interval for Output. More...
 
bool shouldWriteOutput () const
 Returns true if the current solution should be written to disk (i.e. as a VTK file) More...
 
void addOutputVtkFields ()
 
void writeOutput (bool verbose=true)
 Write the fields current solution into an VTK output file. More...
 
void episodeEnd ()
 Called when the end of an simulation episode is reached. More...
 
void setName (const std::string &newName)
 Set the problem name. More...
 
const GridView & gridView () const
 The GridView which used by the problem. More...
 
const VertexMapper & vertexMapper () const
 Returns the mapper for vertices to indices. More...
 
const ElementMapper & elementMapper () const
 Returns the mapper for elements to indices. More...
 
const GlobalPosition & bBoxMin () const
 The coordinate of the corner of the GridView's bounding box with the smallest values. More...
 
const GlobalPosition & bBoxMax () const
 The coordinate of the corner of the GridView's bounding box with the largest values. More...
 
TimeManager & timeManager ()
 Returns TimeManager object used by the simulation. More...
 
const TimeManager & timeManager () const
 Returns TimeManager object used by the simulation. More...
 
Variables & variables ()
 Returns variables object. More...
 
const Variables & variables () const
 Returns variables object. More...
 
Model & model ()
 Returns numerical model used for the problem. More...
 
const Model & model () const
 Returns numerical model used for the problem. More...
 
Problem parameters
Scalar temperature (const Element &element) const
 Returns the temperature within the domain. More...
 
Scalar referencePressure (const Element &element) const
 Returns the reference pressure for evaluation of constitutive relations. More...
 
const GlobalPosition & gravity () const
 Returns the acceleration due to gravity. More...
 
SpatialParams & spatialParams ()
 Returns the spatial parameters object. More...
 
const SpatialParams & spatialParams () const
 Returns the spatial parameters object. More...
 
void timeIntegration ()
 Time integration of the model. More...
 

Problem parameters

std::string name () const
 The problem name. More...
 
bool shouldWriteRestartFile () const
 
Scalar temperatureAtPos (const GlobalPosition &globalPos) const
 Returns the temperature within the domain. More...
 
Scalar referencePressureAtPos (const GlobalPosition &globalPos) const
 Returns the reference pressure for evaluation of constitutive relations. More...
 
void sourceAtPos (PrimaryVariables &values, const GlobalPosition &globalPos) const
 
void boundaryTypesAtPos (BoundaryTypes &bcTypes, const GlobalPosition &globalPos) const
 Returns the type of boundary condition. More...
 
void dirichletAtPos (PrimaryVariables &values, const GlobalPosition &globalPos) const
 set dirichlet condition (saturation [-]) More...
 
void neumannAtPos (PrimaryVariables &values, const GlobalPosition &globalPos) const
 set neumann condition for phases (flux, [kg/(m^2 s)]) More...
 
void initialAtPos (PrimaryVariables &values, const GlobalPosition &globalPos) const
 return initial solution More...
 

Restart mechanism

void serialize ()
 This method writes the complete state of the problem to the harddisk. More...
 
void restart (double tRestart)
 This method restores the complete state of the problem from disk. More...
 
VtkMultiWriterresultWriter ()
 
VtkMultiWriterresultWriter () const
 

Constructor & Destructor Documentation

◆ TestTransportProblem()

template<class TypeTag >
Dumux::TestTransportProblem< TypeTag >::TestTransportProblem ( TimeManager &  timeManager,
Grid &  grid 
)
inline

Member Function Documentation

◆ addOutputVtkFields()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::addOutputVtkFields ( )
inlineinherited

◆ advanceTimeLevel()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::advanceTimeLevel ( )
inlineinherited

Called by the time manager after everything which can be done about the current time step is finished and the model should be prepared to do the next time integration.

◆ bBoxMax()

template<class TypeTag >
const GlobalPosition & Dumux::OneModelProblem< TypeTag >::bBoxMax ( ) const
inlineinherited

The coordinate of the corner of the GridView's bounding box with the largest values.

◆ bBoxMin()

template<class TypeTag >
const GlobalPosition & Dumux::OneModelProblem< TypeTag >::bBoxMin ( ) const
inlineinherited

The coordinate of the corner of the GridView's bounding box with the smallest values.

◆ boundaryTypes()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::boundaryTypes ( BoundaryTypes &  bcTypes,
const Intersection &  intersection 
) const
inlineinherited

Specifies which kind of boundary condition should be used for which equation on a given boundary segment.

Parameters
bcTypesThe boundary types for the conservation equations
intersectionThe intersection for which the boundary type is set

◆ boundaryTypesAtPos()

template<class TypeTag >
void Dumux::TestTransportProblem< TypeTag >::boundaryTypesAtPos ( BoundaryTypes &  bcTypes,
const GlobalPosition &  globalPos 
) const
inline

Returns the type of boundary condition.

BC for saturation equation can be dirichlet (saturation), neumann (flux), or outflow.

◆ dirichlet()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::dirichlet ( PrimaryVariables &  values,
const Intersection &  intersection 
) const
inlineinherited

Evaluate the boundary conditions for a dirichlet control volume.

Parameters
valuesThe dirichlet values for the primary variables
intersectionThe boundary intersection

For this method, the values parameter stores primary variables.

◆ dirichletAtPos()

template<class TypeTag >
void Dumux::TestTransportProblem< TypeTag >::dirichletAtPos ( PrimaryVariables &  values,
const GlobalPosition &  globalPos 
) const
inline

set dirichlet condition (saturation [-])

◆ elementMapper()

template<class TypeTag >
const ElementMapper & Dumux::OneModelProblem< TypeTag >::elementMapper ( ) const
inlineinherited

Returns the mapper for elements to indices.

◆ episodeEnd()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::episodeEnd ( )
inlineinherited

Called when the end of an simulation episode is reached.

◆ gravity()

template<class TypeTag >
const GlobalPosition & Dumux::TransportProblem2P< TypeTag >::gravity ( ) const
inlineinherited

Returns the acceleration due to gravity.

If the EnableGravity property is true, this means \(\boldsymbol{g} = ( 0,\dots,\ -9.81)^T \), else \(\boldsymbol{g} = ( 0,\dots, 0)^T \)

◆ gridView()

template<class TypeTag >
const GridView & Dumux::OneModelProblem< TypeTag >::gridView ( ) const
inlineinherited

The GridView which used by the problem.

◆ init()

template<class TypeTag >
void Dumux::TestTransportProblem< TypeTag >::init ( )
inline

set initial velocity field -> v_total is assumed to be constant in this test!

◆ initial()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::initial ( PrimaryVariables &  values,
const Element &  element 
) const
inlineinherited

Evaluate the initial value for a control volume.

Parameters
valuesThe initial values for the primary variables
elementThe element

For this method, the values parameter stores primary variables.

◆ initialAtPos()

template<class TypeTag >
void Dumux::TestTransportProblem< TypeTag >::initialAtPos ( PrimaryVariables &  values,
const GlobalPosition &  globalPos 
) const
inline

return initial solution

◆ maxTimeStepSize()

template<class TypeTag >
Scalar Dumux::OneModelProblem< TypeTag >::maxTimeStepSize ( ) const
inlineinherited

Returns the user specified maximum time step size.

Overload in problem for custom needs.

◆ model() [1/2]

template<class TypeTag >
Model & Dumux::OneModelProblem< TypeTag >::model ( )
inlineinherited

Returns numerical model used for the problem.

◆ model() [2/2]

template<class TypeTag >
const Model & Dumux::OneModelProblem< TypeTag >::model ( ) const
inlineinherited

Returns numerical model used for the problem.

◆ name()

template<class TypeTag >
std::string Dumux::TestTransportProblem< TypeTag >::name ( ) const
inline

The problem name.

This is used as a prefix for files generated by the simulation.

◆ neumann()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::neumann ( PrimaryVariables &  values,
const Intersection &  intersection 
) const
inlineinherited

Evaluate the boundary conditions for a neumann boundary segment.

Parameters
valuesThe neumann values for the conservation equations [kg / (m^2 *s )]
intersectionThe boundary intersection

For this method, the values parameter stores the mass flux in normal direction of each phase. Negative values mean influx.

◆ neumannAtPos()

template<class TypeTag >
void Dumux::TestTransportProblem< TypeTag >::neumannAtPos ( PrimaryVariables &  values,
const GlobalPosition &  globalPos 
) const
inline

set neumann condition for phases (flux, [kg/(m^2 s)])

◆ nextTimeStepSize()

template<class TypeTag >
Scalar Dumux::OneModelProblem< TypeTag >::nextTimeStepSize ( Scalar  dt)
inlineinherited

Called by TimeManager whenever a solution for a timestep has been computed and the simulation time has been updated.

◆ postTimeStep()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::postTimeStep ( )
inlineinherited

Called by TimeManager whenever a solution for a timestep has been computed and the simulation time has been updated.

This is used to do some janitorial tasks like writing the current solution to disk.

◆ preTimeStep()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::preTimeStep ( )
inlineinherited

Called by TimeManager just before the time integration.

◆ referencePressure()

template<class TypeTag >
Scalar Dumux::TransportProblem2P< TypeTag >::referencePressure ( const Element &  element) const
inlineinherited

Returns the reference pressure for evaluation of constitutive relations.

Parameters
elementThe element

◆ referencePressureAtPos()

template<class TypeTag >
Scalar Dumux::TestTransportProblem< TypeTag >::referencePressureAtPos ( const GlobalPosition &  globalPos) const
inline

Returns the reference pressure for evaluation of constitutive relations.

◆ restart()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::restart ( double  tRestart)
inlineinherited

This method restores the complete state of the problem from disk.

It is the inverse of the serialize() method.

◆ resultWriter() [1/2]

template<class TypeTag >
VtkMultiWriter & Dumux::OneModelProblem< TypeTag >::resultWriter ( )
inlineprotectedinherited

◆ resultWriter() [2/2]

template<class TypeTag >
VtkMultiWriter & Dumux::OneModelProblem< TypeTag >::resultWriter ( ) const
inlineprotectedinherited

◆ serialize()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::serialize ( )
inlineinherited

This method writes the complete state of the problem to the harddisk.

The file will start with the prefix returned by the name() method, has the current time of the simulation clock in it's name and uses the extension .drs. (Dumux ReStart file.) See Restart for details.

◆ setName()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::setName ( const std::string &  newName)
inlineinherited

Set the problem name.

This function sets the simulation name, which should be called before the application problem is declared! If not, the default name "sim" will be used.

◆ setOutputInterval()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::setOutputInterval ( int  interval)
inlineinherited

Sets the interval for Output.

The default is 1 -> Output every time step

◆ setOutputTimeInterval()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::setOutputTimeInterval ( const Scalar  timeInterval)
inlineinherited

Sets a time interval for Output.

The default is 0.0 -> Output determined by output number interval (setOutputInterval(int))

◆ setTimeStepSize()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::setTimeStepSize ( Scalar  dt)
inlineinherited

Sets the current time step size [seconds].

◆ shouldWriteOutput()

template<class TypeTag >
bool Dumux::OneModelProblem< TypeTag >::shouldWriteOutput ( ) const
inlineinherited

Returns true if the current solution should be written to disk (i.e. as a VTK file)

The default behaviour is to write out every the solution for very time step. This file is intented to be overwritten by the implementation.

◆ shouldWriteRestartFile()

template<class TypeTag >
bool Dumux::TestTransportProblem< TypeTag >::shouldWriteRestartFile ( ) const
inline

◆ source()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::source ( PrimaryVariables &  values,
const Element &  element 
) const
inlineinherited

Evaluate the source term.

Parameters
valuesThe source and sink values for the conservation equations
elementThe element

For this method, the values parameter stores the rate mass generated or annihilate per volume unit. Positive values mean that mass is created, negative ones mean that it vanishes.

◆ sourceAtPos()

template<class TypeTag >
void Dumux::TestTransportProblem< TypeTag >::sourceAtPos ( PrimaryVariables &  values,
const GlobalPosition &  globalPos 
) const
inline

◆ spatialParams() [1/2]

template<class TypeTag >
SpatialParams & Dumux::TransportProblem2P< TypeTag >::spatialParams ( )
inlineinherited

Returns the spatial parameters object.

◆ spatialParams() [2/2]

template<class TypeTag >
const SpatialParams & Dumux::TransportProblem2P< TypeTag >::spatialParams ( ) const
inlineinherited

Returns the spatial parameters object.

◆ temperature()

template<class TypeTag >
Scalar Dumux::TransportProblem2P< TypeTag >::temperature ( const Element &  element) const
inlineinherited

Returns the temperature within the domain.

Parameters
elementThe element

◆ temperatureAtPos()

template<class TypeTag >
Scalar Dumux::TestTransportProblem< TypeTag >::temperatureAtPos ( const GlobalPosition &  globalPos) const
inline

Returns the temperature within the domain.

This problem assumes a temperature of 10 degrees Celsius.

◆ timeIntegration()

template<class TypeTag >
void Dumux::TransportProblem2P< TypeTag >::timeIntegration ( )
inlineinherited

Time integration of the model.

Update the transported quantity. By default, an explicit Euler is used

◆ timeManager() [1/2]

template<class TypeTag >
TimeManager & Dumux::OneModelProblem< TypeTag >::timeManager ( )
inlineinherited

Returns TimeManager object used by the simulation.

◆ timeManager() [2/2]

template<class TypeTag >
const TimeManager & Dumux::OneModelProblem< TypeTag >::timeManager ( ) const
inlineinherited

Returns TimeManager object used by the simulation.

◆ timeStepSize()

template<class TypeTag >
Scalar Dumux::OneModelProblem< TypeTag >::timeStepSize ( ) const
inlineinherited

Returns the current time step size [seconds].

◆ variables() [1/2]

template<class TypeTag >
Variables & Dumux::OneModelProblem< TypeTag >::variables ( )
inlineinherited

Returns variables object.

◆ variables() [2/2]

template<class TypeTag >
const Variables & Dumux::OneModelProblem< TypeTag >::variables ( ) const
inlineinherited

Returns variables object.

◆ vertexMapper()

template<class TypeTag >
const VertexMapper & Dumux::OneModelProblem< TypeTag >::vertexMapper ( ) const
inlineinherited

Returns the mapper for vertices to indices.

◆ writeOutput()

template<class TypeTag >
void Dumux::OneModelProblem< TypeTag >::writeOutput ( bool  verbose = true)
inlineinherited

Write the fields current solution into an VTK output file.


The documentation for this class was generated from the following file: