STYLE: minor code style changes

This commit is contained in:
Mark Olesen
2020-06-08 20:55:23 +02:00
parent f5874937eb
commit b2467ff442
2 changed files with 15 additions and 16 deletions

View File

@ -221,8 +221,7 @@ bool Foam::functionObjects::writeFile::read(const dictionary& dict)
labelMinMax::ge(0) labelMinMax::ge(0)
); );
updateHeader_ = updateHeader_ = dict.getOrDefault("updateHeader", updateHeader_);
dict.lookupOrDefault("updateHeader", updateHeader_);
// Only write on master // Only write on master
writeToFile_ = writeToFile_ =

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 | | \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com | | \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -27,33 +27,33 @@ boundaryField
Ta constant 300.0; Ta constant 300.0;
h h
{ {
type coded; type coded;
codeInclude codeInclude
#{ #{
#include "volFields.H" #include "volFields.H"
#}; #};
code code
#{ #{
const objectRegistry& Db = const auto& T =
patch_.boundaryMesh().mesh().thisDb(); patch_.boundaryMesh().mesh()
.lookupObject<volScalarField>("T");
const volScalarField& T = auto thtc = tmp<scalarField>::New(patch_.size(), 300.0);
Db.lookupObject<volScalarField>("T"); auto& htc = thtc.ref();
tmp<scalarField> thtc(new scalarField(patch_.size(), 300.0));
scalarField& htc = thtc.ref();
const scalarField Tp(T.boundaryField()[patch_.index()]); const scalarField Tp(T.boundaryField()[patch_.index()]);
forAll (htc, faceI) forAll(htc, facei)
{ {
if (Tp[faceI] >= 1000.0) if (Tp[facei] >= 1000.0)
{ {
htc[faceI] = 800; htc[facei] = 800;
} }
else if (1000.0 >= Tp[faceI] >= 600.0) else if (Tp[facei] >= 600.0)
{ {
htc[faceI] = 0.2*Tp[faceI]+200; htc[facei] = 0.2*Tp[facei]+200;
} }
} }