Skip to content
Snippets Groups Projects
Commit f52e68cf authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'cleanup/exercise_basic' into 'master'

Match solution with exercise

See merge request !187
parents 2e982d65 0bf5e0f6
No related branches found
No related tags found
1 merge request!187Match solution with exercise
Pipeline #30536 passed
......@@ -140,9 +140,9 @@ public:
NumEqVector values(0.0);
// if we are inside the injection zone set inflow Neumann boundary conditions
if (time_ < injectionDuration_
&& globalPos[1] < 15 + eps_ && globalPos[1] > 7 - eps_ && globalPos[0] > 0.9*this->gridGeometry().bBoxMax()[0])
if (injectionActive() && onInjectionBoundary(globalPos))
{
// inject nitrogen. negative values mean injection
// units kg/(s*m^2)
values[Indices::conti0EqIdx + FluidSystem::N2Idx] = -1e-4;
......@@ -193,6 +193,18 @@ public:
//! set the time for the time dependent boundary conditions (called from main)
void setTime(Scalar time)
{ time_ = time; }
//! Return true if the injection is currently active
bool injectionActive() const
{ return time_ < injectionDuration_; }
//! Return true if the given position is in the injection boundary region
bool onInjectionBoundary(const GlobalPosition& globalPos) const
{
return globalPos[1] < 15. + eps_
&& globalPos[1] > 7. - eps_
&& globalPos[0] > this->gridGeometry().bBoxMax()[0] - eps_;
}
private:
static constexpr Scalar eps_ = 1e-6;
......
......@@ -3,7 +3,6 @@ DtInitial = 3600 # in seconds
TEnd = 3.154e9 # in seconds, i.e ten years
[Grid]
LowerLeft = 0 0
UpperRight = 60 40
Cells = 24 16
......
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