Commit 499b8813 authored by Martin Schneider's avatar Martin Schneider
Browse files

[course][exercises] Use new gravity method

parent 9b6857a8
......@@ -251,7 +251,7 @@ public:
// assume an intially hydrostatic liquid pressure profile
// note: we subtract rho_w*g*h because g is defined negative
const Scalar pw = 1.0e5 - densityW*this->gravity()[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
const Scalar pw = 1.0e5 - densityW*this->spatialParams().gravity(globalPos)[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
// initially we have some nitrogen dissolved
// saturation mole fraction would be
......
......@@ -253,7 +253,7 @@ public:
// assume an intially hydrostatic liquid pressure profile
// note: we subtract rho_w*g*h because g is defined negative
const Scalar pw = 1.0e5 - densityW*this->gravity()[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
const Scalar pw = 1.0e5 - densityW*this->spatialParams().gravity(globalPos)[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
values[Indices::pressureIdx] = pw;
values[Indices::saturationIdx] = 0.0;
......
......@@ -250,7 +250,7 @@ public:
// assume an intially hydrostatic liquid pressure profile
// note: we subtract rho_w*g*h because g is defined negative
const Scalar pw = 1.0e5 - densityW*this->gravity()[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
const Scalar pw = 1.0e5 - densityW*this->spatialParams().gravity(globalPos)[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
values[Indices::pressureIdx] = pw;
values[Indices::saturationIdx] = 0.0;
......
......@@ -283,7 +283,7 @@ public:
PrimaryVariables values(0.0);
values.setState(initialPhasePresence_);
values[pressureIdx] = pressure_ + 1. * this->gravity()[1] * (globalPos[1] - this->fvGridGeometry().bBoxMax()[1]);
values[pressureIdx] = pressure_ + 1. * this->spatialParams().gravity(globalPos)[1] * (globalPos[1] - this->fvGridGeometry().bBoxMax()[1]);
values[switchIdx] = initialSw_;
values[Indices::temperatureIdx] = temperature_;
......
......@@ -182,7 +182,7 @@ public:
const auto domainHeight = this->fvGridGeometry().bBoxMax()[1];
// we assume a constant water density of 1000 for initial conditions!
const auto& g = this->gravityAtPos(globalPos);
const auto& g = this->spatialParams().gravity(globalPos);
PrimaryVariables values;
Scalar densityW = 1000.0;
values[pressureIdx] = 1e5 - (domainHeight - globalPos[1])*densityW*g[1];
......
......@@ -199,7 +199,7 @@ public:
const auto domainHeight = this->fvGridGeometry().bBoxMax()[1];
// we assume a constant water density of 1000 for initial conditions!
const auto& g = this->gravityAtPos(globalPos);
const auto& g = this->spatialParams().gravity(globalPos);
PrimaryVariables values;
Scalar densityW = 1000.0;
values[pressureIdx] = 1e5 - (domainHeight - globalPos[1])*densityW*g[1];
......
......@@ -241,7 +241,7 @@ public:
// assume an intially hydrostatic liquid pressure profile
// note: we subtract rho_w*g*h because g is defined negative
const Scalar pw = 1.0e5 - densityW*this->gravity()[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
const Scalar pw = 1.0e5 - densityW*this->spatialParams().gravity(globalPos)[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
values[Indices::pressureIdx] = pw;
values[Indices::saturationIdx] = 0.0;
......
......@@ -157,7 +157,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;
......@@ -203,7 +203,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;
}
......
......@@ -242,7 +242,7 @@ public:
// assume an intially hydrostatic liquid pressure profile
// note: we subtract rho_w*g*h because g is defined negative
const Scalar pw = 1.0e5 - densityW*this->gravity()[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
const Scalar pw = 1.0e5 - densityW*this->spatialParams().gravity(globalPos)[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
values[Indices::pressureIdx] = pw;
values[Indices::saturationIdx] = 0.0;
......
......@@ -242,7 +242,7 @@ public:
// assume an intially hydrostatic liquid pressure profile
// note: we subtract rho_w*g*h because g is defined negative
const Scalar pw = 1.0e5 - densityW*this->gravity()[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
const Scalar pw = 1.0e5 - densityW*this->spatialParams().gravity(globalPos)[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
values[Indices::pressureIdx] = pw;
values[Indices::saturationIdx] = 0.0;
......
......@@ -283,7 +283,7 @@ public:
PrimaryVariables values(0.0);
values.setState(initialPhasePresence_);
values[pressureIdx] = pressure_ + 1. * this->gravity()[1] * (globalPos[1] - this->fvGridGeometry().bBoxMax()[1]);
values[pressureIdx] = pressure_ + 1. * this->spatialParams().gravity(globalPos)[1] * (globalPos[1] - this->fvGridGeometry().bBoxMax()[1]);
values[switchIdx] = initialSw_;
values[Indices::temperatureIdx] = temperature_;
......
......@@ -186,7 +186,7 @@ public:
const auto domainHeight = this->fvGridGeometry().bBoxMax()[1];
// we assume a constant water density of 1000 for initial conditions!
const auto& g = this->gravityAtPos(globalPos);
const auto& g = this->spatialParams().gravity(globalPos);
PrimaryVariables values;
Scalar densityW = 1000.0;
values[pressureIdx] = 1e5 - (domainHeight - globalPos[1])*densityW*g[1];
......
......@@ -251,7 +251,7 @@ public:
const auto domainHeight = this->fvGridGeometry().bBoxMax()[1];
// we assume a constant water density of 1000 for initial conditions!
const auto& g = this->gravityAtPos(globalPos);
const auto& g = this->spatialParams().gravity(globalPos);
PrimaryVariables values;
Scalar densityW = 1000.0;
values[pressureIdx] = 1e5 - (domainHeight - globalPos[1])*densityW*g[1];
......
......@@ -249,7 +249,7 @@ public:
// assume an intially hydrostatic liquid pressure profile
// note: we subtract rho_w*g*h because g is defined negative
const Scalar pw = 1.0e5 - densityW*this->gravity()[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
const Scalar pw = 1.0e5 - densityW*this->spatialParams().gravity(globalPos)[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
values[Indices::pressureIdx] = pw;
values[Indices::saturationIdx] = 0.0;
......
......@@ -157,7 +157,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;
......@@ -206,7 +206,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;
}
......
......@@ -248,7 +248,7 @@ public:
// assume an intially hydrostatic liquid pressure profile
// note: we subtract rho_w*g*h because g is defined negative
const Scalar pw = 1.0e5 - densityW*this->gravity()[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
const Scalar pw = 1.0e5 - densityW*this->spatialParams().gravity(globalPos)[dimWorld-1]*(aquiferDepth_ - globalPos[dimWorld-1]);
values[Indices::pressureIdx] = pw;
values[Indices::saturationIdx] = 0.0;
......
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