Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2011-05-26 12:13:28 +01:00
14 changed files with 242 additions and 67 deletions

View File

@ -414,11 +414,11 @@ Foam::argList::argList
(
(
validOptions.found(optionName)
&& validOptions[optionName] != ""
&& !validOptions[optionName].empty()
)
|| (
validParOptions.found(optionName)
&& validParOptions[optionName] != ""
&& !validParOptions[optionName].empty()
)
)
{
@ -833,6 +833,116 @@ Foam::argList::~argList()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::argList::setOption(const word& opt, const string& param)
{
bool changed = false;
// only allow valid options
if (validOptions.found(opt))
{
// some options are to be protected
if
(
opt == "case"
|| opt == "parallel"
|| opt == "roots"
)
{
FatalError
<<"used argList::setOption on a protected option: '"
<< opt << "'" << endl;
FatalError.exit();
}
if (validOptions[opt].empty())
{
// bool option
if (!param.empty())
{
// disallow change of type
FatalError
<<"used argList::setOption to change bool to non-bool: '"
<< opt << "'" << endl;
FatalError.exit();
}
else
{
// did not previously exist
changed = !options_.found(opt);
}
}
else
{
// non-bool option
if (param.empty())
{
// disallow change of type
FatalError
<<"used argList::setOption to change non-bool to bool: '"
<< opt << "'" << endl;
FatalError.exit();
}
else
{
// existing value needs changing, or did not previously exist
changed = options_.found(opt) ? options_[opt] != param : true;
}
}
}
else
{
FatalError
<<"used argList::setOption on an invalid option: '"
<< opt << "'" << nl << "allowed are the following:"
<< validOptions << endl;
FatalError.exit();
}
// set/change the option as required
if (changed)
{
options_.set(opt, param);
}
return changed;
}
bool Foam::argList::unsetOption(const word& opt)
{
// only allow valid options
if (validOptions.found(opt))
{
// some options are to be protected
if
(
opt == "case"
|| opt == "parallel"
|| opt == "roots"
)
{
FatalError
<<"used argList::unsetOption on a protected option: '"
<< opt << "'" << endl;
FatalError.exit();
}
// remove the option, return true if state changed
return options_.erase(opt);
}
else
{
FatalError
<<"used argList::unsetOption on an invalid option: '"
<< opt << "'" << nl << "allowed are the following:"
<< validOptions << endl;
FatalError.exit();
}
return false;
}
void Foam::argList::printNotes() const
{
// output notes directly - no automatic text wrapping

View File

@ -334,6 +334,19 @@ public:
static void noParallel();
//- Set option directly (use with caution)
// An option with an empty param is a bool option.
// Not all valid options can also be set: eg, -case, -roots, ...
// Return true if the existing option value needed changing,
// or if the option did not previously exist.
bool setOption(const word& opt, const string& param = "");
//- Unset option directly (use with caution)
// Not all valid options can also be unset: eg, -case, -roots ...
// Return true if the option existed before being unset.
bool unsetOption(const word& opt);
// Print
//- Print notes (if any)

View File

@ -399,7 +399,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
*max
(
dimensionedScalar("zero",dimensionSet(0, 0, -2, 0, 0), 0.0),
zetaTilda2_*kappa_*S2*(L/Lvk2(S2))
zetaTilda2_*kappa_*S2*sqr(L/Lvk2(S2))
- 2.0/alphaPhi_*k_*grad_omega_k
)
);

View File

@ -27,22 +27,12 @@ Class
Description
kOmegaSSTSAS LES turbulence model for incompressible flows
References:
Evaluation of the SST-SAS model: Channel flow, asymmetric diffuser and axi-
symmetric hill
European Conference on Computational Fluid Dynamics
ECCOMAS CFD 2006
Lars Davison
A Scale-Adaptive Simulation Model using Two-Equation Models
AIAA 2005-1095
F. R. Menter and Y. Egorov
DESider A European Effort on Hybrid RANS-LES Modelling:
Results of the European-Union Funded Project, 2004 - 2007
(Notes on Numerical Fluid Mechanics and Multidisciplinary Design).
Chapter 8 Formulation of the Scale-Adaptive Simulation (SAS) Model during
the DESIDER Project.
the DESIDER Project. Published in Springer-Verlag Berlin Heidelberg 2009.
F. R. Menter and Y. Egorov.
SourceFiles