Skip to content

Commit

Permalink
Active Control max velocity default value fix (#233)
Browse files Browse the repository at this point in the history
* Set active_control.velMax default value to -1.0

* Only restrict Vnew if velMax > 0

* Update manual to match changes
  • Loading branch information
olivecha authored Aug 22, 2023
1 parent 62b496c commit fbbe5a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Docs/source/manual/LMeXControls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ the user to set the inflow velocity. The following options are available when us
active_control.height = 0.01 # [OPT, DEF=0.0] Where is the flame held ?
active_control.v = 1 # [OPT, DEF=0] verbose
active_control.method = 1 # [OPT, DEF=2] Controller: 1 - Linear, 2 - Quadratic, 3 - Weighted quadratic
active_control.velMax = 2.0 # [OPT, DEF=0.0] limit inlet velocity
active_control.velMax = 2.0 # [OPT, DEF=-1.0] limit inlet velocity, only used when positive
active_control.changeMax = 0.1 # [OPT, DEF=1.0] limit inlet velocity changes (absolute m/s)
active_control.flow_dir = 1 # [OPT, DEF=AMREX_SPACEDIM-1] flame main direction
active_control.AC_history = AChist # [OPT, DEF=AC_history] Control history file, read upon restart
Expand Down
2 changes: 1 addition & 1 deletion Source/PeleLM.H
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ class PeleLM : public amrex::AmrCore {
amrex::Real m_ctrl_scale{0.0};
amrex::Real m_ctrl_zBase{0.0};
amrex::Real m_ctrl_h{0.0};
amrex::Real m_ctrl_velMax{0.0};
amrex::Real m_ctrl_velMax{-1.0};
amrex::Real m_ctrl_temperature{-1.0};
int m_ctrl_verbose{0};
int m_ctrl_NavgPts{3};
Expand Down
4 changes: 3 additions & 1 deletion Source/PeleLMFlowController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ PeleLM::activeControl(int is_restart)
Real dVmin = m_ctrl_changeMax * std::max(1.0,m_ctrl_V_in);
Vnew = std::max(Vnew,0.0);
Vnew = std::min(std::max(Vnew,m_ctrl_V_in-dVmin),m_ctrl_V_in+dVmax);
Vnew = std::min(Vnew,m_ctrl_velMax);
if (m_ctrl_velMax > 0.0) { // Only limit Vnew to velMax if velMax > 0.0
Vnew = std::min(Vnew,m_ctrl_velMax);
}

if (!is_restart && m_nstep > 0) {
m_ctrl_tBase = m_cur_time;
Expand Down

0 comments on commit fbbe5a9

Please sign in to comment.