mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: reduced usage of Switch
- Since 'bool' and 'Switch' use the _identical_ input mechanism (ie, both accept true/false, on/off, yes/no, none, 1/0), the main reason to prefer one or the other is the output. The output for Switch is as text (eg, "true"), whereas for bool it is label (0 or 1). If the output is required for a dictionary, Switch may be appropriate. If the output is not required, or is only used for Pstream exchange, bool can be more appropriate.
This commit is contained in:
@ -39,7 +39,7 @@ ThermalPhaseChangePhaseSystem
|
||||
HeatAndMassTransferPhaseSystem<BasePhaseSystem>(mesh),
|
||||
volatile_(this->lookup("volatile")),
|
||||
saturationModel_(saturationModel::New(this->subDict("saturationModel"))),
|
||||
massTransfer_(this->lookup("massTransfer"))
|
||||
massTransfer_(this->template get<bool>("massTransfer"))
|
||||
{
|
||||
|
||||
forAllConstIters(this->phasePairs_, phasePairIter)
|
||||
@ -357,7 +357,7 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
|
||||
|
||||
volScalarField iDmdtNew(iDmdt);
|
||||
|
||||
if (massTransfer_ )
|
||||
if (massTransfer_)
|
||||
{
|
||||
volScalarField H1
|
||||
(
|
||||
|
||||
@ -43,7 +43,6 @@ SourceFiles
|
||||
|
||||
#include "HeatAndMassTransferPhaseSystem.H"
|
||||
#include "saturationModel.H"
|
||||
#include "Switch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -71,7 +70,7 @@ protected:
|
||||
autoPtr<saturationModel> saturationModel_;
|
||||
|
||||
// Mass transfer enabled
|
||||
Switch massTransfer_;
|
||||
bool massTransfer_;
|
||||
|
||||
//- Interfacial Mass transfer rate
|
||||
HashPtrTable<volScalarField, phasePairKey, phasePairKey::hash>
|
||||
|
||||
Reference in New Issue
Block a user