Commit ec7aef75 authored by Timo Koch's avatar Timo Koch Committed by Kilian Weishaupt
Browse files

[upwind] Rename parameter from Implicit.UpwindWeight to Flux.UpwindWeight

parent 25f01fd2
......@@ -275,7 +275,7 @@ private:
static void globalDefaultParameters(Dune::ParameterTree& params)
{
// parameters in the implicit group
params["Implicit.UpwindWeight"] = "1.0";
params["Flux.UpwindWeight"] = "1.0";
params["Implicit.EnableJacobianRecycling"] = "false";
// parameters in the assembly group
......
......@@ -494,7 +494,7 @@ private:
const UpwindTermFunction& upwindTerm,
const bool insideIsUpstream)
{
static const Scalar upwindWeight = getParam<Scalar>("Implicit.UpwindWeight");
static const Scalar upwindWeight = getParam<Scalar>("Flux.UpwindWeight");
const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
......
......@@ -53,7 +53,7 @@ public:
Scalar flux, int phaseIdx)
{
// TODO: pass this from outside?
static const Scalar upwindWeight = getParam<Scalar>("Implicit.UpwindWeight");
static const Scalar upwindWeight = getParam<Scalar>("Flux.UpwindWeight");
const auto& elemVolVars = fluxVars.elemVolVars();
const auto& scvf = fluxVars.scvFace();
......@@ -87,7 +87,7 @@ public:
const UpwindTermFunction& upwindTerm,
Scalar flux, int phaseIdx)
{
static const Scalar upwindWeight = getParam<Scalar>("Implicit.UpwindWeight");
static const Scalar upwindWeight = getParam<Scalar>("Flux.UpwindWeight");
// the volume variables of the inside sub-control volume
const auto& scvf = fluxVars.scvFace();
......@@ -166,7 +166,7 @@ public:
const UpwindTermFunction& upwindTerm,
Scalar flux, int phaseIdx)
{
static const Scalar upwindWeight = getParam<Scalar>("Implicit.UpwindWeight");
static const Scalar upwindWeight = getParam<Scalar>("Flux.UpwindWeight");
const auto& scvf = fluxVars.scvFace();
const auto& elemVolVars = fluxVars.elemVolVars();
......
......@@ -101,7 +101,7 @@ public:
{
const Scalar velocity = elemFaceVars[scvf].velocitySelf();
const bool insideIsUpstream = scvf.directionSign() == sign(velocity);
static const Scalar upWindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Implicit.UpwindWeight");
static const Scalar upWindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Flux.UpwindWeight");
const auto& insideVolVars = elemVolVars[scvf.insideScvIdx()];
const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
......@@ -209,7 +209,7 @@ public:
// Lamba function to evaluate the transported momentum, regarding an user-specified upwind weight.
auto computeMomentum = [&insideVolVars, &problem](const Scalar upstreamVelocity, const Scalar downstreamVelocity)
{
static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Implicit.UpwindWeight");
static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Flux.UpwindWeight");
return (upwindWeight * upstreamVelocity + (1.0 - upwindWeight) * downstreamVelocity) * insideVolVars.density();
};
......@@ -401,7 +401,7 @@ private:
const Scalar upstreamVelocity,
const Scalar downstreamVelocity)
{
static const Scalar upWindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Implicit.UpwindWeight");
static const Scalar upWindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Flux.UpwindWeight");
const Scalar density = upWindWeight * upstreamVolVars.density() + (1.0 - upWindWeight) * downstreamVolVars.density();
const Scalar transportedVelocity = upWindWeight * upstreamVelocity + (1.0 - upWindWeight) * downstreamVelocity;
return transportedVelocity * density;
......
......@@ -214,7 +214,7 @@ public:
}
// upwind scheme
static const Scalar upwindWeight = getParam<Scalar>("Implicit.UpwindWeight");
static const Scalar upwindWeight = getParam<Scalar>("Flux.UpwindWeight");
auto upwindTerm = [phaseIdx](const auto& volVars){ return volVars.density(phaseIdx)*volVars.mobility(phaseIdx); };
if (std::signbit(flux)) // if sign of flux is negative
flux *= (upwindWeight*upwindTerm(outsideVolVars)
......
......@@ -343,7 +343,7 @@ public:
*/
Scalar advectiveFlux(const Scalar insideQuantity, const Scalar outsideQuantity, const Scalar volumeFlow, bool insideIsUpstream) const
{
const Scalar upwindWeight = 1.0; //TODO use Implicit.UpwindWeight or something like Coupling.UpwindWeight?
const Scalar upwindWeight = 1.0; //TODO use Flux.UpwindWeight or something like Coupling.UpwindWeight?
if(insideIsUpstream)
return (upwindWeight * insideQuantity + (1.0 - upwindWeight) * outsideQuantity) * volumeFlow;
......
......@@ -49,7 +49,7 @@ public:
Scalar flux, int phaseIdx)
{
// TODO: pass this from outside?
static const Scalar upwindWeight = getParam<Scalar>("Implicit.UpwindWeight");
static const Scalar upwindWeight = getParam<Scalar>("Flux.UpwindWeight");
const auto& elemVolVars = fluxVars.elemVolVars();
const auto& scvf = fluxVars.scvFace();
......
......@@ -54,7 +54,7 @@ public:
const UpwindTermFunction& upwindTerm,
Scalar flux, int phaseIdx)
{
static const Scalar upwindWeight = getParam<Scalar>("Implicit.UpwindWeight");
static const Scalar upwindWeight = getParam<Scalar>("Flux.UpwindWeight");
// the volume variables of the inside sub-control volume
const auto& scvf = fluxVars.scvFace();
......@@ -147,7 +147,7 @@ public:
const UpwindTermFunction& upwindTerm,
Scalar flux, int phaseIdx)
{
static const Scalar upwindWeight = getParam<Scalar>("Implicit.UpwindWeight");
static const Scalar upwindWeight = getParam<Scalar>("Flux.UpwindWeight");
const auto& scvf = fluxVars.scvFace();
const auto& elemVolVars = fluxVars.elemVolVars();
......
......@@ -174,7 +174,7 @@ public:
using AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>;
// evaluate the current wetting phase Darcy flux and resulting upwind weights
static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Implicit.UpwindWeight");
static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Flux.UpwindWeight");
const auto flux_w = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 0, elemFluxVarsCache);
const auto flux_n = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 1, elemFluxVarsCache);
const auto insideWeight_w = std::signbit(flux_w) ? (1.0 - upwindWeight) : upwindWeight;
......@@ -292,7 +292,7 @@ public:
using AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>;
// evaluate the current wetting phase Darcy flux and resulting upwind weights
static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Implicit.UpwindWeight");
static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Flux.UpwindWeight");
const auto flux_w = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 0, elemFluxVarsCache);
const auto flux_n = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 1, elemFluxVarsCache);
const auto insideWeight_w = std::signbit(flux_w) ? (1.0 - upwindWeight) : upwindWeight;
......@@ -437,7 +437,7 @@ public:
using AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>;
// evaluate the current wetting phase Darcy flux and resulting upwind weights
static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Implicit.UpwindWeight");
static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Flux.UpwindWeight");
const auto flux_w = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 0, elemFluxVarsCache);
const auto flux_n = AdvectionType::flux(problem, element, fvGeometry, curElemVolVars, scvf, 1, elemFluxVarsCache);
const auto insideWeight_w = std::signbit(flux_w) ? (1.0 - upwindWeight) : upwindWeight;
......
......@@ -223,7 +223,7 @@ public:
const auto volFlux = problem.spatialParams().volumeFlux(element, fvGeometry, curElemVolVars, scvf);
// the upwind weight
static const Scalar upwindWeight = getParam<Scalar>("Implicit.UpwindWeight");
static const Scalar upwindWeight = getParam<Scalar>("Flux.UpwindWeight");
// get the inside and outside volvars
const auto& insideVolVars = curElemVolVars[scvf.insideScvIdx()];
......@@ -268,7 +268,7 @@ public:
const auto volFlux = problem.spatialParams().volumeFlux(element, fvGeometry, curElemVolVars, scvf);
// the upwind weight
static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Implicit.UpwindWeight");
static const Scalar upwindWeight = getParamFromGroup<Scalar>(problem.paramGroup(), "Flux.UpwindWeight");
// get the inside and outside volvars
const auto& insideVolVars = curElemVolVars[scvf.insideScvIdx()];
......
......@@ -27,5 +27,5 @@ NumericDifference.BaseEpsilon = 1e-8
[Vtk]
WriteFaceData = false
[Implicit]
[Flux]
UpwindWeight = 0.5 # set to 0.5 for reproducing Ghia et al. (1982)
Supports Markdown
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