[Transport] Add outflow BC and update test

parent b048e470
......@@ -643,6 +643,12 @@ namespace Dorie{
bcData[i][j].headValue.push_back(stod(buffer));
bcData[i][j].fluxValue.push_back(0.0);
}
else if(buffer == "outflow"){
bcData[i][j].type.push_back(BoundaryCondition::Outflow);
instream >> buffer;
bcData[i][j].headValue.push_back(0.0);
bcData[i][j].fluxValue.push_back(stod(buffer));
}
else
DUNE_THROW(IOError,"In BC file line " + std::to_string(counter) + ": BC side "
+ std::to_string(i) + ": BC declaration " + std::to_string(j+1) + ": BC type unknown!");
......@@ -806,6 +812,8 @@ namespace Dorie{
std::cout << index << ": " << bcTimeStamps[k] << ": ";
if(bcData[i][j].type[k]==BoundaryCondition::Neumann)
std::cout << "neumann : ";
else if(bcData[i][j].type[k]==BoundaryCondition::Outflow)
std::cout << "outflow : ";
else if(bcData[i][j].type[k]==BoundaryCondition::Dirichlet)
std::cout << "dirichlet : ";
}
......
......@@ -13,6 +13,7 @@ namespace Dune{
enum Type {
Neumann, //!< Fixed flux at boundary
Dirichlet, //!< Fixed matric head at boundary
Outflow, //!< Fixed flux at boundary
Other //!< UNUSED
};
......@@ -26,6 +27,11 @@ namespace Dune{
{
return (i == Neumann);
}
//! Test for Outflow boundary condition
static bool isOutflow (Type i)
{
return (i == Outflow);
}
//! UNUSED: Test for other(?) boundary condition
static bool isOther (Type i)
{
......
......@@ -130,6 +130,25 @@ class SoluteBoundary
}
return 0.0;
}
/*-----------------------------------------------------------------------*//**
* @brief Outflow boundary condition at certain position and time
*
* @param is Intersection enitity
* @param x Position in local entity coordinates
* @param time Time value
*
* @return Value of outflow
*/
RF o (const Intersection& is, const ID& x, const RF& time) const
{
const Domain xGlobal = is.geometry().global(x);
if(is.boundary()) {
if(bcDataHandler)
return bcDataHandler->getNeumannValue(xGlobal, time);
}
return 0.0;
}
};
}
}
......
......@@ -3,4 +3,4 @@ spatial_resolution_south 0
spatial_resolution_west -1
spatial_resolution_east -1
number_BC_change_times 1
0 neumann 0 dirichlet 1 neumann 0 neumann 0
\ No newline at end of file
0 neumann 0 dirichlet 1 neumann 0 outflow 0
\ No newline at end of file
spatial_resolution_north 2 0.25 0.75
spatial_resolution_south -1
spatial_resolution_south 0
spatial_resolution_west -1
spatial_resolution_east -1
number_BC_change_times 2
0 neumann 0 dirichlet 1 neumann 0
1E3 neumann 0 neumann 0 neumann 0
0 neumann 0 dirichlet 1 neumann 0 outflow 0
1E3 neumann 0 neumann 0 neumann 0 outflow 0
spatial_resolution_north_we 2 0.25 0.75
spatial_resolution_north_fb 2 0.25 0.75
spatial_resolution_south_we -1
spatial_resolution_south_fb -1
spatial_resolution_south_we 0
spatial_resolution_south_fb 0
spatial_resolution_west_sn -1
spatial_resolution_west_fb -1
spatial_resolution_east_sn -1
......@@ -11,4 +11,4 @@ spatial_resolution_front_we -1
spatial_resolution_back_sn -1
spatial_resolution_back_we -1
number_BC_change_times 1
0 neumann 0 neumann 0 neumann 0 neumann 0 dirichlet 1 neumann 0 neumann 0 neumann 0 neumann 0
\ No newline at end of file
0 neumann 0 neumann 0 neumann 0 neumann 0 dirichlet 1 neumann 0 neumann 0 neumann 0 neumann 0 outflow 0
\ No newline at end of file
spatial_resolution_north_we 2 0.25 0.75
spatial_resolution_north_fb 2 0.25 0.75
spatial_resolution_south_we -1
spatial_resolution_south_fb -1
spatial_resolution_south_we 0
spatial_resolution_south_fb 0
spatial_resolution_west_sn -1
spatial_resolution_west_fb -1
spatial_resolution_east_sn -1
......@@ -11,5 +11,5 @@ spatial_resolution_front_we -1
spatial_resolution_back_sn -1
spatial_resolution_back_we -1
number_BC_change_times 2
0 neumann 0 neumann 0 neumann 0 neumann 0 dirichlet 1 neumann 0 neumann 0 neumann 0 neumann 0
1E3 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0
\ No newline at end of file
0 neumann 0 neumann 0 neumann 0 neumann 0 dirichlet 1 neumann 0 neumann 0 neumann 0 neumann 0 outflow 0
1E3 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 neumann 0 outflow 0
\ No newline at end of file
......@@ -16,6 +16,7 @@ adaptivity.useAdaptivity = false
output.fileName = test-simulation-dummy-transport | unique
output.outputPath = test-simulation-dummy-transport | unique
output.verbose = 0
output.policy = endOfTransportStep
boundary.file = "{_asset_path}/bcs/solute_2d_pulse.dat", "{_asset_path}/bcs/solute_3d_pulse.dat" | expand dim
......
Markdown is supported
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