Commit b64580a8 authored by Santiago Ospina's avatar Santiago Ospina

Add the courant number to the interface

Signed-off-by: Santiago Ospina De Los Ríos's avatarSantiago Ospina <santiago.ospina@iup.uni-heidelberg.de>
parent a2ec6585
......@@ -177,7 +177,7 @@ adding an empty line, make text **bold** or ``monospaced``.
<parameter name="molecularDiffusion">
<definition> Molecular diffusion of the fluid phase </definition>
<values> float &gt; 0 </values>
<comment> 2E-9 </comment>
<suggestion> 2E-9 </suggestion>
</parameter>
</category>
......@@ -186,7 +186,16 @@ adding an empty line, make text **bold** or ``monospaced``.
<definition> Numerical scheme to perform time steps in the simulation
</definition>
<values> string </values>
<suggestion> explicit_euler, implicit_euler, heun, shu3, rk4, alex2, fractional, alex3 </suggestion>
<suggestion> explicit_euler, implicit_euler, heun, shu3, rk4, alex2, fractional, alex3
</suggestion>
</parameter>
<parameter name="courant">
<definition> Courant number for explicit methods. Explicit methods have a
maximum time step according to the CFL condition.
</definition>
<values> float &gt; 0 </values>
<suggestion> 0.8 </suggestion>
</parameter>
</category>
</dorie>
......@@ -86,9 +86,9 @@ void TransportSimulation<Traits>::operator_setup ()
// --- Local Operators ---
double diff_coeff = inifile.get<double>("parameters.molecularDiffusion");
slop = std::make_unique<SLOP>(*sboundary,gf_water_flux,gf_saturation,diff_coeff /*inifile,*param,gv,*fboundary,*fsource*/);
slop = std::make_unique<SLOP>(*sboundary,gf_water_flux,gf_saturation,diff_coeff);
tlop = std::make_unique<TLOP>(gf_saturation/*inifile,*param,gv*/);
tlop = std::make_unique<TLOP>(gf_saturation);
Dune::PDELab::constraints(*this->gfs,*this->cc,false);
// --- Grid Operators ---
......@@ -100,16 +100,9 @@ void TransportSimulation<Traits>::operator_setup ()
ls = std::make_unique<LS>();
pdesolver = std::make_unique<PDESOLVER>(*igo,*ls,1e-6);
// pdesolver->setParameters(inifile.sub("NewtonParameters"));
// pdesolver->setVerbosityLevel(verbose);
// --- Time Step Operators ---
// Dune::PDELab::OneStepMethodResult osm_result;
// if(osm){
// osm_result = osm->result(); // cache old result
// }
osm = std::make_unique<OSM>(*ts_param,*igo,*pdesolver);
// osm->setResult(osm_result);
osm->setVerbosityLevel(verbose+1);
gfs->update();
......@@ -143,9 +136,10 @@ void TransportSimulation<Traits>::step ()
// Suggest times step for explicit methods.
// This assumes that timestep is never increased on failure!
if (not ts_param->implicit()) {
double courant_number = 0.2; //FIXME: add keyword in inifile
double courant = inifile.get<double>("numerics.courant");
assert(courant>0.);
const auto cfl = Dune::Dorie::cfl_condition(*gf_water_flux);
controller->suggest_timestep(courant_number*cfl);
controller->suggest_timestep(courant*cfl);
}
while (not succeed)
......
......@@ -206,7 +206,7 @@ public:
// Inside solute value
RF u = x_i(lfsu_i,0);
#if 1
#if 0
// Upwinding
u = (water_flux_n>=0) ? x_i(lfsu_i,0) : x_o(lfsu_o,0);
#endif
......
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