The TS-GitLab will have to shut down towards the end of the year — please think about migrating your projects to GitLab.com or GitHub.
(This is still a very early message, meant to keep you informed. There will be more urgent ones in the future.)

Commit 7eea57f4 authored by Santiago Ospina's avatar Santiago Ospina
Browse files

Improve documentation of solute transpor object


Signed-off-by: Santiago Ospina De Los Ríos's avatarSantiago Ospina <santiago.ospina@iup.uni-heidelberg.de>
parent b672d79c
......@@ -277,11 +277,12 @@ protected:
public:
/*------------------------------------------------------------------------*//**
* @brief Construct basic simulation. Prepare setup for basic simulation.
* @brief Construct basic simulation. Prepare setup for basic
* simulation.
*
* @param _grid_mapper Mapper for grid and volume/boundary data
* @param _helper Dune MPI instance controller
* @param _inifile Dune parameter file parser
* @param _inifile Dune parameter file parser
* @param _grid_mapper Mapper for grid and volume/boundary data
* @param _helper Dune MPI instance controller
*/
RichardsSimulation (
Dune::ParameterTree& _inifile,
......@@ -294,8 +295,6 @@ public:
* SimulationBase
*
* @throws Dune::Exception Fatal error occurs during computation
*
* @return The time step.
*/
void step () override;
......@@ -340,15 +339,13 @@ public:
* @brief Suggest a time step to the model.
*
* @param[in] dt Suggestion for the internal time step of the model. The
* new internal time step shall not be bigger than dt
* new internal time step shall not be bigger than dt.
*/
void suggest_timestep(double dt) final {controller->suggest_timestep(dt);}
/*------------------------------------------------------------------------*//**
* @brief Write the data using the VTKWriter. VTKWriters is always
* cleared after used.
*
* @param[in] time The time to print in th pvd file.
*/
void virtual write_data() const override;
......
......@@ -71,8 +71,6 @@ struct TransportSimulationTraits : public BaseTraits
using GridMapper = Dune::Dorie::GridMapper<typename BaseTraits::Grid>;
/// Class defining boundary conditions
using SoluteBoundary = Dune::Dorie::SoluteBoundary<BaseTraits>;
/// Class defining source terms
// using SoluteSource = Dune::Dorie::SoluteSource<BaseTraits,Parameters>; // TODO
/// Class defining the initial condition
using SoluteInitial = Dune::Dorie::SoluteInitial<BaseTraits>;
/// Local spatial operator
......@@ -157,8 +155,6 @@ protected:
using GridMapper = typename Traits::GridMapper;
/// Class defining boundary conditions
using SoluteBoundary = typename Traits::SoluteBoundary;
/// Class defining source terms
// using SoluteSource = typename Traits::SoluteSource; // TODO
/// Class defining the initial condition
using SoluteInitial = typename Traits::SoluteInitial;
/// Local spatial operator
......@@ -207,7 +203,6 @@ protected:
std::unique_ptr<CC> cc;
std::unique_ptr<SoluteBoundary> sboundary;
// std::unique_ptr<SoluteSource> ssource;
std::unique_ptr<SoluteInitial> sinitial;
std::unique_ptr<CalculationController> controller;
......@@ -243,12 +238,12 @@ protected:
bool operator_setup_flag = true;
public:
/*------------------------------------------------------------------------*//**
/*-----------------------------------------------------------------------*//**
* @brief Construct basic simulation. Prepare setup for basic simulation.
*
* @param _grid_mapper Mapper for grid and volume/boundary data
* @param _helper Dune MPI instance controller
* @param _inifile Dune parameter file parser
* @param _inifile Dune parameter file parser
* @param _grid_mapper Mapper for grid and volume/boundary data
* @param _helper Dune MPI instance controller
*/
TransportSimulation (
Dune::ParameterTree& _inifile,
......@@ -256,52 +251,90 @@ public:
Dune::MPIHelper& _helper
);
// TODO: Define data exchange with richards
void set_waterflux(TimeInterval _time_interval, std::shared_ptr<GFWaterFlux> _gf_water_flux)
/*------------------------------------------------------------------------*//**
* @brief Compute a time step. Models the time step requirement of
* SimulationBase
*
* @throws Dune::Exception Fatal error occurs during computation
*/
void step () override;
/*-----------------------------------------------------------------------*//**
* @brief Method that provides the begin time of the model.
*
* @return Begin time of the model.
*/
double begin_time() const final {return controller->getBeginTime();}
/*-----------------------------------------------------------------------*//**
* @brief Method that provides the end time of the model.
*
* @return End time of the model.
*/
double end_time() const final {return controller->getEndTime();}
/*-----------------------------------------------------------------------*//**
* @brief Method that provides the current time of the model.
*
* @return Current time of the model.
*/
double current_time() const final {return controller->getTime();}
/*-----------------------------------------------------------------------*//**
* @brief Suggest a time step to the model.
*
* @param[in] dt Suggestion for the internal time step of the model. The
* new internal time step shall not be bigger than dt.
*/
void suggest_timestep(TimeField dt) final {controller->suggest_timestep(dt);}
/*-----------------------------------------------------------------------*//**
* @brief Sets a function for the water flux for a given time interval.
*
* @param[in] _time_interval The time interval.
* @param[in] _gf_water_flux The grid function water flux.
*/
void set_water_flux( TimeInterval _time_interval,
std::shared_ptr<GFWaterFlux> _gf_water_flux)
{
if (_gf_water_flux)
{
water_flux_interval = _time_interval;
gf_water_flux = _gf_water_flux;
} else
DUNE_THROW(Dune::Exception,"Pointer to gfWaterFlux is invalid!");
DUNE_THROW(Dune::InvalidStateException,
"Pointer to gf_water_flux is invalid!");
}
// TODO: Define data exchange with richards
void set_saturation(TimeInterval _time_interval, std::shared_ptr<GFSaturation> _gf_saturation)
/*-----------------------------------------------------------------------*//**
* @brief Sets a function for the saturation for a given time interval.
*
* @param[in] _time_interval The time interval.
* @param[in] _gf_saturation The grid function saturation
*/
void set_saturation(TimeInterval _time_interval,
std::shared_ptr<GFSaturation> _gf_saturation)
{
if (_gf_saturation)
{
saturation_interval = _time_interval;
gf_saturation = _gf_saturation;
} else
DUNE_THROW(Dune::Exception,"Pointer to gfWaterFlux is invalid!");
}
void step () override;
TimeField begin_time() const override
{
return inifile.get<TimeField>("time.start");
DUNE_THROW(Dune::InvalidStateException,
"Pointer to gf_saturation is invalid!");
}
TimeField end_time() const override
{
return inifile.get<TimeField>("time.end");
}
TimeField current_time() const override
{
return controller->getTime();
}
void suggest_timestep(TimeField dt) final {controller->suggest_timestep(dt);}
// TODO: Define data exchange with richards
/*-----------------------------------------------------------------------*//**
* @brief Get a function for the solute for the current time of the
* model.
*
* @return A pointer to a grid function of solute.
*/
std::shared_ptr<GFSolute> get_solute()
{
if (!c_w)
DUNE_THROW(Dune::Exception,"Solute in invalid state!");
DUNE_THROW(Dune::InvalidStateException,"Pointer to c_w in invalid state!");
return c_w;
}
......
......@@ -25,7 +25,7 @@ namespace Dorie{
* number \f$\varrho \le 1\f$:
*
* @f{eqnarray*}{
* \Delta t \lt \varrho \cdot \mathcal{CFL}
* \Delta t \le \varrho \cdot \mathcal{CFL}
* @f}
*
* @param[in] gf Grid function representing the veolcity field
......
......@@ -122,7 +122,7 @@ int main(int argc, char** argv) {
typename Traits::TimeInterval interval{sim.begin_time(),sim.end_time()};
sim.set_waterflux(interval,gf_flux);
sim.set_water_flux(interval,gf_flux);
sim.set_saturation(interval,gf_sat);
sim.run();
......@@ -156,7 +156,7 @@ int main(int argc, char** argv) {
typename Traits::TimeInterval interval{sim.begin_time(),sim.end_time()};
sim.set_waterflux(interval,gf_flux);
sim.set_water_flux(interval,gf_flux);
sim.set_saturation(interval,gf_sat);
sim.run();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment