From ec7aef75bb7c3cb13414530c17361c6122e957c1 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Sat, 24 Nov 2018 19:05:10 +0100 Subject: [PATCH] [upwind] Rename parameter from Implicit.UpwindWeight to Flux.UpwindWeight --- dumux/common/parameters.hh | 2 +- dumux/discretization/cellcentered/tpfa/forchheimerslaw.hh | 2 +- dumux/flux/upwindscheme.hh | 6 +++--- dumux/freeflow/navierstokes/staggered/fluxvariables.hh | 6 +++--- dumux/multidomain/boundary/darcydarcy/couplingmanager.hh | 2 +- dumux/multidomain/boundary/stokesdarcy/couplingdata.hh | 2 +- dumux/multidomain/facet/box/upwindscheme.hh | 2 +- dumux/multidomain/facet/cellcentered/upwindscheme.hh | 4 ++-- dumux/porousmediumflow/2p/incompressiblelocalresidual.hh | 6 +++--- dumux/porousmediumflow/tracer/localresidual.hh | 4 ++-- test/freeflow/navierstokes/closedsystem/params_re1000.input | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dumux/common/parameters.hh b/dumux/common/parameters.hh index e5ae2ae4f1..c1cf27ff71 100644 --- a/dumux/common/parameters.hh +++ b/dumux/common/parameters.hh @@ -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 diff --git a/dumux/discretization/cellcentered/tpfa/forchheimerslaw.hh b/dumux/discretization/cellcentered/tpfa/forchheimerslaw.hh index 214dc17aaa..d8445cf063 100644 --- a/dumux/discretization/cellcentered/tpfa/forchheimerslaw.hh +++ b/dumux/discretization/cellcentered/tpfa/forchheimerslaw.hh @@ -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()]; diff --git a/dumux/flux/upwindscheme.hh b/dumux/flux/upwindscheme.hh index e4744f02fa..4c426c4e41 100644 --- a/dumux/flux/upwindscheme.hh +++ b/dumux/flux/upwindscheme.hh @@ -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(); diff --git a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh index f308c4607b..dff9451495 100644 --- a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh +++ b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh @@ -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; diff --git a/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh b/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh index 7cc9e57f01..d2afc37ea0 100644 --- a/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh +++ b/dumux/multidomain/boundary/darcydarcy/couplingmanager.hh @@ -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) diff --git a/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh b/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh index 7f1df26991..e02f16123e 100644 --- a/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh +++ b/dumux/multidomain/boundary/stokesdarcy/couplingdata.hh @@ -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; diff --git a/dumux/multidomain/facet/box/upwindscheme.hh b/dumux/multidomain/facet/box/upwindscheme.hh index a31036bbb1..75bc1a0baa 100644 --- a/dumux/multidomain/facet/box/upwindscheme.hh +++ b/dumux/multidomain/facet/box/upwindscheme.hh @@ -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(); diff --git a/dumux/multidomain/facet/cellcentered/upwindscheme.hh b/dumux/multidomain/facet/cellcentered/upwindscheme.hh index 99bce0df22..9b560658e1 100644 --- a/dumux/multidomain/facet/cellcentered/upwindscheme.hh +++ b/dumux/multidomain/facet/cellcentered/upwindscheme.hh @@ -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(); diff --git a/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh index 3383da378a..0d187dca2c 100644 --- a/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh +++ b/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh @@ -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; diff --git a/dumux/porousmediumflow/tracer/localresidual.hh b/dumux/porousmediumflow/tracer/localresidual.hh index 0cd193d974..f78b6017fa 100644 --- a/dumux/porousmediumflow/tracer/localresidual.hh +++ b/dumux/porousmediumflow/tracer/localresidual.hh @@ -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()]; diff --git a/test/freeflow/navierstokes/closedsystem/params_re1000.input b/test/freeflow/navierstokes/closedsystem/params_re1000.input index cd5be48163..e7f2090e67 100644 --- a/test/freeflow/navierstokes/closedsystem/params_re1000.input +++ b/test/freeflow/navierstokes/closedsystem/params_re1000.input @@ -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) -- GitLab