Skip to content
Snippets Groups Projects
Commit 5215cff6 authored by René Heß's avatar René Heß
Browse files

[WIP] Get rho and mu from ini file

parent 19feadc9
No related branches found
No related tags found
No related merge requests found
......@@ -137,9 +137,9 @@ void taylor_green (const GV& gv, const Dune::ParameterTree& configuration, std::
using BType = BCTypeParamGlobalDirichlet;
BType b;
using VType = TaylorGreenVelocity<ES,RF,dim>;
VType v(es);
VType v(es, configuration.sub("parameters"));
using PType = TaylorGreenPressure<ES,RF>;
PType p(es);
PType p(es, configuration.sub("parameters"));
using PenaltyTerm = Dune::PDELab::DefaultInteriorPenalty<RF>;
// Local operator
......@@ -197,9 +197,9 @@ void taylor_green (const GV& gv, const Dune::ParameterTree& configuration, std::
// Create initial solution
using InitialVelocity = TaylorGreenVelocity<GV,RF,2>;
InitialVelocity initial_velocity(gv);
InitialVelocity initial_velocity(gv, configuration.sub("parameters"));
using InitialPressure = TaylorGreenPressure<GV,RF>;
InitialPressure initial_pressure(gv);
InitialPressure initial_pressure(gv, configuration.sub("parameters"));
typedef Dune::PDELab::CompositeGridFunction<InitialVelocity,InitialPressure> InitialSolution;
InitialSolution initial_solution(initial_velocity, initial_pressure);
......@@ -226,7 +226,7 @@ void taylor_green (const GV& gv, const Dune::ParameterTree& configuration, std::
// Time loop
V x(gfs,0.0);
int step = 0;
const int nth = 10;
const int nth = 1;
while (time < time_end - dt_min*0.5){
osm.apply(time,dt,xold,x);
......
......@@ -45,8 +45,10 @@ public:
typedef typename Traits::DomainType DomainType;
typedef typename Traits::RangeType RangeType;
TaylorGreenVelocity(const GV & gv) : BaseT(gv)
TaylorGreenVelocity(const GV & gv, const Dune::ParameterTree& params) : BaseT(gv)
{
mu = params.get<RF>("mu");
rho = params.get<RF>("rho");
time = 0.0;
}
......@@ -54,8 +56,6 @@ public:
{
// TODO Get mu and rho from somewhere else!
RF pi = 3.14159265358979323846;
RF mu = 1.0/100;
RF rho = 1.0;
RF nu = mu/rho;
y[0] = -exp(-2.0*pi*pi*nu*time)*cos(pi*x[0])*sin(pi*x[1]);
y[1] = exp(-2.0*pi*pi*nu*time)*sin(pi*x[0])*cos(pi*x[1]);
......@@ -67,6 +67,8 @@ public:
}
private:
RF rho;
RF mu;
RF time;
};
......@@ -84,8 +86,10 @@ public:
typedef typename Traits::DomainType DomainType;
typedef typename Traits::RangeType RangeType;
TaylorGreenPressure (const GV& gv) : BaseT(gv)
TaylorGreenPressure (const GV& gv, const Dune::ParameterTree& params) : BaseT(gv)
{
mu = params.get<RF>("mu");
rho = params.get<RF>("rho");
time = 0.0;
}
......@@ -93,8 +97,6 @@ public:
typename Traits::RangeType& y) const
{
RF pi = 3.14159265358979323846;
RF mu = 1.0/100;
RF rho = 1.0;
RF nu = mu/rho;
y = -0.25*rho*exp(-4.0*pi*pi*nu*time)*(cos(2.0*pi*x[0])+cos(2.0*pi*x[1]));
}
......@@ -105,6 +107,8 @@ public:
}
private:
RF rho;
RF mu;
RF time;
};
......
......@@ -2,7 +2,7 @@
[parameters]
rho = 1.0
mu = 0.01
mu = 1.0
[parameters.dg]
epsilon = -1
sigma = 1.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment