Commit 64fb6208 authored by Lukas Riedel's avatar Lukas Riedel 📝

Merge branch '101-couple-the-transportsimulation-with-richardssimulation' into 'master'

Resolve "Couple the TransportSimulation with RichardsSimulation"

Closes #72 and #101

See merge request !96
parents 780b3d1f 7862b372
......@@ -6,6 +6,12 @@
### Added
* DORiE now depends on [`yaml-cpp`](https://github.com/jbeder/yaml-cpp/), a
library for reading YAML files. The version required is >=5.2.0.
* New classes representing parameterizations. Every parameterization must now
derive from `RichardsParameterization`, and return function objects
representing parameterization functions.
* Added a abstract base class [`SimulationBase`](dune/dorie/interface/base_simulation.hh)
that models the concept of simulation steps so that they
can be later coupled with other simulations.
* Added an abstract base class
[`SimulationBase`](dune/dorie/common/simulation_base.hh)
that models the concept of simulation steps so that they
......@@ -31,6 +37,7 @@
* Custom DG finite element map for simplices based on Pk polynomials !125
* Initial conditions expressed as analytic functions using
[muparser](http://beltoforion.de/article.php?a=muparser) !131
* Coupling between transient models for water flow and solute transport !96
### Changed
* `Simulation` is renamed `RichardsSimulation` and moved to
......@@ -38,9 +45,6 @@
* `RichardsSimulation` now has its own `RichardsSimulationTraits` derived from
`BaseTraits`, which defines all its member types. `BaseTraits` now have
reduced content and are intended to be shared between models/simulations.
* Grid adaptation now is done in two steps: (1) mark entities of the grid to
refine/coarse and (2) adapt the grid and project the degrees of freedom on
the new grid.
* Data structures for storing and accessing parameters. The new class
`FlowParameters` maps parameter sets and scaling factors to every grid cell
on the coarsest grid level, and only stores one set of parameters for
......@@ -48,6 +52,15 @@
to call `FlowParameters::bind` with a grid entity to cache the appropriate
data. All classes and functions querying parameter data have been updated.
The old parameterization classes located in
[`param_base.hh`](dune/dorie/solver/param_base.hh),
[`param_factory.hh`](dune/dorie/solver/param_factory.hh), and
[`param_van_genuchten.hh`](dune/dorie/solver/param_van_genuchten.hh)
are still used for reading in data for the new storage scheme.
The respective objects are freed once a simulation commences.
* Grid adaptation now is done in two steps: (1) mark entities of the grid to
refine/coarse and (2) adapt the grid and project the degrees of freedom on
the new grid.
The old parameterization classes have been removed.
* `RichardsSimulation` now uses one vector of coefficients instead of two, which
now is a `shared_ptr` instead a `unique_ptr`.
......
......@@ -4,4 +4,4 @@ spatial_resolution_west -1
spatial_resolution_east -1
number_BC_change_times 2
0 neumann 0 dirichlet 1 neumann 0
1E7 neumann 0 neumann 0 neumann 0
\ No newline at end of file
1E3 neumann 0 neumann 0 neumann 0
......@@ -12,4 +12,4 @@ spatial_resolution_back_sn -1
spatial_resolution_back_we -1
number_BC_change_times 2
0 neumann 0 neumann 0 neumann 0 neumann 0 dirichlet 1 neumann 0 neumann 0 neumann 0 neumann 0
1E7 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0
\ No newline at end of file
1E3 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0
\ No newline at end of file
......@@ -117,7 +117,10 @@ function(create_default_config INPUT OUTPUT SOURCE_DIR CSS)
endfunction()
# copy BC & parameter files
file(COPY 2d_infiltr.bcdat 3d_infiltr.bcdat param.yml DESTINATION .)
file(COPY 2d_infiltr.bcdat 3d_infiltr.bcdat
2d_solute.bcdat 3d_solute.bcdat
param.yml
DESTINATION .)
# Random field generator
scrape_parameters(
......@@ -150,14 +153,6 @@ scrape_parameters(
MODEL "richards"
)
# Final Dorie config
create_default_config(
${CMAKE_CURRENT_BINARY_DIR}/config.yml
"config.ini;parameters.html;parameters.rst"
${PROJECT_SOURCE_DIR}/dune/dorie
${CMAKE_CURRENT_SOURCE_DIR}/parameters.css
)
# Model: Transport
scrape_parameters(
SOURCE_DIR ${PROJECT_SOURCE_DIR}/dune/dorie/model/transport
......@@ -166,11 +161,10 @@ scrape_parameters(
MODEL "transport"
)
# Transport config (temporally hidden to the user)
# TODO: Include in API once transport is ready
# Final Dorie config
create_default_config(
${CMAKE_CURRENT_BINARY_DIR}/config.yml
"transport-config.ini;transport-parameters.html;transport-parameters.rst"
"config.ini;parameters.html;parameters.rst"
${PROJECT_SOURCE_DIR}/dune/dorie
${CMAKE_CURRENT_SOURCE_DIR}/parameters.css
)
)
\ No newline at end of file
......@@ -29,8 +29,16 @@ All attributes are optional.
The parser supports rudimentary markdown / styling. You can add a paragraph by
adding an empty line, make text **bold** or ``monospaced``.
-->
<dorie>
<category name="simulation">
<parameter name="mode">
<definition> Mode of simulation in DORiE. </definition>
<suggestion> richards </suggestion>
<values> richards, richards+transport </values>
<comment> richards, richards+transport </comment>
</parameter>
</category>
<category name="grid">
<parameter name="gridType">
<definition> Grid geometry. The grid can either be structured rectangular / cubic
......
......@@ -61,6 +61,12 @@ adding an empty line, make text **bold** or ``monospaced``.
<suggestion> true </suggestion>
</parameter>
<parameter name="policy">
<definition> Policy to write the data. </definition>
<suggestion> endOfRichardsStep </suggestion>
<values> endOfRichardsStep, none </values>
</parameter>
<parameter name="subsamplingLevel">
<definition> Plot VTK files with virtually refined grids. VTK only
supports bilinear triangulations and displays higher-order solutions
......
......@@ -61,6 +61,12 @@ adding an empty line, make text **bold** or ``monospaced``.
<suggestion> true </suggestion>
</parameter>
<parameter name="policy">
<definition> Policy to write the data. </definition>
<suggestion> endOfRichardsStep </suggestion>
<values> endOfTransportStep, endOfRichardsStep, none </values>
</parameter>
<parameter name="subsamplingLevel">
<definition> Plot VTK files with virtually refined grids. VTK only
supports bilinear triangulations and displays higher-order solutions
......@@ -207,8 +213,8 @@ adding an empty line, make text **bold** or ``monospaced``.
</category>
<category name="parameters">
<parameter name="molecularDiffusion">
<definition> Molecular diffusion of the fluid phase </definition>
<parameter name="effHydrDips">
<definition> Effective hydrodynamic dispersion </definition>
<values> float &gt; 0 </values>
<suggestion> 2E-9 </suggestion>
</parameter>
......@@ -216,20 +222,32 @@ adding an empty line, make text **bold** or ``monospaced``.
<category name="numerics">
<parameter name="timestepMethod">
<definition> Numerical scheme to perform time steps in the simulation
<definition> Numerical scheme to perform time steps in the simulation.
``alex2`` and ``implicit_euler`` are implicit methods.
``explicit_euler`` is a explicit method.
</definition>
<values> string </values>
<suggestion> explicit_euler, implicit_euler, heun, shu3, rk4, alex2, fractional, alex3
</suggestion>
<values> explicit_euler, implicit_euler, alex2 </values>
<suggestion> alex2 </suggestion>
</parameter>
<parameter name="courant">
<definition> Courant number for explicit methods. Explicit methods have a
maximum time step according to the CFL condition.
<definition> Courant number for explicit methods. It is a scale for the
maximum stable time step according to the CFL condition. The CFL
condition penalizes high velocities, low dispersion coefficients, and
small grid elements. Hence, Courant numbers near to 1 tend to be more
instable while numbers near to 0 tend to considerably limit the
maximum time step.
</definition>
<values> float &gt; 0 </values>
<values> 0 &lt; float &lt; 1 </values>
<suggestion> 0.8 </suggestion>
</parameter>
<parameter name="FEorder">
<definition> Order of the finite element method used. Values &gt; 1 are not
thoroughly tested. </definition>
<suggestion> 0 </suggestion>
<values> 0 </values>
</parameter>
</category>
<category name="fluxReconstruction">
......@@ -259,4 +277,22 @@ adding an empty line, make text **bold** or ``monospaced``.
<suggestion> 1E-10 </suggestion>
</parameter>
</category>
<category name="solverParameters">
<parameter name="reduction">
<definition> Required relative defect reduction.
Reduce this value to increase precision.
</definition>
<suggestion> 1E-6 </suggestion>
<values> float </values>
</parameter>
<parameter name="minDefect">
<definition> Minimum absolute defect at which linear solver stops.
Reduce this value to increase precision.
</definition>
<suggestion> 1E-20 </suggestion>
<values> float </values>
</parameter>
</category>
</dorie>
......@@ -47,13 +47,29 @@ Output Files
saved into the directory from which DORiE was executed.
* VTK Files (``.vtu``): The output data in unstructured grid format.
It contains multiple datasets:
- ``head``: Matric head
- ``K0``: Saturated conductivity
- ``flux``: Water flux (not reconstructed!)
- ``theta_w``: Volumetric water content
- ``Theta``: Water saturation
It contains multiple multiple datasets depending on the type of model:
.. object:: Richards
- ``head``: Matric head :math:`h_m \, [\mathrm{m}]`
- ``K0``: Saturated conductivity :math:`K_0 \, [\mathrm{ms}^{-1}]`
- ``flux``: Water flux :math:`\mathbf{j}_w \, [\mathrm{ms}^{-1}]`
(not reconstructed!)
- ``flux_RT<k-1>``: Reconstructed water flux
:math:`\mathbf{j}_{w, \mathrm{rc}} \, [\mathrm{ms}^{-1}]`
(if enabled!)
- ``theta_w``: Volumetric water content :math:`\theta \, [\mathrm{-}]`
- ``Theta``: Water saturation :math:`\Theta \, [\mathrm{-}]`
.. object:: Transport
- ``solute``: Solute concentration in water phase
:math:`c_w \, [\mathrm{kg}/\mathrm{m}^3]`
- ``solute_total``: Total solute concentration
:math:`c_t \, [\mathrm{kg}/\mathrm{m}^3]`
- ``flux_RT<k-1>``: Reconstructed solute flux
:math:`\mathbf{j}_{s, \mathrm{rc}} \, [\mathrm{kg}/\mathrm{m}^{-2}\mathrm{s}^{-1}]`
(if enabled!)
* VTK Parallel Collection Files (``.pvtu``): Merging multiple VTK files in case
DORiE is run in parallel.
......
......@@ -36,5 +36,40 @@ soil. Depending on the soil architecture, the hydraulic parameters may be
discontinuous which would lead to water content and conductivity exhibiting
singularities.
Use the value ``richards`` in the ``simulation.mode`` keyword to run the
standalone Richards solver.
Solute Transport Solver
=======================
The solute transport equation for unsaturated media describes movement of
solute by the *solute concentration* :math:`c_w \, [\mathrm{kg}/\mathrm{m}^3]`,
.. math::
\frac{\partial}{\partial t} c_w \theta_w
- \nabla \left[ \vec{j}_w c_w + D \theta_w \nabla c_w
\right]
= 0,
where :math:`D \, [\mathrm{m}^2/\mathrm{s}]` is the effective hydrodynamic
dispersion tensor, and :math:`\vec{j}_w` is the water flux. Currently,
:math:`D` can only be used as a constant parameter by the keyword
``effHydrDips`` in the configuration file. The solute concentration per total
volume :math:`c_t \, [\mathrm{kg}/\mathrm{m}^3]` is calculated by multiplying
the concentration in the water phase with the volumetric water content,
.. math::
c_t = c_w \theta_w
.. TODO: Update effective hydrodynamic dispersion description once
parameterization is merged in master.
The solute transport requires a water flux of the unsaturated media, hence,
the Richards solver must be utilized to solve them. Use the value
``richards+transport`` in the ``simulation.mode`` keyword to run the solute
transport solver.
.. _DUNE: https://www.dune-project.org/
.. _DUNE-PDELab: https://www.dune-project.org/modules/dune-pdelab/
......@@ -21,15 +21,36 @@ Dirichlet
.. object:: dirichlet <head>
Set a fixed matric head [m] at the boundary.
Set a fixed matric head [:math:`m`] at the boundary.
.. object:: dirichlet <solute>
Set a fixed solute concentration at the boundary.
Neumann
+++++++
.. object:: neumann <flux>
.. object:: neumann <water_flux>
Set a fixed volumetric water flux [:math:`m/s`] at the boundary. Positive values
imply fluxes out of the domain, negative values imply fluxes into the domain.
.. object:: neumann <solute_flux>
Set a fixed volumetric solute flux [:math:`kg/(s\,m^3)`] at the boundary. Positive values
imply fluxes out of the domain, negative values imply fluxes into the domain.
Outflow
+++++++
Set a fixed volumetric flux [m/s] at the boundary. Positive values imply fluxes out of the domain, negative values imply fluxes into the domain.
.. object:: outflow <solute_outflux>
Set a spatial rate of change of volumetric solute flux
[:math:`kg/(s\,m\,m^3)`] at the boundary. Positive values imply higher rate
of change out of the domain, negative values imply lower rate of change into
the domain. Influx situations are not taken into account. For most of the
cases an outflow of 0. [:math:`kg/(s\,m\,m^3)`] is a reasonable situation.
Datafile Structure
==================
......@@ -83,7 +104,7 @@ These lines follow a simple grammar:
bc_line: time { group }*
time: `float`
group: ( bc_type `float` )
bc_type: "neumann" | "dirichlet"
bc_type: "neumann" | "dirichlet" | "outflow"
The boundary conditions defined here are parsed in the same order as the boundary segments have been specified. In 3D, the rectangular boundary segments are parsed in a tabular fashion, where columns run faster than rows. Columns are defined along the first direction specified in the `Boundary Segmentation`_, and rows are defined along the second direction.
......
......@@ -6,9 +6,9 @@ Depending on the application for what you want to use DORiE, there might be the
Understanding the water flux output
-----------------------------------
Firstly, we have to recall that DORiE solves a Discontinuous Galerking finite element problem with *matric head* as unknown. It means that the solution of the *matric head* (and therefore the *water flux*) is continuous only element-wise, or in other words, it is discontinuous on the intersections between elements. On the other hand, the dG method solves *numerical fluxes* on the intersections between elements composed together with a penalty term that increases with respect to the discontinuity of the *matric head*. This ensures that the local solution is conservative while keeps the discontinuity as low as possible.
Firstly, we have to recall that DORiE solves a Discontinuous Galerking finite element problem with *matric head*/*solute concentration* as unknown. It means that the solution of the *matric head*/*solute concentration* (and therefore the *water flux*/*solute flux*) is continuous only element-wise, or in other words, it is discontinuous on the intersections between elements. On the other hand, the dG method solves *numerical fluxes* on the intersections between elements composed together with a penalty term that increases with respect to the discontinuity of the *matric head*/*solute concentration*. This ensures that the local solution is conservative while keeps the discontinuity as low as possible.
From the description above one can infer that one has to distinguish between *water fluxes* at the interior of each element and at the intersections of all elements (we call these intersections skeleton of the grid). Unfortunately, there is no a standard form to write the skeleton fluxes on formats like VTK and that's the main reason why DORiE only provides the interior fluxes. However, assuming one can write both fluxes into some output format, they are still discontinuous (notice that direct use of discontinuous fluxes are useless for conservative computations since the transported quantities are very likely to get stagnated or over-transported in the nearby of intersections between elements). It means that it is needed some sort of post-processing that ensures that the *water mass* is still locally and globally conserved.
From the description above one can infer that one has to distinguish between * fluxes* at the interior of each element and at the intersections of all elements (we call these intersections skeleton of the grid). Unfortunately, there is no a standard form to write the skeleton fluxes on formats like VTK and that's the main reason why DORiE only provides the interior fluxes. However, assuming one can write both fluxes into some output format, they are still discontinuous (notice that direct use of discontinuous fluxes are useless for conservative computations since the transported quantities are very likely to get stagnated or over-transported in the nearby of intersections between elements). It means that it is needed some sort of post-processing that ensures that the *mass* is still locally and globally conserved.
.. DORiE allow finite volume computations under certain specific conditions. In such case, if generated, the raw flux output generated by DORiE has no meaning. The reason is that finite volumes are computed with finite elements of order 0 where gradients are 0.
......
......@@ -84,7 +84,7 @@ Initial condition tranformations for the Transport solver.
* ``quantity = soluteConcentration``
The input data is directly interpreted as solute concentration,
:math:`f = c_w`.
:math:`f = c_w [\mathrm{kg}/\mathrm{m}^3]`.
.. _muparser: http://beltoforion.de/article.php?a=muparser&p=features
......@@ -14,7 +14,10 @@ RUN CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX
./dune-common/bin/dunecontrol --only=dorie configure \
&& ./dune-common/bin/dunecontrol --only=dorie make -j ${PROCNUM} dorie-rfg dorie \
&& ./dune-common/bin/dunecontrol --only=dorie exec \
"rm build-cmake/dune/dorie/model/richards/impl/libdorie-richards.a build-cmake/dune/dorie/model/richards/impl/CMakeFiles/dorie-richards.dir/*.cc.o"
"rm build-cmake/dune/dorie/model/richards/impl/libdorie-richards.a
build-cmake/dune/dorie/model/transport/impl/libdorie-transport.a
build-cmake/dune/dorie/model/richards/impl/CMakeFiles/dorie-richards.dir/*.cc.o
build-cmake/dune/dorie/model/transport/impl/CMakeFiles/dorie-transport.dir/*.cc.o"
# move to working directory
WORKDIR /mnt
......
......@@ -4,10 +4,16 @@ if(dune-testtools_FOUND)
add_subdirectory("test")
endif()
add_executable("dorie" dorie.cc)
dune_target_link_libraries(dorie dorie-richards ${DUNE_LIBS} spdlog)
add_executable("richards" richards.cc)
dune_target_link_libraries(richards dorie-richards ${DUNE_LIBS} spdlog)
add_executable("transport" transport.cc)
dune_target_link_libraries(transport dorie-richards ${DUNE_LIBS} spdlog)
dune_target_link_libraries(transport dorie-transport ${DUNE_LIBS} spdlog)
add_custom_target("dorie" DEPENDS richards transport)
# enable setting operator scheme from config file
if(EXPERIMENTAL_DG_FEATURES)
target_compile_definitions("dorie" PUBLIC -DEXPERIMENTAL_DG_FEATURES)
endif()
endif()
\ No newline at end of file
......@@ -4,8 +4,10 @@ add_subdirectory("finite_element")
#install headers
install(FILES
boundary_condition.hh
cfl_condition.hh
grid_creator.hh
grid_function_writer.hh
grid_mapper.hh
h5tools.hh
interpolator.hh
setup_inifile.hh
......
......@@ -643,6 +643,12 @@ namespace Dorie{
bcData[i][j].headValue.push_back(stod(buffer));
bcData[i][j].fluxValue.push_back(0.0);
}
else if(buffer == "outflow"){
bcData[i][j].type.push_back(BoundaryCondition::Outflow);
instream >> buffer;
bcData[i][j].headValue.push_back(0.0);
bcData[i][j].fluxValue.push_back(stod(buffer));
}
else
DUNE_THROW(IOError,"In BC file line " + std::to_string(counter) + ": BC side "
+ std::to_string(i) + ": BC declaration " + std::to_string(j+1) + ": BC type unknown!");
......@@ -806,6 +812,8 @@ namespace Dorie{
std::cout << index << ": " << bcTimeStamps[k] << ": ";
if(bcData[i][j].type[k]==BoundaryCondition::Neumann)
std::cout << "neumann : ";
else if(bcData[i][j].type[k]==BoundaryCondition::Outflow)
std::cout << "outflow : ";
else if(bcData[i][j].type[k]==BoundaryCondition::Dirichlet)
std::cout << "dirichlet : ";
}
......
......@@ -808,7 +808,7 @@ public:
"evaluateJacobian for RaviartThomasVolumeLocalBasis not implemented!");
}
void partial(const std::array<unsigned int,dim>& order,
void partial(const std::array<unsigned int,dim>& order_,
const typename Traits::DomainType& in,
std::vector<typename Traits::RangeType>& out) const
{
......
......@@ -350,6 +350,28 @@ public:
*/
bool empty() const {return _list.empty();}
/*-----------------------------------------------------------------------*//**
* @brief Returns the number of elements in the queue.
*
* @return The number of elements in the underlying container.
*/
size_type size() const {return _list.size();}
/*-----------------------------------------------------------------------*//**
* @brief Shrink the container to fit the current time.
*/
void shrink_to_time()
{
if (Dune::FloatCmp::eq(_it->second,_current_time))
_list.erase(_list.begin(),_it);
else
_list.erase(_list.begin(),std::prev(_it));
_list.erase(std::next(_it),_list.end());
check_valid_state();
check_in_range_time(_current_time);
}
/*-----------------------------------------------------------------------*//**
* @brief Evaluation of the grid function.
......
......@@ -24,6 +24,8 @@ inline const std::string log_base = "base";
inline const std::string log_richards = "RIC";
/// The name of the Transport model logger
inline const std::string log_transport = "SOL";
/// The name of the Richards-Transport coupling model logger
inline const std::string log_coupling = "CPL";
/// Wrapper around the function spdlog::get, which throws exceptions
/** \param name The name of the logger to retrieve
......
......@@ -142,6 +142,27 @@ namespace Setup
return richards_ini;
}
/*------------------------------------------------------------------------*//**
* @brief Set up the configuration keys for Transport simulations
*
* @param ini The inifile
*/
Dune::ParameterTree prep_ini_for_transport(const Dune::ParameterTree& ini)
{
Dune::ParameterTree transport_ini(ini.sub("transport"));
// move grid extensions into transport category (needed for reading parameters)
transport_ini["grid.extensions"] = ini["grid.extensions"];
const std::string adapt_policy_str = ini.get<std::string>("adaptivity.policy");
// copy adaptivity keywords into richards category
if (adapt_policy_str == "soluteFlux") {
transport_ini.sub("adaptivity") = ini.sub("adaptivity");
}
return transport_ini;
}
/**
* @}
*/
......
......@@ -31,7 +31,7 @@ public:
* @param[in] log_level The log level of the logger.
* @param[in] helper The Dune::MPIHelper instance of this process.
* @param[in] output_policy The output policy.
* Defaults to OutputPolicy::EndOfStep.
* Defaults to OutputPolicy::None.
* @param[in] adapt_policy The adapt policy.
* Defaults to AdaptiviyPolicy::None.
*/
......@@ -39,7 +39,7 @@ public:
const std::string log_name,
const std::string log_level,
const Dune::MPIHelper& helper,
OutputPolicy output_policy=OutputPolicy::EndOfStep,
OutputPolicy output_policy=OutputPolicy::None,
AdaptivityPolicy adapt_policy=AdaptivityPolicy::None
)
: _output_policy(output_policy)
......@@ -47,6 +47,7 @@ public:
, _log(create_logger(log_name, helper, spdlog::level::from_str(log_level)))
{ }
virtual ~SimulationBase () = default;
/*-----------------------------------------------------------------------*//**
* @brief Sets the output policy.
*
......
......@@ -79,8 +79,12 @@ public:
/// suggest timestep
inline void suggest_timestep (R suggestion) {
use_dt_suggestion = true;
suggested_dt = suggestion;}
if (FloatCmp::lt(suggestion,dt)) {
_log->trace("Adapting time step due to a suggestion: "
"{:.2e} -> {:.2e}", dt, suggestion);
dt = suggestion;
}
}
/// Return current time
inline R getTime () const { return time; }
/// Return timestep for next calculation
......@@ -125,14 +129,9 @@ public:
if(time >= tEnd-eps) // Simulation has ended. Do nothing
return true;
dt = std::max(dt,dtmin);
dt = std::min(dt*dtinc,dtmax);
if (use_dt_suggestion)
{
dt = std::min(dt,suggested_dt);
use_dt_suggestion = false;
}
changeTime = tsc.getNextTimeStamp(time);
if(time >= changeTime-eps && time <= changeTime){
// small step to ensure that next time step starts with new BC
......@@ -162,7 +161,10 @@ public:
DUNE_THROW(Exception,"Solver fails at minimal time step");
}
auto failed_dt = dt;
dt = std::max(dt*dtdec,dtmin);
_log->trace("Adapting time step to improve solver: "
"{:.2e} -> {:.2e}", failed_dt, dt);
}
// Calculate new iterations based on adapted time step
......
......@@ -13,6 +13,7 @@ namespace Dune{
enum Type {
Neumann, //!< Fixed flux at boundary
Dirichlet, //!< Fixed matric head at boundary
Outflow, //!< Fixed flux at boundary
Other //!< UNUSED
};
......@@ -26,6 +27,11 @@ namespace Dune{
{
return (i == Neumann);
}
//! Test for Outflow boundary condition
static bool isOutflow (Type i)
{
return (i == Outflow);
}
//! UNUSED: Test for other(?) boundary condition
static bool isOther (Type i)
{
......
......@@ -20,16 +20,16 @@ namespace Dune{
namespace Dorie{
/**
* @brief Enum class for output policy. It defines when a simulation class
* should produce an output
* @brief Enum class for output policy.
* @details It defines when a simulation class should produce an output.
*/
enum class OutputPolicy {None,EndOfStep};
enum class OutputPolicy {None,EndOfRichardsStep,EndOfTransportStep};
/**
* @brief Enum class for output policy. It defines which variable
* is the target in order to mark the grid
* @brief Enum class for output policy.
* @details It defines which variable is the target in order to mark the grid
*/