Skip to content
Snippets Groups Projects
Commit 0bf5e0f6 authored by Stefanie Kiemle's avatar Stefanie Kiemle
Browse files

Match solution with exercise

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