36 Foam::PDRblock::outerControl::controlType
38 Foam::PDRblock::outerControl::controlNames_
40 { controlType::OUTER_NONE,
"none" },
41 { controlType::OUTER_EXTEND,
"extend" },
42 { controlType::OUTER_BOX,
"box" },
43 { controlType::OUTER_SPHERE,
"sphere" },
69 Foam::PDRblock::outerControl::outerControl()
71 type_(controlType::OUTER_NONE),
72 expandType_(expansionType::EXPAND_RATIO),
84 type_ = controlType::OUTER_NONE;
85 expandType_ = expansionType::EXPAND_RATIO;
89 expansion_ = vector2D::uniform(1);
93 void Foam::PDRblock::outerControl::report(Ostream&
os)
const
97 os <<
"Has outer region: " << controlNames_[type_] <<
nl
99 <<
" sizes : " << relSize_ <<
nl
100 <<
" nCells : " << nCells_ <<
nl;
104 os <<
"No outer region" <<
nl;
109 bool Foam::PDRblock::outerControl::active()
const
111 return (controlType::OUTER_NONE != type_);
115 bool Foam::PDRblock::outerControl::isSphere()
const
117 return (controlType::OUTER_SPHERE == type_);
121 bool Foam::PDRblock::outerControl::onGround()
const
127 bool Foam::PDRblock::outerControl::onGround(
const bool on)
139 type_ = controlNames_.getOrDefault(
"type",
dict, controlType::OUTER_NONE);
140 onGround_ =
dict.getOrDefault(
"onGround",
false);
142 if (controlType::OUTER_NONE == type_)
149 nCells_ = getLazyPair<label>(
"nCells",
dict);
150 relSize_ = getLazyPair<scalar>(
"size",
dict);
153 expansionNames_.getOrDefault
157 expansionType::EXPAND_RATIO
161 if (
dict.found(
"ratios"))
163 expansion_ = getLazyPair<scalar>(
"ratios",
dict);
167 if (expandType_ != expansionType::EXPAND_UNIFORM)
169 expandType_ = expansionType::EXPAND_UNIFORM;
174 if (expandType_ == expansionType::EXPAND_UNIFORM)
176 expansion_ = vector2D::uniform(1);
183 if (nCells_.x() <= 1 || nCells_.y() <= 1)
190 <<
"Too few outer cells: " << nCells_ <<
nl;
193 if (relSize_.x() <= 1 || relSize_.y() <= 1)
200 <<
"Outer dimensions must be > 1. Had " << relSize_ <<
nl;
213 controlType::OUTER_BOX == type_
214 || controlType::OUTER_SPHERE == type_
217 if (relSize_.x() < 2 || relSize_.y() < 2)
220 <<
"Outer dimensions "
221 << relSize_ <<
" too small for "
222 << controlNames_[type_] <<
" - switching to "
223 << controlNames_[controlType::OUTER_EXTEND] <<
nl;
225 type_ = controlType::OUTER_EXTEND;
229 if (controlType::OUTER_SPHERE == type_)
231 if (relSize_.x() < 3 || relSize_.y() < 3)
234 <<
"Outer dimensions "
235 << relSize_ <<
" too small for "
236 << controlNames_[type_] <<
" - switching to "
237 << controlNames_[controlType::OUTER_BOX] <<
nl;
239 type_ = controlType::OUTER_EXTEND;