Skip to content

Commit

Permalink
BCType::foextrap as default for (density, BC::slip_wall) combination …
Browse files Browse the repository at this point in the history
…when advection_type == "BDS" (#113)

Making `BCType::foextrap` as the default type for _density_ and _tracer_
at `BC::slip_wall` boundary only when `advection_type == "BDS"`. Also
made a minor change in docs (`src/boundary_conditions/README.org`) for
_(scalar/density, sw)_ combination.
  • Loading branch information
siddanib authored Aug 2, 2024
1 parent 308c35c commit 45a3521
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 11 deletions.
16 changes: 9 additions & 7 deletions src/boundary_conditions/README.org
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
* fillpatch

| | pi | po | mi | nsw | sw |
|--------+----------+----------+----------+-------------+-------------|
| v_n | foextrap | foextrap | ext_dir | ext_dir (0) | ext_dir (0) |
| v_t | foextrap | foextrap | ext_dir | ext_dir (0) | hoextrap |
| rho | foextrap | foextrap | ext_dir | foextrap | foextrap |
| scalar | foextrap | foextrap | ext_dir | foextrap | foextrap |
| force | foextrap | foextrap | foextrap | foextrap | foextrap |
| | pi | po | mi | nsw | sw |
|--------+----------+----------+----------+-------------+---------------------------------------|
| v_n | foextrap | foextrap | ext_dir | ext_dir (0) | ext_dir (0) |
| v_t | foextrap | foextrap | ext_dir | ext_dir (0) | hoextrap |
| rho | foextrap | foextrap | ext_dir | foextrap | if (advection_type == "BDS") foextrap |
| | | | | | else hoextrap |
| scalar | foextrap | foextrap | ext_dir | foextrap | if (advection_type == "BDS") foextrap |
| | | | | | else hoextrap |
| force | foextrap | foextrap | foextrap | foextrap | foextrap |

* projection

Expand Down
34 changes: 30 additions & 4 deletions src/boundary_conditions/boundary_conditions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,19 @@ void incflo::init_bcs ()
else if (bct == BC::slip_wall)
{
if (side == Orientation::low) {
m_bcrec_density[0].setLo(dir, BCType::hoextrap);
// BDS requires foextrap to avoid introduction of local max/min
if (m_advection_type == "BDS") {
m_bcrec_density[0].setLo(dir, BCType::foextrap);
} else{
m_bcrec_density[0].setLo(dir, BCType::hoextrap);
}
} else {
m_bcrec_density[0].setHi(dir, BCType::hoextrap);
// BDS requires foextrap to avoid introduction of local max/min
if (m_advection_type == "BDS") {
m_bcrec_density[0].setHi(dir, BCType::foextrap);
} else {
m_bcrec_density[0].setHi(dir, BCType::hoextrap);
}
}
}
else if (bct == BC::mass_inflow)
Expand Down Expand Up @@ -327,9 +337,25 @@ void incflo::init_bcs ()
else if (bct == BC::slip_wall)
{
if (side == Orientation::low) {
for (auto& b : m_bcrec_tracer) b.setLo(dir, BCType::hoextrap);
for (auto& b : m_bcrec_tracer) {
// BDS requires foextrap to avoid introduction
// of local max/min
if (m_advection_type == "BDS") {
b.setLo(dir, BCType::foextrap);
} else {
b.setLo(dir, BCType::hoextrap);
}
}
} else {
for (auto& b : m_bcrec_tracer) b.setHi(dir, BCType::hoextrap);
for (auto& b : m_bcrec_tracer) {
// BDS requires foextrap to avoid introduction
// of local max/min
if (m_advection_type == "BDS") {
b.setHi(dir, BCType::foextrap);
} else {
b.setHi(dir, BCType::hoextrap);
}
}
}
}
else if (bct == BC::mass_inflow)
Expand Down

0 comments on commit 45a3521

Please sign in to comment.