Commit 44586614 authored by Timo Koch's avatar Timo Koch Committed by Dennis Gläser
Browse files

Fix deprecation warnings gravity

parent de58f153
......@@ -156,7 +156,7 @@ class InteractionVolumeAssemblerBase
// gravitational acceleration on this face
const auto& curLocalScvf = iv.localScvf(faceIdx);
const auto& curGlobalScvf = fvGeometry().scvf(curLocalScvf.gridScvfIndex());
const auto& gravity = problem().gravityAtPos(curGlobalScvf.ipGlobal());
const auto& gravity = problem().spatialParams().gravity(curGlobalScvf.ipGlobal());
// get permeability tensor in "positive" sub volume
const auto& neighborScvIndices = curLocalScvf.neighboringLocalScvIndices();
......
......@@ -117,7 +117,7 @@ public:
}
if (enableGravity)
gradP.axpy(-rho, problem.gravityAtPos(scvf.center()));
gradP.axpy(-rho, problem.spatialParams().gravity(scvf.center()));
// apply the permeability and return the flux
return -1.0*vtmv(scvf.unitOuterNormal(), K, gradP)*scvf.area();
......
......@@ -179,7 +179,7 @@ class CCTpfaDarcysLaw<ScalarType, FVGridGeometry, /*isNetwork*/ false>
const auto pOutside = outsideVolVars.pressure(phaseIdx);
const auto& tij = fluxVarsCache.advectionTij();
const auto& g = problem.gravityAtPos(scvf.ipGlobal());
const auto& g = problem.spatialParams().gravity(scvf.ipGlobal());
//! compute alpha := n^T*K*g
const auto alpha_inside = vtmv(scvf.unitOuterNormal(), insideVolVars.permeability(), g)*insideVolVars.extrusionFactor();
......@@ -350,7 +350,7 @@ public:
}();
const auto& tij = fluxVarsCache.advectionTij();
const auto& g = problem.gravityAtPos(scvf.ipGlobal());
const auto& g = problem.spatialParams().gravity(scvf.ipGlobal());
// Obtain inside and outside pressures
const auto pInside = insideVolVars.pressure(phaseIdx);
......
......@@ -128,7 +128,7 @@ public:
static const bool gravity = getParamFromGroup<bool>(problem.paramGroup(), "Problem.EnableGravity");
if (gravity)
{
const auto& g = problem.gravityAtPos(scv.center());
const auto& g = problem.spatialParams().gravity(scv.center());
for (int dir = 0; dir < GridView::dimensionworld; ++dir)
source[Indices::momentum(dir)] += elemVolVars[scv].solidDensity()*g[dir];
}
......
......@@ -94,7 +94,7 @@ public:
const auto rhoAverage = phi*rhoFluid + (1.0 - phi*vv.solidDensity());
// add body force
const auto& g = problem.gravityAtPos(scv.center());
const auto& g = problem.spatialParams().gravity(scv.center());
for (int dir = 0; dir < GridView::dimensionworld; ++dir)
source[ Indices::momentum(dir) ] += rhoAverage*g[dir];
}
......
......@@ -186,7 +186,7 @@ public:
{
// do averaging for the density over all neighboring elements
const auto rho = (insideVolVars.density(phaseIdx) + outsideVolVars.density(phaseIdx))*0.5;
const auto& g = this->problem(domainI).gravityAtPos(scvf.ipGlobal());
const auto& g = this->problem(domainI).spatialParams().gravity(scvf.ipGlobal());
//! compute alpha := n^T*K*g
const auto alpha_inside = vtmv(scvf.unitOuterNormal(), insideVolVars.permeability(), g)*insideVolVars.extrusionFactor();
......
......@@ -455,7 +455,7 @@ protected:
const Scalar mu = context.volVars.viscosity(darcyPhaseIdx);
const Scalar rho = context.volVars.density(darcyPhaseIdx);
const Scalar distance = (context.element.geometry().center() - scvf.center()).two_norm();
const Scalar g = -scvf.directionSign() * couplingManager_.problem(darcyIdx).gravity()[scvf.directionIndex()];
const Scalar g = -scvf.directionSign() * couplingManager_.problem(darcyIdx).spatialParams().gravity(scvf.center())[scvf.directionIndex()];
const Scalar interfacePressure = ((scvf.directionSign() * velocity * (mu/darcyPermeability(element, scvf))) + rho * g) * distance + cellCenterPressure;
return interfacePressure;
}
......@@ -480,7 +480,7 @@ protected:
const Scalar mu = context.volVars.viscosity(darcyPhaseIdx);
const Scalar rho = context.volVars.density(darcyPhaseIdx);
const Scalar distance = (context.element.geometry().center() - scvf.center()).two_norm();
const Scalar g = -scvf.directionSign() * couplingManager_.problem(darcyIdx).gravity()[scvf.directionIndex()];
const Scalar g = -scvf.directionSign() * couplingManager_.problem(darcyIdx).spatialParams().gravity(scvf.center())[scvf.directionIndex()];
// get the Forchheimer coefficient
Scalar cF = 0.0;
......
......@@ -123,7 +123,7 @@ public:
static const bool enableGravity = getParamFromGroup<bool>(problem.paramGroup(), "Problem.EnableGravity");
if (enableGravity)
flux -= rho*scvf.area()*insideVolVars.extrusionFactor()
*vtmv(scvf.unitOuterNormal(), insideVolVars.permeability(), problem.gravityAtPos(scvf.center()));
*vtmv(scvf.unitOuterNormal(), insideVolVars.permeability(), problem.spatialParams().gravity(scvf.center()));
return flux;
}
......
......@@ -147,7 +147,7 @@ public:
// gravitational acceleration on this face
const auto& curLocalScvf = iv.localScvf(faceIdx);
const auto& curGlobalScvf = this->fvGeometry().scvf(curLocalScvf.gridScvfIndex());
const auto& gravity = this->problem().gravityAtPos(curGlobalScvf.ipGlobal());
const auto& gravity = this->problem().spatialParams().gravity(curGlobalScvf.ipGlobal());
const auto curIsInteriorBoundary = curLocalScvf.isOnInteriorBoundary();
const Scalar curXiFactor = curIsInteriorBoundary ? (curGlobalScvf.boundary() ? 1.0 : xi) : 1.0;
......
......@@ -201,7 +201,7 @@ class CCTpfaFacetCouplingDarcysLawImpl<ScalarType, FVGridGeometry, /*isNetwork*/
if (gravity)
{
// compute alpha := n^T*K*g and add to flux (use arithmetic mean for density)
const auto& g = problem.gravityAtPos(scvf.ipGlobal());
const auto& g = problem.spatialParams().gravity(scvf.ipGlobal());
const auto rho = 0.5*(insideVolVars.density(phaseIdx) + facetVolVars.density(phaseIdx));
const auto rhoTimesArea = rho*scvf.area();
const auto alpha_inside = rhoTimesArea*insideVolVars.extrusionFactor()
......
......@@ -312,7 +312,7 @@ public:
PrimaryVariables values(0.0);
values.setState(initialPhasePresence_);
values[pressureIdx] = pressure_ + 1000. * this->gravity()[1] * (globalPos[1] - this->fvGridGeometry().bBoxMax()[1]);
values[pressureIdx] = pressure_ + 1000. * this->spatialParams().gravity(globalPos)[1] * (globalPos[1] - this->fvGridGeometry().bBoxMax()[1]);
values[switchIdx] = initialSw_;
#if NONISOTHERMAL
......
......@@ -162,7 +162,7 @@ public:
//! Evaluates the initial conditions.
PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
{
const auto g = this->gravityAtPos(globalPos)[dimWorld-1];
const auto g = this->spatialParams().gravity(globalPos)[dimWorld-1];
const auto h = 1.0 - (3.0-globalPos[dimWorld-1])*g;
return PrimaryVariables(h);
}
......
......@@ -158,7 +158,7 @@ public:
//! Evaluates the initial conditions.
PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
{
const auto g = this->gravityAtPos(globalPos)[dimWorld-1];
const auto g = this->spatialParams().gravity(globalPos)[dimWorld-1];
const auto h = 1.0 - (3.0-globalPos[dimWorld-1])*g;
return PrimaryVariables(h);
}
......
......@@ -210,7 +210,7 @@ public:
// hydrostatic pressure
Scalar densityW = 1000;
values[Indices::pressureIdx] = 1e5 + densityW*(this->gravity()*globalPos);
values[Indices::pressureIdx] = 1e5 + densityW*(this->spatialParams().gravity(globalPos)*globalPos);
values[Indices::saturationIdx] = 0.0;
return values;
......
......@@ -194,7 +194,7 @@ public:
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
{
const auto depth = this->fvGridGeometry().bBoxMax()[dimWorld-1] - globalPos[dimWorld-1];
const auto g = this->gravityAtPos(globalPos)[dimWorld-1];
const auto g = this->spatialParams().gravity(globalPos)[dimWorld-1];
PrimaryVariables values;
values[pressureIdx] = 1e5 + 1000*g*depth;
......
......@@ -171,7 +171,7 @@ public:
Scalar factor = (width*alpha + (1.0 - alpha)*globalPos[0])/width;
// hydrostatic pressure scaled by alpha
values[pressureH2OIdx] = 1e5 - factor*densityW*this->gravity()[1]*depth;
values[pressureH2OIdx] = 1e5 - factor*densityW*this->spatialParams().gravity(globalPos)[1]*depth;
values[saturationDNAPLIdx] = 0.0;
return values;
......@@ -216,7 +216,7 @@ public:
Scalar depth = this->fvGridGeometry().bBoxMax()[1] - globalPos[1];
// hydrostatic pressure
values[pressureH2OIdx] = 1e5 - densityW*this->gravity()[1]*depth;
values[pressureH2OIdx] = 1e5 - densityW*this->spatialParams().gravity(globalPos)[1]*depth;
values[saturationDNAPLIdx] = 0;
return values;
}
......
......@@ -333,7 +333,7 @@ private:
Scalar densityW = FluidSystem::H2O::liquidDensity(temperature_, 1e5);
Scalar pl = 1e5 - densityW*this->gravity()[1]*(depthBOR_ - globalPos[1]);
Scalar pl = 1e5 - densityW*this->spatialParams().gravity(globalPos)[1]*(depthBOR_ - globalPos[1]);
Scalar moleFracLiquidN2 = pl*0.95/BinaryCoeff::H2O_N2::henry(temperature_);
Scalar moleFracLiquidH2O = 1.0 - moleFracLiquidN2;
......
......@@ -474,7 +474,7 @@ private:
else // mass-fraction formulation
values[switchIdx] = moleFracLiquidCO2*FluidSystem::molarMass(CO2Idx)/meanM;
values[pressureIdx] = 1.0e5 - densityW*this->gravity()[dimWorld-1]*(depthBOR_ - globalPos[dimWorld-1]);
values[pressureIdx] = 1.0e5 - densityW*this->spatialParams().gravity(globalPos)[dimWorld-1]*(depthBOR_ - globalPos[dimWorld-1]);
#if !ISOTHERMAL
values[temperatureIdx] = temp;
......
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