Skip to content
Snippets Groups Projects
Commit 47cc58d3 authored by Ned Coltman's avatar Ned Coltman
Browse files

[exercises][ff-pm][interface] Add an extra points task (horizontal velocity BCs)

parent a48728a2
No related branches found
No related tags found
1 merge request!153Update exercise-coupled-ff-pm
......@@ -195,6 +195,10 @@ The final result should look something like this:
![](../extradoc/ex_ff-pm-wave-interface.png)
*Extra Points:*
Rather than enforcing a pressure difference across the domain, an inflow velocity profile could be set.
What changes to the boundary conditions in the free-flow domain would you make to introduce this? What conditions can be enforced on the right boundary?
Hint: A relation between velocity and position is used for the vertical velocity component in the original form of the `initialAtPos` method.
### 2. Changing the porous medium model
......
......@@ -18,5 +18,10 @@ dumux_add_test(NAME exercise_interface_coupling_ff-pm_c_solution
LABELS ffpm
COMPILE_DEFINITIONS EXNUMBER=3)
dumux_add_test(NAME exercise_interface_coupling_ff-pm_extra_solution
SOURCES main.cc
LABELS ffpm
COMPILE_DEFINITIONS EXNUMBER=4)
# add a symlink for each input file
add_input_file_links()
......@@ -81,7 +81,7 @@ public:
const auto& globalPos = scvf.dofPosition();
#if EXNUMBER == 0 // flow from top to bottom
#if EXNUMBER == 0 // flow from top to bottom
if(onUpperBoundary_(globalPos))
{
values.setDirichlet(Indices::velocityXIdx);
......@@ -93,7 +93,7 @@ public:
values.setDirichlet(Indices::velocityXIdx);
values.setDirichlet(Indices::velocityYIdx);
}
#else // flow flom left to right
#elif EXNUMBER < 4 // flow flom left to right
if(onLeftBoundary_(globalPos) || onRightBoundary_(globalPos))
values.setDirichlet(Indices::pressureIdx);
else
......@@ -101,6 +101,14 @@ public:
values.setDirichlet(Indices::velocityXIdx);
values.setDirichlet(Indices::velocityYIdx);
}
#else
if (onRightBoundary_(globalPos))
values.setDirichlet(Indices::pressureIdx);
else
{
values.setDirichlet(Indices::velocityXIdx);
values.setDirichlet(Indices::velocityYIdx);
}
#endif
if(couplingManager().isCoupledEntity(CouplingManager::stokesIdx, scvf))
......@@ -199,6 +207,9 @@ public:
PrimaryVariables values(0.0);
#if EXNUMBER == 0
values[Indices::velocityYIdx] = -1e-6 * globalPos[0] * (this->gridGeometry().bBoxMax()[0] - globalPos[0]);
#elif EXNUMBER == 4
values[Indices::velocityXIdx] = 1e-6 * (globalPos[1] - this->gridGeometry().bBoxMin()[1])
* (this->gridGeometry().bBoxMax()[1] - globalPos[1]);
#else
// set fixed pressures on the left and right boundary
if(onLeftBoundary_(globalPos))
......@@ -206,7 +217,6 @@ public:
if(onRightBoundary_(globalPos))
values[Indices::pressureIdx] = 0.0;
#endif
return values;
}
......
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