diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C index 955be39376..5436f1f421 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -214,11 +214,9 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); writeEntryIfDifferent(os, "mu", "thermo:mu", muName_); - os.writeKeyword("accommodationCoeff") - << accommodationCoeff_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "accommodationCoeff", accommodationCoeff_); Twall_.writeEntry("Twall", os); - os.writeKeyword("gamma") - << gamma_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "gamma", gamma_); writeEntry("value", os); } diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index 52db42627f..957ee451cc 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -206,12 +206,10 @@ void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const writeEntryIfDifferent(os, "mu", "thermo:mu", muName_); writeEntryIfDifferent(os, "tauMC", "tauMC", tauMCName_); - os.writeKeyword("accommodationCoeff") - << accommodationCoeff_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "accommodationCoeff", accommodationCoeff_); Uwall_.writeEntry("Uwall", os); - os.writeKeyword("thermalCreep") - << thermalCreep_ << token::END_STATEMENT << nl; - os.writeKeyword("curvature") << curvature_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "thermalCreep", thermalCreep_); + Foam::writeEntry(os, "curvature", curvature_); refValue().writeEntry("refValue", os); valueFraction().writeEntry("valueFraction", os); diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 1b87c3d0c3..ebb9725299 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -125,8 +125,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField void alphaContactAngleFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); - os.writeKeyword("thetaProperties") - << thetaProps_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "thetaProperties", thetaProps_); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 4d5d189440..896a93437d 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -125,8 +125,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField void alphaContactAngleFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); - os.writeKeyword("thetaProperties") - << thetaProps_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "thetaProperties", thetaProps_); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 4d5d189440..896a93437d 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -125,8 +125,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField void alphaContactAngleFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); - os.writeKeyword("thetaProperties") - << thetaProps_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "thetaProperties", thetaProps_); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C index 0f7f4d8c77..0cd31c93e3 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatFixedDmdtWallBoilingWallFunction/alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -191,11 +191,10 @@ void alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::write ) const { fvPatchField::write(os); - os.writeKeyword("vaporPhase") << vaporPhaseName_ << token::END_STATEMENT - << nl; - os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl; - os.writeKeyword("fixedDmdt") << fixedDmdt_ << token::END_STATEMENT << nl; - os.writeKeyword("L") << L_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "vaporPhase", vaporPhaseName_); + Foam::writeEntry(os, "relax", relax_); + Foam::writeEntry(os, "fixedDmdt", fixedDmdt_); + Foam::writeEntry(os, "L", L_); dmdt_.writeEntry("dmdt", os); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C index b57d2d67d6..dfce09c5a5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatPhaseChangeJayatillekeWallFunction/alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -323,10 +323,10 @@ void alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::write ) const { fvPatchField::write(os); - os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Prt", Prt_); + Foam::writeEntry(os, "Cmu", Cmu_); + Foam::writeEntry(os, "kappa", kappa_); + Foam::writeEntry(os, "E", E_); dmdt_.writeEntry("dmdt", os); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index 72456ce4f0..aaa8359de4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -682,10 +682,9 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("phaseType") << phaseTypeNames_[phaseType_] - << token::END_STATEMENT << nl; + Foam::writeEntry(os, "phaseType", phaseTypeNames_[phaseType_]); - os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "relax", relax_); switch (phaseType_) { @@ -723,8 +722,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const } } - os.writeKeyword("otherPhase") << otherPhaseName_ << token::END_STATEMENT - << nl; + Foam::writeEntry(os, "otherPhase", otherPhaseName_); dmdt_.writeEntry("dmdt", os); dDep_.writeEntry("dDep", os); qq_.writeEntry("qQuenching", os); diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C index dd190a34bd..cf346d1ba7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,8 +109,7 @@ void Foam::copiedFixedValueFvPatchScalarField::updateCoeffs() void Foam::copiedFixedValueFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("sourceFieldName") - << sourceFieldName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "sourceFieldName", sourceFieldName_); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C index ac234d9698..f071a2a2fa 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -170,7 +170,7 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs() void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "relax", relax_); q_.writeEntry("q", os); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C index 3a40a1b082..d78e92c6bd 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,7 +111,7 @@ void Foam::wallBoilingModels::departureDiameterModels:: KocamustafaogullariIshii::write(Ostream& os) const { departureDiameterModel::write(os); - os.writeKeyword("phi") << phi_ << token::END_STATEMENT << nl; + writeEntry(os, "phi", phi_); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C index e792e4f283..2a3d30616f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -90,9 +90,9 @@ void Foam::wallBoilingModels::departureDiameterModels:: TolubinskiKostanchuk::write(Ostream& os) const { departureDiameterModel::write(os); - os.writeKeyword("dRef") << dRef_ << token::END_STATEMENT << nl; - os.writeKeyword("dMax") << dMax_ << token::END_STATEMENT << nl; - os.writeKeyword("dMin") << dMin_ << token::END_STATEMENT << nl; + writeEntry(os, "dRef", dRef_); + writeEntry(os, "dMax", dMax_); + writeEntry(os, "dMin", dMin_); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C index dad5230630..496c1e47fe 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/Lavieville/Lavieville.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -88,7 +88,7 @@ void Foam::wallBoilingModels::partitioningModels:: Lavieville::write(Ostream& os) const { partitioningModel::write(os); - os.writeKeyword("alphaCrit") << alphaCrit_ << token::END_STATEMENT << nl; + writeEntry(os, "alphaCrit", alphaCrit_); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C index 1fd4904ccb..de129720c9 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/cosine/cosine.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,10 +97,8 @@ void Foam::wallBoilingModels::partitioningModels:: cosine::write(Ostream& os) const { partitioningModel::write(os); - os.writeKeyword("alphaLiquid1") << alphaLiquid1_ - << token::END_STATEMENT << nl; - os.writeKeyword("alphaLiquid0") << alphaLiquid0_ - << token::END_STATEMENT << nl; + writeEntry(os, "alphaLiquid1", alphaLiquid1_); + writeEntry(os, "alphaLiquid0", alphaLiquid0_); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C index 9f383d937b..9daee88523 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C +++ b/applications/solvers/multiphase/reactingEulerFoam/derivedFvPatchFields/wallBoilingSubModels/partitioningModels/linear/linear.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -90,10 +90,8 @@ void Foam::wallBoilingModels::partitioningModels:: linear::write(Ostream& os) const { partitioningModel::write(os); - os.writeKeyword("alphaLiquid1") << alphaLiquid1_ - << token::END_STATEMENT << nl; - os.writeKeyword("alphaLiquid0") << alphaLiquid0_ - << token::END_STATEMENT << nl; + writeEntry(os, "alphaLiquid1", alphaLiquid1_); + writeEntry(os, "alphaLiquid0", alphaLiquid0_); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 4d5d189440..896a93437d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -125,8 +125,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField void alphaContactAngleFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); - os.writeKeyword("thetaProperties") - << thetaProps_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "thetaProperties", thetaProps_); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index 6db5565a6b..2a0bad5b6b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -245,8 +245,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::write ) const { fvPatchVectorField::write(os); - os.writeKeyword("specularityCoefficient") - << specularityCoefficient_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "specularityCoefficient", specularityCoefficient_); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index 45be4e1c6e..4903799fb1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -289,10 +289,8 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::write ) const { fvPatchScalarField::write(os); - os.writeKeyword("restitutionCoefficient") - << restitutionCoefficient_ << token::END_STATEMENT << nl; - os.writeKeyword("specularityCoefficient") - << specularityCoefficient_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "restitutionCoefficient", restitutionCoefficient_); + Foam::writeEntry(os, "specularityCoefficient", specularityCoefficient_); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index 67a14656c2..e3eacd9456 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -245,8 +245,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::write ) const { fvPatchVectorField::write(os); - os.writeKeyword("specularityCoefficient") - << specularityCoefficient_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "specularityCoefficient", specularityCoefficient_); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index d36b2b62a3..cb9909180d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -289,10 +289,8 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::write ) const { fvPatchScalarField::write(os); - os.writeKeyword("restitutionCoefficient") - << restitutionCoefficient_ << token::END_STATEMENT << nl; - os.writeKeyword("specularityCoefficient") - << specularityCoefficient_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "restitutionCoefficient", restitutionCoefficient_); + Foam::writeEntry(os, "specularityCoefficient", specularityCoefficient_); writeEntry("value", os); } diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/derivedFvPatchFields/hydrostaticDisplacement/hydrostaticDisplacementFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/derivedFvPatchFields/hydrostaticDisplacement/hydrostaticDisplacementFvPatchVectorField.C index 570034d162..530f4b6163 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/derivedFvPatchFields/hydrostaticDisplacement/hydrostaticDisplacementFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/derivedFvPatchFields/hydrostaticDisplacement/hydrostaticDisplacementFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -125,11 +125,9 @@ void Foam::hydrostaticDisplacementFvPatchVectorField::updateCoeffs() void Foam::hydrostaticDisplacementFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); - os.writeKeyword("rhoLiquid") << rhoLiquid_ << token::END_STATEMENT << nl; - os.writeKeyword("liquidSurfacePressure") - << liquidSurfacePressure_ << token::END_STATEMENT << nl; - os.writeKeyword("liquidSurfacePoint") - << liquidSurfacePoint_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "rhoLiquid", rhoLiquid_); + Foam::writeEntry(os, "liquidSurfacePressure", liquidSurfacePressure_); + Foam::writeEntry(os, "liquidSurfacePoint", liquidSurfacePoint_); writeEntry("value", os); } diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H index 872556cfe3..d3699cde60 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.H +++ b/src/OpenFOAM/db/dictionary/dictionary.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -586,6 +586,28 @@ dictionary operator+(const dictionary& dict1, const dictionary& dict2); dictionary operator|(const dictionary& dict1, const dictionary& dict2); +//- Helper function to write the keyword and entry +template +void writeEntry +( + Ostream& os, + const word& entryName, + const EntryType& value +); + + +//- Helper function to write the keyword and entry only if the +// values are not equal. The value is then output as value2 +template +void writeEntryIfDifferent +( + Ostream& os, + const word& entryName, + const EntryType& value1, + const EntryType& value2 +); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/db/dictionary/dictionaryTemplates.C b/src/OpenFOAM/db/dictionary/dictionaryTemplates.C index 8d062efcdf..fbfb77d9ce 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryTemplates.C +++ b/src/OpenFOAM/db/dictionary/dictionaryTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -158,4 +158,32 @@ void Foam::dictionary::set(const keyType& k, const T& t) } +template +void Foam::writeEntry +( + Ostream& os, + const word& entryName, + const EntryType& value +) +{ + os.writeKeyword(entryName) << value << token::END_STATEMENT << nl; +} + + +template +void Foam::writeEntryIfDifferent +( + Ostream& os, + const word& entryName, + const EntryType& value1, + const EntryType& value2 +) +{ + if (value1 != value2) + { + writeEntry(os, entryName, value2); + } +} + + // ************************************************************************* // diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C index ba7a209bfd..5b871774ee 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -161,7 +161,7 @@ void convectiveHeatTransferFvPatchScalarField::updateCoeffs() void convectiveHeatTransferFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("L") << L_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "L", L_); writeEntry("value", os); } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C index 3e7368c171..6c48ac7eb1 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -472,16 +472,14 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write { fvPatchScalarField::write(os); - os.writeKeyword("mode") - << operationModeNames[mode_] << token::END_STATEMENT << nl; + Foam::writeEntry(os, "mode", operationModeNames[mode_]); temperatureCoupledBase::write(os); switch (mode_) { case fixedPower: { - os.writeKeyword("Q") - << Q_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Q", Q_); break; } @@ -498,14 +496,12 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write if (relaxation_ < 1) { - os.writeKeyword("relaxation") - << relaxation_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "relaxation", relaxation_); } if (emissivity_ > 0) { - os.writeKeyword("emissivity") - << emissivity_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "emissivity", emissivity_); } if (thicknessLayers_.size()) @@ -518,12 +514,11 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write } } - os.writeKeyword("qr")<< qrName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "qr", qrName_); if (qrName_ != "none") { - os.writeKeyword("qrRelaxation") - << qrRelaxation_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "qrRelaxation", qrRelaxation_); qrPrevious_.writeEntry("qrPrevious", os); } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C index 1feec88190..c547a13a9d 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -260,10 +260,9 @@ Foam::tmp Foam::temperatureCoupledBase::kappa void Foam::temperatureCoupledBase::write(Ostream& os) const { - os.writeKeyword("kappaMethod") << KMethodTypeNames_[method_] - << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappaName_ << token::END_STATEMENT << nl; - os.writeKeyword("alphaAni") << alphaAniName_ << token::END_STATEMENT << nl; + writeEntry(os, "kappaMethod", KMethodTypeNames_[method_]); + writeEntry(os, "kappa", kappaName_); + writeEntry(os, "alphaAni", alphaAniName_); } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C index f87eeda2fc..7a323b6728 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -436,9 +436,8 @@ void thermalBaffle1DFvPatchScalarField::write(Ostream& os) const } qrPrevious_.writeEntry("qrPrevious", os); - os.writeKeyword("qr")<< qrName_ << token::END_STATEMENT << nl; - os.writeKeyword("qrRelaxation")<< qrRelaxation_ - << token::END_STATEMENT << nl; + Foam::writeEntry(os, "qr", qrName_); + Foam::writeEntry(os, "qrRelaxation", qrRelaxation_); } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C index f857f45bf9..f5973930a5 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -199,10 +199,9 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField:: write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; - os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; - os.writeKeyword("massFluxFraction") << massFluxFraction_ - << token::END_STATEMENT << nl; + Foam::writeEntry(os, "phi", phiName_); + Foam::writeEntry(os, "rho", rhoName_); + Foam::writeEntry(os, "massFluxFraction", massFluxFraction_); this->writeEntry("value", os); } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C index 6934564f9c..78f1fb2cf6 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -265,8 +265,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write ) const { mixedFvPatchScalarField::write(os); - os.writeKeyword("Tnbr")<< TnbrName_ - << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Tnbr", TnbrName_); thicknessLayers_.writeEntry("thicknessLayers", os); kappaLayers_.writeEntry("kappaLayers", os); diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C index cf7ddfc377..d78fd49b73 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -270,9 +270,9 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::write ) const { mixedFvPatchScalarField::write(os); - os.writeKeyword("Tnbr")<< TnbrName_ << token::END_STATEMENT << nl; - os.writeKeyword("qrNbr")<< qrNbrName_ << token::END_STATEMENT << nl; - os.writeKeyword("qr")<< qrName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Tnbr", TnbrName_); + Foam::writeEntry(os, "qrNbr", qrNbrName_); + Foam::writeEntry(os, "qr", qrName_); thicknessLayers_.writeEntry("thicknessLayers", os); kappaLayers_.writeEntry("kappaLayers", os); diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 634f9b3f42..7fd10c2f9b 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -300,10 +300,10 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() void alphatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Prt", Prt_); + Foam::writeEntry(os, "Cmu", Cmu_); + Foam::writeEntry(os, "kappa", kappa_); + Foam::writeEntry(os, "E", E_); writeEntry("value", os); } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C index 1cce670322..330f23986d 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -129,7 +129,7 @@ void alphatWallFunctionFvPatchScalarField::updateCoeffs() void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Prt", Prt_); writeEntry("value", os); } diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 98fdc5cdf8..3710d9478c 100644 --- a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -268,10 +268,10 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() void alphatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Prt", Prt_); + Foam::writeEntry(os, "Cmu", Cmu_); + Foam::writeEntry(os, "kappa", kappa_); + Foam::writeEntry(os, "E", E_); writeEntry("value", os); } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index cdf2d48a93..b29c20894a 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -159,10 +159,9 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write ) const { fvPatchScalarField::write(os); - os.writeKeyword("mixingLength") - << mixingLength_ << token::END_STATEMENT << nl; - os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; - os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "mixingLength", mixingLength_); + Foam::writeEntry(os, "phi", this->phiName_); + Foam::writeEntry(os, "k", kName_); writeEntry("value", os); } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index 8c94ddf558..0561773325 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -155,10 +155,9 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::write ) const { fvPatchScalarField::write(os); - os.writeKeyword("mixingLength") - << mixingLength_ << token::END_STATEMENT << nl; - os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; - os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "mixingLength", mixingLength_); + Foam::writeEntry(os, "phi", this->phiName_); + Foam::writeEntry(os, "k", kName_); writeEntry("value", os); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C index f76dc4e286..984022b0c2 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -126,7 +126,7 @@ void Foam::fixedShearStressFvPatchVectorField::updateCoeffs() void Foam::fixedShearStressFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); - os.writeKeyword("tau") << tau0_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "tau", tau0_); writeEntry("value", os); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C index bfd6211a58..4349e8395e 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -178,9 +178,9 @@ void Foam::porousBafflePressureFvPatchField::write(Ostream& os) const fixedJumpFvPatchField::write(os); writeEntryIfDifferent(os, "phi", "phi", phiName_); writeEntryIfDifferent(os, "rho", "rho", rhoName_); - os.writeKeyword("D") << D_ << token::END_STATEMENT << nl; - os.writeKeyword("I") << I_ << token::END_STATEMENT << nl; - os.writeKeyword("length") << length_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "D", D_); + Foam::writeEntry(os, "I", I_); + Foam::writeEntry(os, "length", length_); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index e2a42edfad..f517d1f1a9 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,9 +57,9 @@ void Foam::epsilonWallFunctionFvPatchScalarField::writeLocalEntries Ostream& os ) const { - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Cmu", Cmu_); + Foam::writeEntry(os, "kappa", kappa_); + Foam::writeEntry(os, "E", E_); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C index 83db48adf0..f9a3df2f8a 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,9 +55,9 @@ void fWallFunctionFvPatchScalarField::checkType() void fWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Cmu", Cmu_); + Foam::writeEntry(os, "kappa", kappa_); + Foam::writeEntry(os, "E", E_); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C index bdd600111a..806b77a838 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -233,10 +233,10 @@ void kLowReWallFunctionFvPatchScalarField::evaluate void kLowReWallFunctionFvPatchScalarField::write(Ostream& os) const { - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; - os.writeKeyword("Ceps2") << Ceps2_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Cmu", Cmu_); + Foam::writeEntry(os, "kappa", kappa_); + Foam::writeEntry(os, "E", E_); + Foam::writeEntry(os, "Ceps2", Ceps2_); fixedValueFvPatchField::write(os); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index 51008924d2..c23b9bebbb 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -294,12 +294,9 @@ void nutURoughWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); writeLocalEntries(os); - os.writeKeyword("roughnessHeight") - << roughnessHeight_ << token::END_STATEMENT << nl; - os.writeKeyword("roughnessConstant") - << roughnessConstant_ << token::END_STATEMENT << nl; - os.writeKeyword("roughnessFactor") - << roughnessFactor_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "roughnessHeight", roughnessHeight_); + Foam::writeEntry(os, "roughnessConstant", roughnessConstant_); + Foam::writeEntry(os, "roughnessFactor", roughnessFactor_); writeEntry("value", os); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C index a3b84eda2b..6398d54581 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -204,8 +204,7 @@ tmp nutUTabulatedWallFunctionFvPatchScalarField::yPlus() const void nutUTabulatedWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("uPlusTable") << uPlusTableName_ - << token::END_STATEMENT << nl; + Foam::writeEntry(os, "uPlusTable", uPlusTableName_); writeEntry("value", os); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C index 432526fb11..7ab95dbd43 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,9 +57,9 @@ void Foam::nutWallFunctionFvPatchScalarField::writeLocalEntries Ostream& os ) const { - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Cmu", Cmu_); + Foam::writeEntry(os, "kappa", kappa_); + Foam::writeEntry(os, "E", E_); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index c6916aaccd..50b4ccc42e 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,11 +59,11 @@ void omegaWallFunctionFvPatchScalarField::checkType() void omegaWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; - os.writeKeyword("beta1") << beta1_ << token::END_STATEMENT << nl; - os.writeKeyword("blended") << blended_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Cmu", Cmu_); + Foam::writeEntry(os, "kappa", kappa_); + Foam::writeEntry(os, "E", E_); + Foam::writeEntry(os, "beta1", beta1_); + Foam::writeEntry(os, "blended", blended_); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C index 4fbd1c571a..3ee0617f26 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,9 +55,9 @@ void v2WallFunctionFvPatchScalarField::checkType() void v2WallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Cmu", Cmu_); + Foam::writeEntry(os, "kappa", kappa_); + Foam::writeEntry(os, "E", E_); } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C index b61c8aa47f..84ad17cb34 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C +++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -255,27 +255,18 @@ Foam::tmp Foam::atmBoundaryLayer::epsilon void Foam::atmBoundaryLayer::write(Ostream& os) const { z0_.writeEntry("z0", os) ; - os.writeKeyword("flowDir") - << flowDir_ << token::END_STATEMENT << nl; - os.writeKeyword("zDir") - << zDir_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") - << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("Cmu") - << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("Uref") - << Uref_ << token::END_STATEMENT << nl; - os.writeKeyword("Zref") - << Zref_ << token::END_STATEMENT << nl; + writeEntry(os, "flowDir", flowDir_); + writeEntry(os, "zDir", zDir_); + writeEntry(os, "kappa", kappa_); + writeEntry(os, "Cmu", Cmu_); + writeEntry(os, "Uref", Uref_); + writeEntry(os, "Zref", Zref_); if (offset_) { - os.writeKeyword("Ulower") - << Ulower_ << token::END_STATEMENT << nl; - os.writeKeyword("kLower") - << kLower_ << token::END_STATEMENT << nl; - os.writeKeyword("epsilonLower") - << epsilonLower_ << token::END_STATEMENT << nl; + writeEntry(os, "Ulower", Ulower_); + writeEntry(os, "kLower", kLower_); + writeEntry(os, "epsilonLower", epsilonLower_); } zGround_.writeEntry("zGround", os) ; diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index fd215cfd6c..b73dcfc273 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -188,6 +188,7 @@ $(derivedFvPatchFields)/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVe $(derivedFvPatchFields)/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/syringePressure/syringePressureFvPatchScalarField.C +$(derivedFvPatchFields)/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMapped.C $(derivedFvPatchFields)/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFields.C $(derivedFvPatchFields)/totalPressure/totalPressureFvPatchScalarField.C $(derivedFvPatchFields)/totalTemperature/totalTemperatureFvPatchScalarField.C diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C index 572fba98f7..41e405865b 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -573,16 +573,15 @@ void Foam::MRFZone::writeData(Ostream& os) const os << nl; os.write(name_) << nl; os << token::BEGIN_BLOCK << incrIndent << nl; - os.writeKeyword("active") << active_ << token::END_STATEMENT << nl; - os.writeKeyword("cellZone") << cellZoneName_ << token::END_STATEMENT << nl; - os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl; - os.writeKeyword("axis") << axis_ << token::END_STATEMENT << nl; + writeEntry(os, "active", active_); + writeEntry(os, "cellZone", cellZoneName_); + writeEntry(os, "origin", origin_); + writeEntry(os, "axis", axis_); omega_->writeData(os); if (excludedPatchNames_.size()) { - os.writeKeyword("nonRotatingPatches") << excludedPatchNames_ - << token::END_STATEMENT << nl; + writeEntry(os, "nonRotatingPatches", excludedPatchNames_); } os << decrIndent << token::END_BLOCK << nl; diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C index 154c6537b8..22b9ebddb4 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -158,9 +158,9 @@ void Foam::SRFFreestreamVelocityFvPatchVectorField::updateCoeffs() void Foam::SRFFreestreamVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); - os.writeKeyword("relative") << relative_ << token::END_STATEMENT << nl; - os.writeKeyword("UInf") << UInf_ << token::END_STATEMENT << nl; - os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "relative", relative_); + Foam::writeEntry(os, "UInf", UInf_); + Foam::writeEntry(os, "phi", this->phiName_); writeEntry("value", os); } diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C index acc8694140..d031e67853 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -153,7 +153,7 @@ void Foam::SRFVelocityFvPatchVectorField::updateCoeffs() void Foam::SRFVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); - os.writeKeyword("relative") << relative_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "relative", relative_); inletValue_.writeEntry("inletValue", os); writeEntry("value", os); } diff --git a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C index 10c00add88..2a9c6dedeb 100644 --- a/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C +++ b/src/finiteVolume/cfdTools/general/fvOptions/fvOptionIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,9 +42,9 @@ void Foam::fv::option::writeFooter(Ostream& os) const void Foam::fv::option::writeData(Ostream& os) const { - os.writeKeyword("type") << type() << token::END_STATEMENT << nl; - os.writeKeyword("active") << active_ << token::END_STATEMENT << nl << nl; - + writeEntry(os, "type", type()); + writeEntry(os, "active", active_); + os << nl; os << indent << word(type() + "Coeffs"); coeffs_.write(os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C index 08b6680d40..e16674957e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -293,16 +293,11 @@ void Foam::activeBaffleVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); writeEntryIfDifferent(os, "p", "p", pName_); - os.writeKeyword("cyclicPatch") - << cyclicPatchName_ << token::END_STATEMENT << nl; - os.writeKeyword("orientation") - << orientation_ << token::END_STATEMENT << nl; - os.writeKeyword("openingTime") - << openingTime_ << token::END_STATEMENT << nl; - os.writeKeyword("maxOpenFractionDelta") - << maxOpenFractionDelta_ << token::END_STATEMENT << nl; - os.writeKeyword("openFraction") - << openFraction_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "cyclicPatch", cyclicPatchName_); + Foam::writeEntry(os, "orientation", orientation_); + Foam::writeEntry(os, "openingTime", openingTime_); + Foam::writeEntry(os, "maxOpenFractionDelta", maxOpenFractionDelta_); + Foam::writeEntry(os, "openFraction", openFraction_); writeEntryIfDifferent(os, "p", "p", pName_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C index 04b9b8a237..d48bbbdbb1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -355,20 +355,13 @@ write(Ostream& os) const { fvPatchVectorField::write(os); writeEntryIfDifferent(os, "p", "p", pName_); - os.writeKeyword("cyclicPatch") - << cyclicPatchName_ << token::END_STATEMENT << nl; - os.writeKeyword("orientation") - << orientation_ << token::END_STATEMENT << nl; - os.writeKeyword("openingTime") - << openingTime_ << token::END_STATEMENT << nl; - os.writeKeyword("maxOpenFractionDelta") - << maxOpenFractionDelta_ << token::END_STATEMENT << nl; - os.writeKeyword("openFraction") - << openFraction_ << token::END_STATEMENT << nl; - os.writeKeyword("minThresholdValue") - << minThresholdValue_ << token::END_STATEMENT << nl; - os.writeKeyword("forceBased") - << fBased_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "cyclicPatch", cyclicPatchName_); + Foam::writeEntry(os, "orientation", orientation_); + Foam::writeEntry(os, "openingTime", openingTime_); + Foam::writeEntry(os, "maxOpenFractionDelta", maxOpenFractionDelta_); + Foam::writeEntry(os, "openFraction", openFraction_); + Foam::writeEntry(os, "minThresholdValue", minThresholdValue_); + Foam::writeEntry(os, "forceBased", fBased_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C index 115d3e6da2..c67c2d1c80 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -339,13 +339,13 @@ void Foam::advectiveFvPatchField::write(Ostream& os) const { fvPatchField::write(os); - this->template writeEntryIfDifferent(os, "phi", "phi", phiName_); - this->template writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "phi", "phi", phiName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); if (lInf_ > 0) { - os.writeKeyword("fieldInf") << fieldInf_ << token::END_STATEMENT << nl; - os.writeKeyword("lInf") << lInf_ << token::END_STATEMENT << nl; + writeEntry(os, "fieldInf", fieldInf_); + writeEntry(os, "lInf", lInf_); } this->writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C index 48a8bffcd0..d497ac53fb 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -147,8 +147,8 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::updateCoeffs() void Foam::cylindricalInletVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl; - os.writeKeyword("axis") << axis_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "origin", origin_); + Foam::writeEntry(os, "axis", axis_); axialVelocity_->writeData(os); radialVelocity_->writeData(os); rpm_->writeData(os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C index f658b1cabf..8b475648e1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -808,16 +808,13 @@ void Foam::externalCoupledMixedFvPatchField::write(Ostream& os) const { mixedFvPatchField::write(os); - os.writeKeyword("commsDir") << commsDir_ << token::END_STATEMENT << nl; - os.writeKeyword("file") << fName_ << token::END_STATEMENT << nl; - os.writeKeyword("waitInterval") << waitInterval_ << token::END_STATEMENT - << nl; - os.writeKeyword("timeOut") << timeOut_ << token::END_STATEMENT << nl; - os.writeKeyword("calcFrequency") << calcFrequency_ << token::END_STATEMENT - << nl; - os.writeKeyword("initByExternal") << initByExternal_ << token::END_STATEMENT - << nl; - os.writeKeyword("log") << log_ << token::END_STATEMENT << nl; + writeEntry(os, "commsDir", commsDir_); + writeEntry(os, "file", fName_); + writeEntry(os, "waitInterval", waitInterval_); + writeEntry(os, "timeOut", timeOut_); + writeEntry(os, "calcFrequency", calcFrequency_); + writeEntry(os, "initByExternal", initByExternal_); + writeEntry(os, "log", log_); this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C index 60f553bf3e..0bf63729d6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -171,8 +171,7 @@ void Foam::fanPressureFvPatchScalarField::write(Ostream& os) const { totalPressureFvPatchScalarField::write(os); fanCurve_.write(os); - os.writeKeyword("direction") - << fanFlowDirectionNames_[direction_] << token::END_STATEMENT << nl; + Foam::writeEntry(os, "direction", fanFlowDirectionNames_[direction_]); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index cbadd96009..73e5bf402c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -155,8 +155,7 @@ template void Foam::fixedJumpFvPatchField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("patchType") << this->interfaceFieldType() - << token::END_STATEMENT << nl; + writeEntry(os, "patchType", this->interfaceFieldType()); if (this->cyclicPatch().owner()) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C index aaf2d7c068..7d77d4d48f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -169,8 +169,7 @@ template void Foam::fixedJumpAMIFvPatchField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("patchType") << this->interfaceFieldType() - << token::END_STATEMENT << nl; + writeEntry(os, "patchType", this->interfaceFieldType()); if (this->cyclicAMIPatch().owner()) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C index 65eaa56936..11b34f6ea3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -181,8 +181,7 @@ const { fvPatchVectorField::write(os); writeEntryIfDifferent(os, "phi", "phi", phiName_); - os.writeKeyword("fixTangentialInflow") - << fixTangentialInflow_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "fixTangentialInflow", fixTangentialInflow_); os.writeKeyword("normalVelocity") << nl << indent << token::BEGIN_BLOCK << nl << incrIndent; normalVelocity_->write(os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C index 55b1c78fad..d7fc25a2b2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -158,8 +158,8 @@ void Foam::fixedProfileFvPatchField::write(Ostream& os) const { fvPatchField::write(os); profile_->writeData(os); - os.writeKeyword("direction") << dir_ << token::END_STATEMENT << nl; - os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl; + writeEntry(os, "direction", dir_); + writeEntry(os, "origin", origin_); this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index b8e2c4bb89..9a37d4b048 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -246,8 +246,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const writeEntryIfDifferent(os, "rho", "rho", rhoName_); writeEntryIfDifferent(os, "rhoInlet", -vGreat, rhoInlet_); } - os.writeKeyword("extrapolateProfile") - << extrapolateProfile_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "extrapolateProfile", extrapolateProfile_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.C index 5c11d6555a..078fbd6b33 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,8 +108,7 @@ void Foam::freestreamFvPatchField::write(Ostream& os) const fvPatchField::write(os); if (this->phiName_ != "phi") { - os.writeKeyword("phi") - << this->phiName_ << token::END_STATEMENT << nl; + writeEntry(os, "phi", this->phiName_); } freestreamValue().writeEntry("freestreamValue", os); this->writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C index 1c9fe68dbb..127bd366c6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -149,7 +149,7 @@ void Foam::freestreamPressureFvPatchScalarField::write(Ostream& os) const fvPatchScalarField::write(os); writeEntryIfDifferent(os, "U", "U", UName_); freestreamValue().writeEntry("freestreamValue", os); - os.writeKeyword("supersonic") << supersonic_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "supersonic", supersonic_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C index cd8406b105..57f3f88586 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -138,7 +138,7 @@ void Foam::inletOutletFvPatchField::write(Ostream& os) const fvPatchField::write(os); if (phiName_ != "phi") { - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + writeEntry(os, "phi", phiName_); } this->refValue().writeEntry("inletValue", os); this->writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C index 0ec9baa9ea..8fecfaff0b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -190,7 +190,7 @@ const writeEntryIfDifferent(os, "U", "U", UName_); writeEntryIfDifferent(os, "phi", "phi", this->phiName_); writeEntryIfDifferent(os, "psi", "psi", psiName_); - os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "gamma", gamma_); T0_.writeEntry("T0", os); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C index 4bbdcf6784..3c1d528d52 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -314,11 +314,10 @@ tmp> mappedPatchFieldBase::mappedField() const template void mappedPatchFieldBase::write(Ostream& os) const { - os.writeKeyword("field") << fieldName_ << token::END_STATEMENT << nl; - os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl; - os.writeKeyword("average") << average_ << token::END_STATEMENT << nl; - os.writeKeyword("interpolationScheme") << interpolationScheme_ - << token::END_STATEMENT << nl; + writeEntry(os, "field", fieldName_); + writeEntry(os, "setAverage", setAverage_); + writeEntry(os, "average", average_); + writeEntry(os, "interpolationScheme", interpolationScheme_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C index ada704f033..2ba1e6f11e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -188,7 +188,7 @@ void Foam::mappedFlowRateFvPatchVectorField::write fvPatchField::write(os); writeEntryIfDifferent(os, "phi", "phi", phiName_); writeEntryIfDifferent(os, "rho", "rho", rhoName_); - os.writeKeyword("nbrPhi") << nbrPhiName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "nbrPhi", nbrPhiName_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/matchedFlowRateOutletVelocity/matchedFlowRateOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/matchedFlowRateOutletVelocity/matchedFlowRateOutletVelocityFvPatchVectorField.C index 8dd794059b..f84539d446 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/matchedFlowRateOutletVelocity/matchedFlowRateOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/matchedFlowRateOutletVelocity/matchedFlowRateOutletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -244,12 +244,10 @@ void Foam::matchedFlowRateOutletVelocityFvPatchVectorField::write ) const { fvPatchField::write(os); - os.writeKeyword("inletPatch") - << inletPatchName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "inletPatch", inletPatchName_); if (!volumetric_) { - os.writeKeyword("volumetric") - << volumetric_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "volumetric", volumetric_); writeEntryIfDifferent(os, "rho", "rho", rhoName_); } writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C index 665e9ac8e0..43d0180fa7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -138,7 +138,7 @@ void Foam::outletInletFvPatchField::write(Ostream& os) const fvPatchField::write(os); if (phiName_ != "phi") { - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + writeEntry(os, "phi", phiName_); } this->refValue().writeEntry("outletValue", os); this->writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.C index 5c8c866b36..6bd2fccb2c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletMappedUniformInlet/outletMappedUniformInletFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -168,11 +168,10 @@ template void Foam::outletMappedUniformInletFvPatchField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("outletPatch") - << outletPatchName_ << token::END_STATEMENT << nl; + writeEntry(os, "outletPatch", outletPatchName_); if (phiName_ != "phi") { - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + writeEntry(os, "phi", phiName_); } this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.C index 1880e8c8e7..9ee83a7038 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -169,7 +169,7 @@ void Foam::outletPhaseMeanVelocityFvPatchVectorField::write fvPatchField::write(os); UnMean_->writeData(os); - os.writeKeyword("alpha") << alphaName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "alpha", alphaName_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C index ea1ca32a5f..2b7406d6de 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -163,12 +163,11 @@ void Foam::phaseHydrostaticPressureFvPatchScalarField::write(Ostream& os) const fvPatchScalarField::write(os); if (phaseFraction_ != "alpha") { - os.writeKeyword("phaseFraction") - << phaseFraction_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "phaseFraction", phaseFraction_); } - os.writeKeyword("rho") << rho_ << token::END_STATEMENT << nl; - os.writeKeyword("pRefValue") << pRefValue_ << token::END_STATEMENT << nl; - os.writeKeyword("pRefPoint") << pRefPoint_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "rho", rho_); + Foam::writeEntry(os, "pRefValue", pRefValue_); + Foam::writeEntry(os, "pRefPoint", pRefPoint_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C index dd6df19d09..2482bc94a5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -300,29 +300,24 @@ void Foam::plenumPressureFvPatchScalarField::updateCoeffs() void Foam::plenumPressureFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); - os.writeKeyword("gamma") << gamma_ - << token::END_STATEMENT << nl; - os.writeKeyword("R") << R_ - << token::END_STATEMENT << nl; - os.writeKeyword("supplyMassFlowRate") << supplyMassFlowRate_ - << token::END_STATEMENT << nl; - os.writeKeyword("supplyTotalTemperature") << supplyTotalTemperature_ - << token::END_STATEMENT << nl; - os.writeKeyword("plenumVolume") << plenumVolume_ - << token::END_STATEMENT << nl; - os.writeKeyword("plenumDensity") << plenumDensity_ - << token::END_STATEMENT << nl; - os.writeKeyword("plenumTemperature") << plenumTemperature_ - << token::END_STATEMENT << nl; + Foam::writeEntry(os, "gamma", gamma_); + Foam::writeEntry(os, "R", R_); + Foam::writeEntry(os, "supplyMassFlowRate", supplyMassFlowRate_); + Foam::writeEntry(os, "supplyTotalTemperature", supplyTotalTemperature_); + Foam::writeEntry(os, "plenumVolume", plenumVolume_); + Foam::writeEntry(os, "plenumDensity", plenumDensity_); + Foam::writeEntry(os, "plenumTemperature", plenumTemperature_); if (hasRho_) { - os.writeKeyword("rho") << rho_ - << token::END_STATEMENT << nl; + Foam::writeEntry(os, "rho", rho_); } - os.writeKeyword("inletAreaRatio") << inletAreaRatio_ - << token::END_STATEMENT << nl; - os.writeKeyword("inletDischargeCoefficient") << inletDischargeCoefficient_ - << token::END_STATEMENT << nl; + Foam::writeEntry(os, "inletAreaRatio", inletAreaRatio_); + Foam::writeEntry + ( + os, + "inletDischargeCoefficient", + inletDischargeCoefficient_ + ); writeEntryIfDifferent(os, "timeScale", 0.0, timeScale_); writeEntryIfDifferent(os, "phi", "phi", phiName_); writeEntryIfDifferent(os, "U", "U", UName_); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C index dad334e4f5..59eea5f699 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -159,8 +159,8 @@ void Foam::pressureNormalInletOutletVelocityFvPatchVectorField::write ) const { fvPatchVectorField::write(os); - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; - os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "phi", phiName_); + Foam::writeEntry(os, "rho", rhoName_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C index fbe882bc0e..1b4acc442f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -127,7 +127,7 @@ void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::write ) const { fvPatchVectorField::write(os); - os.writeKeyword("phi") << phiName() << token::END_STATEMENT << nl; + Foam::writeEntry(os, "phi", phiName()); omega_->writeData(os); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C index aeecdd1a08..9fb68e11ff 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -145,8 +145,8 @@ void Foam::rotatingWallVelocityFvPatchVectorField::updateCoeffs() void Foam::rotatingWallVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); - os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl; - os.writeKeyword("axis") << axis_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "origin", origin_); + Foam::writeEntry(os, "axis", axis_); omega_->writeData(os); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C index eddd46adc5..1187d300e5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -298,10 +298,10 @@ void Foam::supersonicFreestreamFvPatchVectorField::write(Ostream& os) const writeEntryIfDifferent(os, "T", "T", TName_); writeEntryIfDifferent(os, "p", "p", pName_); writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); - os.writeKeyword("UInf") << UInf_ << token::END_STATEMENT << nl; - os.writeKeyword("pInf") << pInf_ << token::END_STATEMENT << nl; - os.writeKeyword("TInf") << TInf_ << token::END_STATEMENT << nl; - os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "UInf", UInf_); + Foam::writeEntry(os, "pInf", pInf_); + Foam::writeEntry(os, "TInf", TInf_); + Foam::writeEntry(os, "gamma", gamma_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C index d21453884a..367474ded1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -201,8 +201,8 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::write fvPatchField::write(os); writeEntryIfDifferent(os, "phi", "phi", phiName_); writeEntryIfDifferent(os, "rho", "rho", rhoName_); - os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl; - os.writeKeyword("axis") << axis_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "origin", origin_); + Foam::writeEntry(os, "axis", axis_); flowRate_->writeData(os); rpm_->writeData(os); writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.C index f1cc756cf5..c74fea4d9a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlInletVelocity/swirlInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -145,8 +145,8 @@ void Foam::swirlInletVelocityFvPatchVectorField::updateCoeffs() void Foam::swirlInletVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl; - os.writeKeyword("axis") << axis_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "origin", origin_); + Foam::writeEntry(os, "axis", axis_); axialVelocity_->writeData(os); radialVelocity_->writeData(os); tangentialVelocity_->writeData(os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C index d4cdc2b4da..bd997e16e4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -233,16 +233,16 @@ void Foam::syringePressureFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); - os.writeKeyword("Ap") << Ap_ << token::END_STATEMENT << nl; - os.writeKeyword("Sp") << Sp_ << token::END_STATEMENT << nl; - os.writeKeyword("VsI") << VsI_ << token::END_STATEMENT << nl; - os.writeKeyword("tas") << tas_ << token::END_STATEMENT << nl; - os.writeKeyword("tae") << tae_ << token::END_STATEMENT << nl; - os.writeKeyword("tds") << tds_ << token::END_STATEMENT << nl; - os.writeKeyword("tde") << tde_ << token::END_STATEMENT << nl; - os.writeKeyword("psI") << psI_ << token::END_STATEMENT << nl; - os.writeKeyword("psi") << psi_ << token::END_STATEMENT << nl; - os.writeKeyword("ams") << ams_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "Ap", Ap_); + Foam::writeEntry(os, "Sp", Sp_); + Foam::writeEntry(os, "VsI", VsI_); + Foam::writeEntry(os, "tas", tas_); + Foam::writeEntry(os, "tae", tae_); + Foam::writeEntry(os, "tds", tds_); + Foam::writeEntry(os, "tde", tde_); + Foam::writeEntry(os, "psI", psI_); + Foam::writeEntry(os, "psi", psi_); + Foam::writeEntry(os, "ams", ams_); writeEntryIfDifferent(os, "phi", "phi", phiName_); writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C index ea56bbb7a2..8c795cc662 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,240 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "timeVaryingMappedFixedValueFvPatchField.H" -#include "Time.H" -#include "AverageField.H" -#include "IFstream.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -template -Foam::fileName -Foam::timeVaryingMappedFixedValueFvPatchField::findFieldFile -( - const word& timeName -) const -{ - const fileName fieldFileName - ( - dataDir_/timeName/sampleName_/fieldTableName_ - ); - - const fileName typeFieldFileName - ( - dataDir_/timeName/sampleName_ - /pTraits::typeName + Field::typeName - /fieldTableName_ - ); - - if (exists(fieldFileName)) - { - return fieldFileName; - } - else if (exists(typeFieldFileName)) - { - return typeFieldFileName; - } - else - { - FatalErrorInFunction - << "Cannot find field file " - << fieldFileName << " " << typeFieldFileName - << exit(FatalError); - - return fileName::null; - } -} - - -template -void Foam::timeVaryingMappedFixedValueFvPatchField::checkTable() -{ - // Initialise - if (mapperPtr_.empty()) - { - // Reread values and interpolate - const fileName samplePointsFile(dataDir_/pointsName_); - - pointField samplePoints((IFstream(samplePointsFile)())); - - if (debug) - { - Info<< "timeVaryingMappedFixedValueFvPatchField :" - << " Read " << samplePoints.size() << " sample points from " - << samplePointsFile << endl; - } - - - // tbd: run-time selection - bool nearestOnly - ( - !mapMethod_.empty() - && mapMethod_ != "planarInterpolation" - ); - - // Allocate the interpolator - mapperPtr_.reset - ( - new pointToPointPlanarInterpolation - ( - samplePoints, - this->patch().patch().faceCentres(), - perturb_, - nearestOnly - ) - ); - - // Read the times for which data is available - sampleTimes_ = Time::findTimes(dataDir_); - - if (debug) - { - Info<< "timeVaryingMappedFixedValueFvPatchField : In directory " - << dataDir_ << " found times " - << pointToPointPlanarInterpolation::timeNames(sampleTimes_) - << endl; - } - } - - - // Find current time in sampleTimes - label lo = -1; - label hi = -1; - - bool foundTime = mapperPtr_().findTime - ( - sampleTimes_, - startSampleTime_, - this->db().time().value(), - lo, - hi - ); - - if (!foundTime) - { - FatalErrorInFunction - << "Cannot find starting sampling values for current time " - << this->db().time().value() << nl - << "Have sampling values for times " - << pointToPointPlanarInterpolation::timeNames(sampleTimes_) << nl - << "In directory " << dataDir_ << " of field " << fieldTableName_ - << exit(FatalError); - } - - - // Update sampled data fields. - - if (lo != startSampleTime_) - { - startSampleTime_ = lo; - - if (startSampleTime_ == endSampleTime_) - { - // No need to reread since are end values - if (debug) - { - Pout<< "checkTable : Setting startValues to (already read) " - << dataDir_/sampleTimes_[startSampleTime_].name() - << endl; - } - startSampledValues_ = endSampledValues_; - startAverage_ = endAverage_; - } - else - { - if (debug) - { - Pout<< "checkTable : Reading startValues from " - << dataDir_/sampleTimes_[lo].name() - << endl; - } - - // Reread values and interpolate - const fileName valsFile - ( - findFieldFile(sampleTimes_[startSampleTime_].name()) - ); - - Field vals; - - if (setAverage_) - { - AverageField avals((IFstream(valsFile)())); - vals = avals; - startAverage_ = avals.average(); - } - else - { - IFstream(valsFile)() >> vals; - } - - if (vals.size() != mapperPtr_().sourceSize()) - { - FatalErrorInFunction - << "Number of values (" << vals.size() - << ") differs from the number of points (" - << mapperPtr_().sourceSize() - << ") in file " << valsFile << exit(FatalError); - } - - startSampledValues_ = mapperPtr_().interpolate(vals); - } - } - - if (hi != endSampleTime_) - { - endSampleTime_ = hi; - - if (endSampleTime_ == -1) - { - // endTime no longer valid. Might as well clear endValues. - if (debug) - { - Pout<< "checkTable : Clearing endValues" << endl; - } - endSampledValues_.clear(); - } - else - { - if (debug) - { - Pout<< "checkTable : Reading endValues from " - << dataDir_/sampleTimes_[endSampleTime_].name() - << endl; - } - - // Reread values and interpolate - const fileName valsFile - ( - findFieldFile(sampleTimes_[endSampleTime_].name()) - ); - - Field vals; - - if (setAverage_) - { - AverageField avals((IFstream(valsFile)())); - vals = avals; - endAverage_ = avals.average(); - } - else - { - IFstream(valsFile)() >> vals; - } - - if (vals.size() != mapperPtr_().sourceSize()) - { - FatalErrorInFunction - << "Number of values (" << vals.size() - << ") differs from the number of points (" - << mapperPtr_().sourceSize() - << ") in file " << valsFile << exit(FatalError); - } - - endSampledValues_ = mapperPtr_().interpolate(vals); - } - } -} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -271,21 +37,7 @@ timeVaryingMappedFixedValueFvPatchField ) : fixedValueFvPatchField(p, iF), - fieldTableName_(iF.name()), - dataDir_(this->db().time().constant()/"boundaryData"/this->patch().name()), - pointsName_("points"), - sampleName_(word::null), - setAverage_(false), - perturb_(0), - mapperPtr_(nullptr), - sampleTimes_(0), - startSampleTime_(-1), - startSampledValues_(0), - startAverage_(Zero), - endSampleTime_(-1), - endSampledValues_(0), - endAverage_(Zero), - offset_() + fieldMapper_(p, iF.name()) {} @@ -299,59 +51,8 @@ timeVaryingMappedFixedValueFvPatchField ) : fixedValueFvPatchField(p, iF, dict, false), - fieldTableName_(dict.lookupOrDefault("fieldTable", iF.name())), - dataDir_ - ( - dict.lookupOrDefault - ( - "dataDir", - this->db().time().constant()/"boundaryData"/this->patch().name() - ) - ), - pointsName_(dict.lookupOrDefault("points", "points")), - sampleName_(dict.lookupOrDefault("sample", word::null)), - setAverage_(dict.lookupOrDefault("setAverage", false)), - perturb_(dict.lookupOrDefault("perturb", 1e-5)), - mapMethod_ - ( - dict.lookupOrDefault - ( - "mapMethod", - "planarInterpolation" - ) - ), - mapperPtr_(nullptr), - sampleTimes_(0), - startSampleTime_(-1), - startSampledValues_(0), - startAverage_(Zero), - endSampleTime_(-1), - endSampledValues_(0), - endAverage_(Zero), - offset_() + fieldMapper_(p, dict, iF.name()) { - dataDir_.expand(); - pointsName_.expand(); - sampleName_.expand(); - - if (dict.found("offset")) - { - offset_ = Function1::New("offset", dict); - } - - if - ( - mapMethod_ != "planarInterpolation" - && mapMethod_ != "nearest" - ) - { - FatalIOErrorInFunction - ( - dict - ) << "mapMethod should be one of 'planarInterpolation'" - << ", 'nearest'" << exit(FatalIOError); - } - if (dict.found("value")) { fvPatchField::operator==(Field("value", dict, p.size())); @@ -378,22 +79,7 @@ timeVaryingMappedFixedValueFvPatchField ) : fixedValueFvPatchField(ptf, p, iF, mapper), - fieldTableName_(ptf.fieldTableName_), - dataDir_(ptf.dataDir_), - pointsName_(ptf.pointsName_), - sampleName_(ptf.sampleName_), - setAverage_(ptf.setAverage_), - perturb_(ptf.perturb_), - mapMethod_(ptf.mapMethod_), - mapperPtr_(nullptr), - sampleTimes_(0), - startSampleTime_(-1), - startSampledValues_(0), - startAverage_(Zero), - endSampleTime_(-1), - endSampledValues_(0), - endAverage_(Zero), - offset_(ptf.offset_, false) + fieldMapper_(ptf.fieldMapper_) {} @@ -405,22 +91,7 @@ timeVaryingMappedFixedValueFvPatchField ) : fixedValueFvPatchField(ptf), - fieldTableName_(ptf.fieldTableName_), - dataDir_(ptf.dataDir_), - pointsName_(ptf.pointsName_), - sampleName_(ptf.sampleName_), - setAverage_(ptf.setAverage_), - perturb_(ptf.perturb_), - mapMethod_(ptf.mapMethod_), - mapperPtr_(nullptr), - sampleTimes_(ptf.sampleTimes_), - startSampleTime_(ptf.startSampleTime_), - startSampledValues_(ptf.startSampledValues_), - startAverage_(ptf.startAverage_), - endSampleTime_(ptf.endSampleTime_), - endSampledValues_(ptf.endSampledValues_), - endAverage_(ptf.endAverage_), - offset_(ptf.offset_, false) + fieldMapper_(ptf.fieldMapper_) {} @@ -433,22 +104,7 @@ timeVaryingMappedFixedValueFvPatchField ) : fixedValueFvPatchField(ptf, iF), - fieldTableName_(ptf.fieldTableName_), - dataDir_(ptf.dataDir_), - pointsName_(ptf.pointsName_), - sampleName_(ptf.sampleName_), - setAverage_(ptf.setAverage_), - perturb_(ptf.perturb_), - mapMethod_(ptf.mapMethod_), - mapperPtr_(nullptr), - sampleTimes_(ptf.sampleTimes_), - startSampleTime_(ptf.startSampleTime_), - startSampledValues_(ptf.startSampledValues_), - startAverage_(ptf.startAverage_), - endSampleTime_(ptf.endSampleTime_), - endSampledValues_(ptf.endSampledValues_), - endAverage_(ptf.endAverage_), - offset_(ptf.offset_, false) + fieldMapper_(ptf.fieldMapper_) {} @@ -461,15 +117,7 @@ void Foam::timeVaryingMappedFixedValueFvPatchField::autoMap ) { fixedValueFvPatchField::autoMap(m); - if (startSampledValues_.size()) - { - startSampledValues_.autoMap(m); - endSampledValues_.autoMap(m); - } - // Clear interpolator - mapperPtr_.clear(); - startSampleTime_ = -1; - endSampleTime_ = -1; + fieldMapper_.autoMap(m); } @@ -481,17 +129,7 @@ void Foam::timeVaryingMappedFixedValueFvPatchField::rmap ) { fixedValueFvPatchField::rmap(ptf, addr); - - const timeVaryingMappedFixedValueFvPatchField& tiptf = - refCast>(ptf); - - startSampledValues_.rmap(tiptf.startSampledValues_, addr); - endSampledValues_.rmap(tiptf.endSampledValues_, addr); - - // Clear interpolator - mapperPtr_.clear(); - startSampleTime_ = -1; - endSampleTime_ = -1; + fieldMapper_.rmap(ptf, addr); } @@ -503,101 +141,7 @@ void Foam::timeVaryingMappedFixedValueFvPatchField::updateCoeffs() return; } - - checkTable(); - - // Interpolate between the sampled data - - Type wantedAverage; - - if (endSampleTime_ == -1) - { - // Only start value - if (debug) - { - Pout<< "updateCoeffs : Sampled, non-interpolated values" - << " from start time:" - << sampleTimes_[startSampleTime_].name() << nl; - } - - this->operator==(startSampledValues_); - wantedAverage = startAverage_; - } - else - { - scalar start = sampleTimes_[startSampleTime_].value(); - scalar end = sampleTimes_[endSampleTime_].value(); - - scalar s = (this->db().time().value() - start)/(end - start); - - if (debug) - { - Pout<< "updateCoeffs : Sampled, interpolated values" - << " between start time:" - << sampleTimes_[startSampleTime_].name() - << " and end time:" << sampleTimes_[endSampleTime_].name() - << " with weight:" << s << endl; - } - - this->operator==((1 - s)*startSampledValues_ + s*endSampledValues_); - wantedAverage = (1 - s)*startAverage_ + s*endAverage_; - } - - // Enforce average. Either by scaling (if scaling factor > 0.5) or by - // offsetting. - if (setAverage_) - { - const Field& fld = *this; - - Type averagePsi = - gSum(this->patch().magSf()*fld) - /gSum(this->patch().magSf()); - - if (debug) - { - Pout<< "updateCoeffs :" - << " actual average:" << averagePsi - << " wanted average:" << wantedAverage - << endl; - } - - if (mag(averagePsi) < vSmall) - { - // Field too small to scale. Offset instead. - const Type offset = wantedAverage - averagePsi; - if (debug) - { - Pout<< "updateCoeffs :" - << " offsetting with:" << offset << endl; - } - this->operator==(fld + offset); - } - else - { - const scalar scale = mag(wantedAverage)/mag(averagePsi); - - if (debug) - { - Pout<< "updateCoeffs :" - << " scaling with:" << scale << endl; - } - this->operator==(scale*fld); - } - } - - // Apply offset to mapped values - if (offset_.valid()) - { - const scalar t = this->db().time().timeOutputValue(); - this->operator==(*this + offset_->value(t)); - } - - if (debug) - { - Pout<< "updateCoeffs : set fixedValue to min:" << gMin(*this) - << " max:" << gMax(*this) - << " avg:" << gAverage(*this) << endl; - } + this->operator==(fieldMapper_.map()); fixedValueFvPatchField::updateCoeffs(); } @@ -610,44 +154,7 @@ void Foam::timeVaryingMappedFixedValueFvPatchField::write ) const { fvPatchField::write(os); - - this->writeEntryIfDifferent - ( - os, - "dataDir", - this->db().time().constant()/"boundaryData"/this->patch().name(), - dataDir_ - ); - - this->writeEntryIfDifferent(os, "points", fileName("points"), pointsName_); - - this->writeEntryIfDifferent(os, "sample", fileName::null, sampleName_); - - this->writeEntryIfDifferent(os, "setAverage", Switch(false), setAverage_); - - this->writeEntryIfDifferent(os, "perturb", scalar(1e-5), perturb_); - - this->writeEntryIfDifferent - ( - os, - "fieldTable", - this->internalField().name(), - fieldTableName_ - ); - - this->writeEntryIfDifferent - ( - os, - "mapMethod", - word("planarInterpolation"), - mapMethod_ - ); - - if (offset_.valid()) - { - offset_->writeData(os); - } - + fieldMapper_.write(os); this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H index ff8c6395af..c7d9dbe361 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,6 +89,7 @@ Usage See also Foam::fixedValueFvPatchField + Foam::timeVaryingMappedFvPatchField Foam::Function1Types SourceFiles @@ -100,10 +101,7 @@ SourceFiles #define timeVaryingMappedFixedValueFvPatchField_H #include "fixedValueFvPatchFields.H" -#include "FixedList.H" -#include "instantList.H" -#include "pointToPointPlanarInterpolation.H" -#include "Function1.H" +#include "timeVaryingMappedFvPatchField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -121,61 +119,7 @@ class timeVaryingMappedFixedValueFvPatchField { // Private data - //- Name of the field data table, defaults to the name of the field - word fieldTableName_; - - //- Optional name of the data directory, - // defaults to "constant/boundaryData/" - fileName dataDir_; - - //- Optional name of the points file, defaults to "points" - fileName pointsName_; - - //- Optional name of the sample sub-directory from which the field are - // read, defaults to "" - fileName sampleName_; - - //- If true adjust the mapped field to maintain average value - Switch setAverage_; - - //- Fraction of perturbation (fraction of bounding box) to add - scalar perturb_; - - //- Interpolation scheme to use - word mapMethod_; - - //- 2D interpolation (for 'planarInterpolation' mapMethod) - autoPtr mapperPtr_; - - //- List of boundaryData time directories - instantList sampleTimes_; - - //- Current starting index in sampleTimes - label startSampleTime_; - - //- Interpolated values from startSampleTime - Field startSampledValues_; - - //- If setAverage: starting average value - Type startAverage_; - - //- Current end index in sampleTimes - label endSampleTime_; - - //- Interpolated values from endSampleTime - Field endSampledValues_; - - //- If setAverage: end average value - Type endAverage_; - - //- Time varying offset values to interpolated data - autoPtr> offset_; - - //- Helper function to find the field files - fileName findFieldFile(const word& timeName) const; - - //- Find boundary data in between current time and interpolate - void checkTable(); + timeVaryingMappedFvPatchField fieldMapper_; public: @@ -248,15 +192,6 @@ public: // Member functions - // Access - - //- Return startSampledValues - const Field startSampledValues() - { - return startSampledValues_; - } - - // Mapping functions //- Map (and resize as needed) from self given a mapping object diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/AverageField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/AverageField.C similarity index 97% rename from src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/AverageField.C rename to src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/AverageField.C index b7f5cc0c51..505e79c84f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/AverageField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/AverageField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/AverageField.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/AverageField.H similarity index 97% rename from src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/AverageField.H rename to src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/AverageField.H index 0b0da19fa5..aeceef5b91 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/AverageField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/AverageField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMapped.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMapped.C new file mode 100644 index 0000000000..7f6978d7c8 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMapped.C @@ -0,0 +1,36 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "timeVaryingMappedFvPatchField.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(timeVaryingMapped, 0); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.C new file mode 100644 index 0000000000..106db4f843 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.C @@ -0,0 +1,559 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "timeVaryingMappedFvPatchField.H" +#include "Time.H" +#include "AverageField.H" +#include "IFstream.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +Foam::fileName +Foam::timeVaryingMappedFvPatchField::findFieldFile +( + const word& timeName +) const +{ + const fileName fieldFileName + ( + dataDir_/timeName/sampleName_/fieldTableName_ + ); + + const fileName typeFieldFileName + ( + dataDir_/timeName/sampleName_ + /pTraits::typeName + Field::typeName + /fieldTableName_ + ); + + if (exists(fieldFileName)) + { + return fieldFileName; + } + else if (exists(typeFieldFileName)) + { + return typeFieldFileName; + } + else + { + FatalErrorInFunction + << "Cannot find field file " + << fieldFileName << " " << typeFieldFileName + << exit(FatalError); + + return fileName::null; + } +} + + +template +void Foam::timeVaryingMappedFvPatchField::checkTable() +{ + // Initialise + if (mapperPtr_.empty()) + { + // Reread values and interpolate + const fileName samplePointsFile(dataDir_/pointsName_); + + pointField samplePoints((IFstream(samplePointsFile)())); + + if (debug) + { + Info<< "timeVaryingMappedFvPatchField :" + << " Read " << samplePoints.size() << " sample points from " + << samplePointsFile << endl; + } + + + // tbd: run-time selection + const bool nearestOnly + ( + !mapMethod_.empty() + && mapMethod_ != "planarInterpolation" + ); + + // Allocate the interpolator + mapperPtr_.reset + ( + new pointToPointPlanarInterpolation + ( + samplePoints, + patch_.patch().faceCentres(), + perturb_, + nearestOnly + ) + ); + + // Read the times for which data is available + sampleTimes_ = Time::findTimes(dataDir_); + + if (debug) + { + Info<< "timeVaryingMappedFvPatchField : In directory " + << dataDir_ << " found times " + << pointToPointPlanarInterpolation::timeNames(sampleTimes_) + << endl; + } + } + + + // Find current time in sampleTimes + label lo = -1; + label hi = -1; + + bool foundTime = mapperPtr_().findTime + ( + sampleTimes_, + startSampleTime_, + time().value(), + lo, + hi + ); + + if (!foundTime) + { + FatalErrorInFunction + << "Cannot find starting sampling values for current time " + << time().value() << nl + << "Have sampling values for times " + << pointToPointPlanarInterpolation::timeNames(sampleTimes_) << nl + << "In directory " << dataDir_ << " of field " << fieldTableName_ + << exit(FatalError); + } + + + // Update sampled data fields. + + if (lo != startSampleTime_) + { + startSampleTime_ = lo; + + if (startSampleTime_ == endSampleTime_) + { + // No need to reread since are end values + if (debug) + { + Pout<< "checkTable : Setting startValues to (already read) " + << dataDir_/sampleTimes_[startSampleTime_].name() + << endl; + } + startSampledValues_ = endSampledValues_; + startAverage_ = endAverage_; + } + else + { + if (debug) + { + Pout<< "checkTable : Reading startValues from " + << dataDir_/sampleTimes_[lo].name() + << endl; + } + + // Reread values and interpolate + const fileName valsFile + ( + findFieldFile(sampleTimes_[startSampleTime_].name()) + ); + + Field vals; + + if (setAverage_) + { + AverageField avals((IFstream(valsFile)())); + vals = avals; + startAverage_ = avals.average(); + } + else + { + IFstream(valsFile)() >> vals; + } + + if (vals.size() != mapperPtr_().sourceSize()) + { + FatalErrorInFunction + << "Number of values (" << vals.size() + << ") differs from the number of points (" + << mapperPtr_().sourceSize() + << ") in file " << valsFile << exit(FatalError); + } + + startSampledValues_ = mapperPtr_().interpolate(vals); + } + } + + if (hi != endSampleTime_) + { + endSampleTime_ = hi; + + if (endSampleTime_ == -1) + { + // endTime no longer valid. Might as well clear endValues. + if (debug) + { + Pout<< "checkTable : Clearing endValues" << endl; + } + endSampledValues_.clear(); + } + else + { + if (debug) + { + Pout<< "checkTable : Reading endValues from " + << dataDir_/sampleTimes_[endSampleTime_].name() + << endl; + } + + // Reread values and interpolate + const fileName valsFile + ( + findFieldFile(sampleTimes_[endSampleTime_].name()) + ); + + Field vals; + + if (setAverage_) + { + AverageField avals((IFstream(valsFile)())); + vals = avals; + endAverage_ = avals.average(); + } + else + { + IFstream(valsFile)() >> vals; + } + + if (vals.size() != mapperPtr_().sourceSize()) + { + FatalErrorInFunction + << "Number of values (" << vals.size() + << ") differs from the number of points (" + << mapperPtr_().sourceSize() + << ") in file " << valsFile << exit(FatalError); + } + + endSampledValues_ = mapperPtr_().interpolate(vals); + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::timeVaryingMappedFvPatchField::timeVaryingMappedFvPatchField +( + const fvPatch& p, + const word& fieldName +) +: + patch_(p), + fieldTableName_(word::null), + dataDir_(time().constant()/"boundaryData"/p.name()), + pointsName_("points"), + sampleName_(word::null), + setAverage_(false), + perturb_(0), + mapperPtr_(nullptr), + sampleTimes_(0), + startSampleTime_(-1), + startSampledValues_(0), + startAverage_(Zero), + endSampleTime_(-1), + endSampledValues_(0), + endAverage_(Zero), + offset_() +{} + + +template +Foam::timeVaryingMappedFvPatchField::timeVaryingMappedFvPatchField +( + const fvPatch& p, + const dictionary& dict, + const word& fieldName +) +: + patch_(p), + fieldTableName_(dict.lookupOrDefault("fieldTable", fieldName)), + dataDir_ + ( + dict.lookupOrDefault + ( + "dataDir", + time().constant()/"boundaryData"/p.name() + ) + ), + pointsName_(dict.lookupOrDefault("points", "points")), + sampleName_(dict.lookupOrDefault("sample", word::null)), + setAverage_(dict.lookupOrDefault("setAverage", false)), + perturb_(dict.lookupOrDefault("perturb", 1e-5)), + mapMethod_ + ( + dict.lookupOrDefault + ( + "mapMethod", + "planarInterpolation" + ) + ), + mapperPtr_(nullptr), + sampleTimes_(0), + startSampleTime_(-1), + startSampledValues_(0), + startAverage_(Zero), + endSampleTime_(-1), + endSampledValues_(0), + endAverage_(Zero), + offset_() +{ + dataDir_.expand(); + pointsName_.expand(); + sampleName_.expand(); + + if (dict.found("offset")) + { + offset_ = Function1::New("offset", dict); + } + + if + ( + mapMethod_ != "planarInterpolation" + && mapMethod_ != "nearest" + ) + { + FatalIOErrorInFunction + ( + dict + ) << "mapMethod should be one of 'planarInterpolation'" + << ", 'nearest'" << exit(FatalIOError); + } +} + + +template +Foam::timeVaryingMappedFvPatchField:: +timeVaryingMappedFvPatchField +( + const timeVaryingMappedFvPatchField& ptf +) +: + patch_(ptf.patch_), + fieldTableName_(ptf.fieldTableName_), + dataDir_(ptf.dataDir_), + pointsName_(ptf.pointsName_), + sampleName_(ptf.sampleName_), + setAverage_(ptf.setAverage_), + perturb_(ptf.perturb_), + mapMethod_(ptf.mapMethod_), + mapperPtr_(nullptr), + sampleTimes_(ptf.sampleTimes_), + startSampleTime_(ptf.startSampleTime_), + startSampledValues_(ptf.startSampledValues_), + startAverage_(ptf.startAverage_), + endSampleTime_(ptf.endSampleTime_), + endSampledValues_(ptf.endSampledValues_), + endAverage_(ptf.endAverage_), + offset_(ptf.offset_, false) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::timeVaryingMappedFvPatchField::autoMap +( + const fvPatchFieldMapper& m +) +{ + if (startSampledValues_.size()) + { + startSampledValues_.autoMap(m); + endSampledValues_.autoMap(m); + } + // Clear interpolator + mapperPtr_.clear(); + startSampleTime_ = -1; + endSampleTime_ = -1; +} + + +template +void Foam::timeVaryingMappedFvPatchField::rmap +( + const fvPatchField& ptf, + const labelList& addr +) +{ + const timeVaryingMappedFvPatchField& tiptf = + refCast>(ptf); + + startSampledValues_.rmap(tiptf.startSampledValues_, addr); + endSampledValues_.rmap(tiptf.endSampledValues_, addr); + + // Clear interpolator + mapperPtr_.clear(); + startSampleTime_ = -1; + endSampleTime_ = -1; +} + + +template +Foam::tmp> Foam::timeVaryingMappedFvPatchField::map() +{ + checkTable(); + + // Interpolate between the sampled data + + tmp> tfld(new Field(patch_.size())); + Field& fld = tfld.ref(); + + Type wantedAverage; + + if (endSampleTime_ == -1) + { + // Only start value + if (debug) + { + Pout<< "updateCoeffs : Sampled, non-interpolated values" + << " from start time:" + << sampleTimes_[startSampleTime_].name() << nl; + } + + fld = startSampledValues_; + wantedAverage = startAverage_; + } + else + { + const scalar start = sampleTimes_[startSampleTime_].value(); + const scalar end = sampleTimes_[endSampleTime_].value(); + + const scalar s = (time().value() - start)/(end - start); + + if (debug) + { + Pout<< "updateCoeffs : Sampled, interpolated values" + << " between start time:" + << sampleTimes_[startSampleTime_].name() + << " and end time:" << sampleTimes_[endSampleTime_].name() + << " with weight:" << s << endl; + } + + fld = (1 - s)*startSampledValues_ + s*endSampledValues_; + wantedAverage = (1 - s)*startAverage_ + s*endAverage_; + } + + // Enforce average. Either by scaling (if scaling factor > 0.5) or by + // offsetting. + if (setAverage_) + { + Type averagePsi = gSum(patch_.magSf()*fld)/gSum(patch_.magSf()); + + if (debug) + { + Pout<< "updateCoeffs :" + << " actual average:" << averagePsi + << " wanted average:" << wantedAverage + << endl; + } + + if (mag(averagePsi) < vSmall) + { + // Field too small to scale. Offset instead. + const Type offset = wantedAverage - averagePsi; + if (debug) + { + Pout<< "updateCoeffs :" + << " offsetting with:" << offset << endl; + } + fld += offset; + } + else + { + const scalar scale = mag(wantedAverage)/mag(averagePsi); + + if (debug) + { + Pout<< "updateCoeffs :" + << " scaling with:" << scale << endl; + } + fld *= scale; + } + } + + // Apply offset to mapped values + if (offset_.valid()) + { + const scalar t = time().timeOutputValue(); + fld += offset_->value(t); + } + + if (debug) + { + Pout<< "updateCoeffs : set fixedValue to min:" << gMin(fld) + << " max:" << gMax(fld) + << " avg:" << gAverage(fld) << endl; + } + + return tfld; +} + + +template +void Foam::timeVaryingMappedFvPatchField::write +( + Ostream& os +) const +{ + writeEntryIfDifferent + ( + os, + "dataDir", + time().constant()/"boundaryData"/patch_.name(), + dataDir_ + ); + + writeEntryIfDifferent(os, "points", fileName("points"), pointsName_); + writeEntryIfDifferent(os, "sample", fileName::null, sampleName_); + writeEntryIfDifferent(os, "setAverage", Switch(false), setAverage_); + writeEntryIfDifferent(os, "perturb", scalar(1e-5), perturb_); + + writeEntry(os, "fieldTable", fieldTableName_); + + writeEntryIfDifferent + ( + os, + "mapMethod", + word("planarInterpolation"), + mapMethod_ + ); + + if (offset_.valid()) + { + offset_->writeData(os); + } +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.H new file mode 100644 index 0000000000..2eb406f32e --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFvPatchField/timeVaryingMappedFvPatchField.H @@ -0,0 +1,250 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::timeVaryingMappedFvPatchField + +Description + Patch field mapper which interpolates the values from a set of supplied + points in space and time. + + By default the data files should be provide in + constant/boundaryData/\/ directory: + - points : pointField of locations + - \/\ : field of values at time \ + + Alternatively the names and locations of the points and field files may be + specified explicitly via the optional dictionary entries: + - dataDir \; + - points \; + - sample \; + This is particularly useful when mapping data from another case for which + the \c sample \c functionObject is used to obtain the patch field data for + mapping. + + The default mode of operation (mapMethod planarInterpolation) is to project + the points onto a plane (constructed from the first three points) and + construct a 2D triangulation and finds for the face centres the triangle it + is in and the weights to the 3 vertices. + + The optional mapMethod nearest will avoid all projection and triangulation + and just use the value at the nearest vertex. + + Values are interpolated linearly between times. + +Usage + \table + Property | Description | Required | Default value + setAverage | Switch to activate setting of average value | no | false + perturb | Perturb points for regular geometries | no | 1e-5 + fieldTable | Alternative field name to sample | no| this field name + mapMethod | Type of mapping | no | planarInterpolation + offset | Offset to mapped values | no | Zero + dataDir | Top-level directory of the points and field data \\ + | no | constant/boundaryData/\ + points | Path including name of points file relative to dataDir \\ + | no | points + sample | Name of the sub-directory in the time directories \\ + containing the fields | no | "" + \endtable + +See also + Foam::timeVaryingMappedFixedValueFvPatchField + Foam::Function1Types + +SourceFiles + timeVaryingMappedFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef timeVaryingMappedFvPatchField_H +#define timeVaryingMappedFvPatchField_H + +#include "fvPatchField.H" +#include "FixedList.H" +#include "instantList.H" +#include "pointToPointPlanarInterpolation.H" +#include "Function1.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class timeVaryingMapped Declaration +\*---------------------------------------------------------------------------*/ + +class timeVaryingMapped +{ +public: + + //- Runtime type information + ClassName("timeVaryingMapped"); + + + // Constructors + + //- Construct null + timeVaryingMapped() + {} +}; + + +/*---------------------------------------------------------------------------*\ + Class timeVaryingMappedFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class timeVaryingMappedFvPatchField +: + public timeVaryingMapped +{ + // Private data + + //- Reference to the patch the data is mapped to + const fvPatch& patch_; + + //- Name of the field data table, defaults to the name of the field + word fieldTableName_; + + //- Optional name of the data directory, + // defaults to "constant/boundaryData/" + fileName dataDir_; + + //- Optional name of the points file, defaults to "points" + fileName pointsName_; + + //- Optional name of the sample sub-directory from which the field are + // read, defaults to "" + fileName sampleName_; + + //- If true adjust the mapped field to maintain average value + Switch setAverage_; + + //- Fraction of perturbation (fraction of bounding box) to add + scalar perturb_; + + //- Interpolation scheme to use + word mapMethod_; + + //- 2D interpolation (for 'planarInterpolation' mapMethod) + autoPtr mapperPtr_; + + //- List of boundaryData time directories + instantList sampleTimes_; + + //- Current starting index in sampleTimes + label startSampleTime_; + + //- Interpolated values from startSampleTime + Field startSampledValues_; + + //- If setAverage: starting average value + Type startAverage_; + + //- Current end index in sampleTimes + label endSampleTime_; + + //- Interpolated values from endSampleTime + Field endSampledValues_; + + //- If setAverage: end average value + Type endAverage_; + + //- Time varying offset values to interpolated data + autoPtr> offset_; + + //- Helper function to find the field files + fileName findFieldFile(const word& timeName) const; + + //- Find boundary data in between current time and interpolate + void checkTable(); + + +public: + + // Constructors + + //- Construct from patch and field name + timeVaryingMappedFvPatchField(const fvPatch&, const word& fieldName); + + //- Construct from patch, dictionary and field name + timeVaryingMappedFvPatchField + ( + const fvPatch&, + const dictionary&, + const word& fieldName + ); + + //- Construct as copy + timeVaryingMappedFvPatchField + ( + const timeVaryingMappedFvPatchField& + ); + + + // Member functions + + const Time& time() const + { + return patch_.boundaryMesh().mesh().time(); + } + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + void autoMap(const fvPatchFieldMapper&); + + //- Reverse map the given fvPatchField onto this fvPatchField + void rmap(const fvPatchField&, const labelList&); + + + // Evaluation functions + + //- Return the current mapped patch field + tmp> map(); + + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "timeVaryingMappedFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C index 5a104b07df..d3dae34c28 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -245,9 +245,9 @@ void Foam::totalPressureFvPatchScalarField::write(Ostream& os) const fvPatchScalarField::write(os); writeEntryIfDifferent(os, "U", "U", UName_); writeEntryIfDifferent(os, "phi", "phi", phiName_); - os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; - os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl; - os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "rho", rhoName_); + Foam::writeEntry(os, "psi", psiName_); + Foam::writeEntry(os, "gamma", gamma_); p0_.writeEntry("p0", os); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C index e071c62af7..82657721bc 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -180,7 +180,7 @@ void Foam::totalTemperatureFvPatchScalarField::write(Ostream& os) const writeEntryIfDifferent(os, "U", "U", UName_); writeEntryIfDifferent(os, "phi", "phi", phiName_); writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); - os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "gamma", gamma_); T0_.writeEntry("T0", os); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C index 33f80a6a04..27786ffa3e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentInlet/turbulentInletFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -196,10 +196,9 @@ template void Foam::turbulentInletFvPatchField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("fluctuationScale") - << fluctuationScale_ << token::END_STATEMENT << nl; + writeEntry(os, "fluctuationScale", fluctuationScale_); referenceField_.writeEntry("referenceField", os); - os.writeKeyword("alpha") << alpha_ << token::END_STATEMENT << nl; + writeEntry(os, "alpha", alpha_); this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C index a57aae6411..2bcb888109 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -148,7 +148,7 @@ void Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::write ) const { fvPatchScalarField::write(os); - os.writeKeyword("intensity") << intensity_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "intensity", intensity_); writeEntryIfDifferent(os, "U", "U", UName_); writeEntryIfDifferent(os, "phi", "phi", this->phiName_); writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C index 330aaa0fd7..8917aa5c86 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -159,12 +159,11 @@ void Foam::uniformDensityHydrostaticPressureFvPatchScalarField::write ) const { fvPatchScalarField::write(os); - os.writeKeyword("rhoRef") << rho_ << token::END_STATEMENT << nl; - os.writeKeyword("pRef") << pRef_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "rhoRef", rho_); + Foam::writeEntry(os, "pRef", pRef_); if (pRefPointSpecified_) { - os.writeKeyword("pRefPoint") - << pRefPoint_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "pRefPoint", pRefPoint_); } writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C index 324121640b..31fc9d5851 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C @@ -160,7 +160,7 @@ void Foam::uniformInletOutletFvPatchField::write(Ostream& os) const fvPatchField::write(os); if (phiName_ != "phi") { - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + writeEntry(os, "phi", phiName_); } this->uniformInletValue_->writeData(os); this->writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C index 0fd8485b4e..1007fd9288 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C @@ -229,9 +229,9 @@ void Foam::uniformTotalPressureFvPatchScalarField::write(Ostream& os) const fvPatchScalarField::write(os); writeEntryIfDifferent(os, "U", "U", UName_); writeEntryIfDifferent(os, "phi", "phi", phiName_); - os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; - os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl; - os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "rho", rhoName_); + Foam::writeEntry(os, "psi", psiName_); + Foam::writeEntry(os, "gamma", gamma_); p0_->writeData(os); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C index 9276e05b3c..394072f3c7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -174,10 +174,10 @@ void Foam::variableHeightFlowRateFvPatchScalarField::write(Ostream& os) const fvPatchScalarField::write(os); if (phiName_ != "phi") { - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "phi", phiName_); } - os.writeKeyword("lowerBound") << lowerBound_ << token::END_STATEMENT << nl; - os.writeKeyword("upperBound") << upperBound_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "lowerBound", lowerBound_); + Foam::writeEntry(os, "upperBound", upperBound_); this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C index c7b488284b..7cca2c9161 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -133,7 +133,7 @@ void Foam::variableHeightFlowRateInletVelocityFvPatchVectorField::write { fvPatchField::write(os); flowRate_->writeData(os); - os.writeKeyword("alpha") << alphaName_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "alpha", alphaName_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C index 978c8aa440..3d58a630f6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -139,21 +139,16 @@ void Foam::waveTransmissiveFvPatchField::write(Ostream& os) const { fvPatchField::write(os); - this->template - writeEntryIfDifferent(os, "phi", "phi", this->phiName_); - this->template - writeEntryIfDifferent(os, "rho", "rho", this->rhoName_); - this->template - writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); + writeEntryIfDifferent(os, "phi", "phi", this->phiName_); + writeEntryIfDifferent(os, "rho", "rho", this->rhoName_); + writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); - os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; + writeEntry(os, "gamma", gamma_); if (this->lInf_ > small) { - os.writeKeyword("fieldInf") << this->fieldInf_ - << token::END_STATEMENT << nl; - os.writeKeyword("lInf") << this->lInf_ - << token::END_STATEMENT << nl; + writeEntry(os, "fieldInf", this->fieldInf_); + writeEntry(os, "lInf", this->lInf_); } this->writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index a9a68cd454..0748438f56 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -331,29 +331,11 @@ void Foam::fvPatchField::manipulateMatrix template void Foam::fvPatchField::write(Ostream& os) const { - os.writeKeyword("type") << type() << token::END_STATEMENT << nl; + writeEntry(os, "type", type()); if (patchType_.size()) { - os.writeKeyword("patchType") << patchType_ - << token::END_STATEMENT << nl; - } -} - - -template -template -void Foam::fvPatchField::writeEntryIfDifferent -( - Ostream& os, - const word& entryName, - const EntryType& value1, - const EntryType& value2 -) const -{ - if (value1 != value2) - { - os.writeKeyword(entryName) << value2 << token::END_STATEMENT << nl; + writeEntry(os, "patchType", patchType_); } } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index 079d1ec844..8ea606f9ca 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -516,17 +516,6 @@ public: //- Write virtual void write(Ostream&) const; - //- Helper function to write the keyword and entry only if the - // values are not equal. The value is then output as value2 - template - void writeEntryIfDifferent - ( - Ostream& os, - const word& entryName, - const EntryType& value1, - const EntryType& value2 - ) const; - // Check diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C index 9ae9165b5b..c1c080f4a9 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -172,7 +172,7 @@ void Foam::fvsPatchField::rmap template void Foam::fvsPatchField::write(Ostream& os) const { - os.writeKeyword("type") << type() << token::END_STATEMENT << nl; + writeEntry(os, "type", type()); this->writeEntry("value", os); } diff --git a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C index c24b09b333..735d49c91a 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -596,11 +596,11 @@ void Foam::timeVaryingMappedFixedValuePointPatchField::write { fixedValuePointPatchField::write(os); - this->writeEntryIfDifferent(os, "setAverage", Switch(false), setAverage_); + writeEntryIfDifferent(os, "setAverage", Switch(false), setAverage_); - this->writeEntryIfDifferent(os, "perturb", scalar(1e-5), perturb_); + writeEntryIfDifferent(os, "perturb", scalar(1e-5), perturb_); - this->writeEntryIfDifferent + writeEntryIfDifferent ( os, "fieldTable", @@ -608,7 +608,7 @@ void Foam::timeVaryingMappedFixedValuePointPatchField::write fieldTableName_ ); - this->writeEntryIfDifferent + writeEntryIfDifferent ( os, "mapMethod", diff --git a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C index 680afd5051..91366b6492 100644 --- a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C +++ b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -767,7 +767,7 @@ Foam::genericFvPatchField::gradientBoundaryCoeffs() const template void Foam::genericFvPatchField::write(Ostream& os) const { - os.writeKeyword("type") << actualTypeName_ << token::END_STATEMENT << nl; + writeEntry(os, "type", actualTypeName_); forAllConstIter(dictionary, dict_, iter) { diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.C b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.C index ed78345a55..14da296a50 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.C +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -398,14 +398,11 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::write "pyrolysisProperties", pyrolysisRegionName_ ); - os.writeKeyword("Tnbr")<< TnbrName_ << token::END_STATEMENT << nl; - os.writeKeyword("qr")<< qrName_ << token::END_STATEMENT << nl; - os.writeKeyword("convectiveScaling") << convectiveScaling_ - << token::END_STATEMENT << nl; - os.writeKeyword("filmDeltaDry") << filmDeltaDry_ - << token::END_STATEMENT << nl; - os.writeKeyword("filmDeltaWet") << filmDeltaWet_ - << token::END_STATEMENT << endl; + Foam::writeEntry(os, "Tnbr", TnbrName_); + Foam::writeEntry(os, "qr", qrName_); + Foam::writeEntry(os, "convectiveScaling", convectiveScaling_); + Foam::writeEntry(os, "filmDeltaDry", filmDeltaDry_); + Foam::writeEntry(os, "filmDeltaWet", filmDeltaWet_); temperatureCoupledBase::write(os); } diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C index dcbdab8647..ac329ed7ab 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -230,11 +230,11 @@ void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs() void alphatFilmWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); - os.writeKeyword("B") << B_ << token::END_STATEMENT << nl; - os.writeKeyword("yPlusCrit") << yPlusCrit_ << token::END_STATEMENT << nl; - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "B", B_); + Foam::writeEntry(os, "yPlusCrit", yPlusCrit_); + Foam::writeEntry(os, "Cmu", Cmu_); + Foam::writeEntry(os, "kappa", kappa_); + Foam::writeEntry(os, "Prt", Prt_); writeEntry("value", os); } diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.C index ecd7eeef40..868ca45e63 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/nutkFilmWallFunction/nutkFilmWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -241,8 +241,8 @@ void nutkFilmWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); writeLocalEntries(os); - os.writeKeyword("B") << B_ << token::END_STATEMENT << nl; - os.writeKeyword("yPlusCrit") << yPlusCrit_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "B", B_); + Foam::writeEntry(os, "yPlusCrit", yPlusCrit_); writeEntry("value", os); } diff --git a/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C b/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C index 6e3ecd0845..b1aba155f7 100644 --- a/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C +++ b/src/semiPermeableBaffle/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -288,8 +288,7 @@ void Foam::semiPermeableBaffleMassFractionFvPatchScalarField::write fvPatchScalarField::write(os); mappedPatchBase::write(os); writeEntryIfDifferent(os, "c", scalar(0), c_); - os.writeKeyword("input") << inputNames_[input_] - << token::END_STATEMENT << nl; + Foam::writeEntry(os, "input", inputNames_[input_]); writeEntryIfDifferent(os, "phi", "phi", phiName_); writeEntryIfDifferent(os, "p", "p", pName_); writeEntry("value", os); diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C index bbec42a731..2f9500f37a 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -229,8 +229,7 @@ void Foam::radiation::radiationCoupledBase::rmap void Foam::radiation::radiationCoupledBase::write(Ostream& os) const { - os.writeKeyword("emissivityMode") << emissivityMethodTypeNames_[method_] - << token::END_STATEMENT << nl; + writeEntry(os, "emissivityMode", emissivityMethodTypeNames_[method_]); emissivity_.writeEntry("emissivity", os); } diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 87e0084348..93c5eda131 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -166,8 +166,7 @@ void Foam::alphaContactAngleFvPatchScalarField::write ) const { fixedGradientFvPatchScalarField::write(os); - os.writeKeyword("limit") - << limitControlNames_[limit_] << token::END_STATEMENT << nl; + Foam::writeEntry(os, "limit", limitControlNames_[limit_]); } diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C index 5e60a592e8..6805101652 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,7 +113,7 @@ void Foam::constantAlphaContactAngleFvPatchScalarField::write ) const { alphaContactAngleFvPatchScalarField::write(os); - os.writeKeyword("theta0") << theta0_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "theta0", theta0_); writeEntry("value", os); } diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C index 35c9bb7213..869f87fe04 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -156,10 +156,10 @@ Foam::dynamicAlphaContactAngleFvPatchScalarField::theta void Foam::dynamicAlphaContactAngleFvPatchScalarField::write(Ostream& os) const { alphaContactAngleFvPatchScalarField::write(os); - os.writeKeyword("theta0") << theta0_ << token::END_STATEMENT << nl; - os.writeKeyword("uTheta") << uTheta_ << token::END_STATEMENT << nl; - os.writeKeyword("thetaA") << thetaA_ << token::END_STATEMENT << nl; - os.writeKeyword("thetaR") << thetaR_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "theta0", theta0_); + Foam::writeEntry(os, "uTheta", uTheta_); + Foam::writeEntry(os, "thetaA", thetaA_); + Foam::writeEntry(os, "thetaR", thetaR_); writeEntry("value", os); } diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C index 329f25a435..d4aed3b7e2 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -131,10 +131,10 @@ void Foam::timeVaryingAlphaContactAngleFvPatchScalarField::write ) const { alphaContactAngleFvPatchScalarField::write(os); - os.writeKeyword("t0") << t0_ << token::END_STATEMENT << nl; - os.writeKeyword("thetaT0") << thetaT0_ << token::END_STATEMENT << nl; - os.writeKeyword("te") << te_ << token::END_STATEMENT << nl; - os.writeKeyword("thetaTe") << thetaTe_ << token::END_STATEMENT << nl; + Foam::writeEntry(os, "t0", t0_); + Foam::writeEntry(os, "thetaT0", thetaT0_); + Foam::writeEntry(os, "te", te_); + Foam::writeEntry(os, "thetaTe", thetaTe_); writeEntry("value", os); } diff --git a/src/waves/derivedFvPatchFields/waveInletOutlet/waveInletOutletFvPatchField.C b/src/waves/derivedFvPatchFields/waveInletOutlet/waveInletOutletFvPatchField.C index 5a2a823372..1727fa115b 100644 --- a/src/waves/derivedFvPatchFields/waveInletOutlet/waveInletOutletFvPatchField.C +++ b/src/waves/derivedFvPatchFields/waveInletOutlet/waveInletOutletFvPatchField.C @@ -163,7 +163,7 @@ void Foam::waveInletOutletFvPatchField::write(Ostream& os) const fvPatchField::write(os); inletValueAbove_->writeData(os); inletValueBelow_->writeData(os); - this->template writeEntryIfDifferent(os, "phi", "phi", phiName_); + writeEntryIfDifferent(os, "phi", "phi", phiName_); }