timeVaryingMappedFixedValueFvPatchField: Refactored so the underlying mapping function can be used in other BCs
The new patch field mapping class timeVaryingMappedFvPatchField has been factored out of the timeVaryingMappedFixedValueFvPatchField BC so that it can be used to map data onto fields stored within other BCs. In the process the writeEntryIfDifferent function had to be moved from fvPatchField to dictionary so that it can still be used in the timeVaryingMappedFvPatchField class and it made good sense to create the non-conditional variant writeEntry to simplify the patch field write functions. This rationalisation has been propagated all other patch fields.
This commit is contained in:
@ -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<word>(os, "psi", "thermo:psi", psiName_);
|
||||
writeEntryIfDifferent<word>(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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<word>(os, "mu", "thermo:mu", muName_);
|
||||
writeEntryIfDifferent<word>(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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<scalar>::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);
|
||||
}
|
||||
|
||||
@ -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<scalar>::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);
|
||||
}
|
||||
|
||||
@ -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<scalar>::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);
|
||||
|
||||
@ -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<scalar>::write(os);
|
||||
os.writeKeyword("sourceFieldName")
|
||||
<< sourceFieldName_ << token::END_STATEMENT << nl;
|
||||
Foam::writeEntry(os, "sourceFieldName", sourceFieldName_);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -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<scalar>::write(os);
|
||||
os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl;
|
||||
Foam::writeEntry(os, "relax", relax_);
|
||||
q_.writeEntry("q", os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<class EntryType>
|
||||
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<class EntryType>
|
||||
void writeEntryIfDifferent
|
||||
(
|
||||
Ostream& os,
|
||||
const word& entryName,
|
||||
const EntryType& value1,
|
||||
const EntryType& value2
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -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<class EntryType>
|
||||
void Foam::writeEntry
|
||||
(
|
||||
Ostream& os,
|
||||
const word& entryName,
|
||||
const EntryType& value
|
||||
)
|
||||
{
|
||||
os.writeKeyword(entryName) << value << token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
|
||||
template<class EntryType>
|
||||
void Foam::writeEntryIfDifferent
|
||||
(
|
||||
Ostream& os,
|
||||
const word& entryName,
|
||||
const EntryType& value1,
|
||||
const EntryType& value2
|
||||
)
|
||||
{
|
||||
if (value1 != value2)
|
||||
{
|
||||
writeEntry(os, entryName, value2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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<scalar>::write(os);
|
||||
os.writeKeyword("L") << L_ << token::END_STATEMENT << nl;
|
||||
Foam::writeEntry(os, "L", L_);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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::scalarField> 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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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<solidType>::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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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<scalar>::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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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<scalar>::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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<scalar>::write(os);
|
||||
os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl;
|
||||
Foam::writeEntry(os, "Prt", Prt_);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -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<scalar>::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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<scalar>::write(os);
|
||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||
writeEntryIfDifferent<word>(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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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<scalar>::write(os);
|
||||
}
|
||||
|
||||
|
||||
@ -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<scalar>::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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::yPlus() const
|
||||
void nutUTabulatedWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<scalar>::write(os);
|
||||
os.writeKeyword("uPlusTable") << uPlusTableName_
|
||||
<< token::END_STATEMENT << nl;
|
||||
Foam::writeEntry(os, "uPlusTable", uPlusTableName_);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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::scalarField> 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) ;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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<word>(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<word>(os, "p", "p", pName_);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
@ -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<word>(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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<Type>::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<Type>::write(os);
|
||||
|
||||
this->template writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||
this->template writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||
writeEntryIfDifferent<word>(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);
|
||||
|
||||
@ -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<vector>::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);
|
||||
|
||||
@ -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<Type>::write(Ostream& os) const
|
||||
{
|
||||
mixedFvPatchField<Type>::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);
|
||||
}
|
||||
|
||||
@ -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_]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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<class Type>
|
||||
void Foam::fixedJumpFvPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<Type>::write(os);
|
||||
os.writeKeyword("patchType") << this->interfaceFieldType()
|
||||
<< token::END_STATEMENT << nl;
|
||||
writeEntry(os, "patchType", this->interfaceFieldType());
|
||||
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
|
||||
@ -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<class Type>
|
||||
void Foam::fixedJumpAMIFvPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<Type>::write(os);
|
||||
os.writeKeyword("patchType") << this->interfaceFieldType()
|
||||
<< token::END_STATEMENT << nl;
|
||||
writeEntry(os, "patchType", this->interfaceFieldType());
|
||||
|
||||
if (this->cyclicAMIPatch().owner())
|
||||
{
|
||||
|
||||
@ -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<word>(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);
|
||||
|
||||
@ -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<Type>::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<Type>::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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<word>(os, "rho", "rho", rhoName_);
|
||||
writeEntryIfDifferent<scalar>(os, "rhoInlet", -vGreat, rhoInlet_);
|
||||
}
|
||||
os.writeKeyword("extrapolateProfile")
|
||||
<< extrapolateProfile_ << token::END_STATEMENT << nl;
|
||||
Foam::writeEntry(os, "extrapolateProfile", extrapolateProfile_);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -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<Type>::write(Ostream& os) const
|
||||
fvPatchField<Type>::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);
|
||||
|
||||
@ -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<word>(os, "U", "U", UName_);
|
||||
freestreamValue().writeEntry("freestreamValue", os);
|
||||
os.writeKeyword("supersonic") << supersonic_ << token::END_STATEMENT << nl;
|
||||
Foam::writeEntry(os, "supersonic", supersonic_);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -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<Type>::write(Ostream& os) const
|
||||
fvPatchField<Type>::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);
|
||||
|
||||
@ -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<word>(os, "U", "U", UName_);
|
||||
writeEntryIfDifferent<word>(os, "phi", "phi", this->phiName_);
|
||||
writeEntryIfDifferent<word>(os, "psi", "psi", psiName_);
|
||||
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
|
||||
Foam::writeEntry(os, "gamma", gamma_);
|
||||
T0_.writeEntry("T0", os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
@ -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<Field<Type>> mappedPatchFieldBase<Type>::mappedField() const
|
||||
template<class Type>
|
||||
void mappedPatchFieldBase<Type>::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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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<vector>::write(os);
|
||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
||||
os.writeKeyword("nbrPhi") << nbrPhiName_ << token::END_STATEMENT << nl;
|
||||
Foam::writeEntry(os, "nbrPhi", nbrPhiName_);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -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<vector>::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<word>(os, "rho", "rho", rhoName_);
|
||||
}
|
||||
writeEntry("value", os);
|
||||
|
||||
@ -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<Type>::write(Ostream& os) const
|
||||
fvPatchField<Type>::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);
|
||||
|
||||
@ -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<class Type>
|
||||
void Foam::outletMappedUniformInletFvPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<Type>::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);
|
||||
}
|
||||
|
||||
@ -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<vector>::write(os);
|
||||
|
||||
UnMean_->writeData(os);
|
||||
os.writeKeyword("alpha") << alphaName_ << token::END_STATEMENT << nl;
|
||||
Foam::writeEntry(os, "alpha", alphaName_);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<scalar>(os, "timeScale", 0.0, timeScale_);
|
||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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<word>(os, "T", "T", TName_);
|
||||
writeEntryIfDifferent<word>(os, "p", "p", pName_);
|
||||
writeEntryIfDifferent<word>(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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<vector>::write(os);
|
||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||
writeEntryIfDifferent<word>(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);
|
||||
|
||||
@ -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<vector>::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);
|
||||
|
||||
@ -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<word>(os, "phi", "phi", phiName_);
|
||||
|
||||
writeEntry("value", os);
|
||||
|
||||
@ -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<class Type>
|
||||
Foam::fileName
|
||||
Foam::timeVaryingMappedFixedValueFvPatchField<Type>::findFieldFile
|
||||
(
|
||||
const word& timeName
|
||||
) const
|
||||
{
|
||||
const fileName fieldFileName
|
||||
(
|
||||
dataDir_/timeName/sampleName_/fieldTableName_
|
||||
);
|
||||
|
||||
const fileName typeFieldFileName
|
||||
(
|
||||
dataDir_/timeName/sampleName_
|
||||
/pTraits<Type>::typeName + Field<Type>::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<class Type>
|
||||
void Foam::timeVaryingMappedFixedValueFvPatchField<Type>::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<Type> vals;
|
||||
|
||||
if (setAverage_)
|
||||
{
|
||||
AverageField<Type> 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<Type> vals;
|
||||
|
||||
if (setAverage_)
|
||||
{
|
||||
AverageField<Type> 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<Type>(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<Type>(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<fileName>("points", "points")),
|
||||
sampleName_(dict.lookupOrDefault("sample", word::null)),
|
||||
setAverage_(dict.lookupOrDefault("setAverage", false)),
|
||||
perturb_(dict.lookupOrDefault("perturb", 1e-5)),
|
||||
mapMethod_
|
||||
(
|
||||
dict.lookupOrDefault<word>
|
||||
(
|
||||
"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<Type>::New("offset", dict);
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
mapMethod_ != "planarInterpolation"
|
||||
&& mapMethod_ != "nearest"
|
||||
)
|
||||
{
|
||||
FatalIOErrorInFunction
|
||||
(
|
||||
dict
|
||||
) << "mapMethod should be one of 'planarInterpolation'"
|
||||
<< ", 'nearest'" << exit(FatalIOError);
|
||||
}
|
||||
|
||||
if (dict.found("value"))
|
||||
{
|
||||
fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size()));
|
||||
@ -378,22 +79,7 @@ timeVaryingMappedFixedValueFvPatchField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(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<Type>(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<Type>(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<Type>::autoMap
|
||||
)
|
||||
{
|
||||
fixedValueFvPatchField<Type>::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<Type>::rmap
|
||||
)
|
||||
{
|
||||
fixedValueFvPatchField<Type>::rmap(ptf, addr);
|
||||
|
||||
const timeVaryingMappedFixedValueFvPatchField<Type>& tiptf =
|
||||
refCast<const timeVaryingMappedFixedValueFvPatchField<Type>>(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<Type>::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<Type>& 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<Type>::updateCoeffs();
|
||||
}
|
||||
@ -610,44 +154,7 @@ void Foam::timeVaryingMappedFixedValueFvPatchField<Type>::write
|
||||
) const
|
||||
{
|
||||
fvPatchField<Type>::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);
|
||||
}
|
||||
|
||||
|
||||
@ -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/<patch name>"
|
||||
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<pointToPointPlanarInterpolation> mapperPtr_;
|
||||
|
||||
//- List of boundaryData time directories
|
||||
instantList sampleTimes_;
|
||||
|
||||
//- Current starting index in sampleTimes
|
||||
label startSampleTime_;
|
||||
|
||||
//- Interpolated values from startSampleTime
|
||||
Field<Type> startSampledValues_;
|
||||
|
||||
//- If setAverage: starting average value
|
||||
Type startAverage_;
|
||||
|
||||
//- Current end index in sampleTimes
|
||||
label endSampleTime_;
|
||||
|
||||
//- Interpolated values from endSampleTime
|
||||
Field<Type> endSampledValues_;
|
||||
|
||||
//- If setAverage: end average value
|
||||
Type endAverage_;
|
||||
|
||||
//- Time varying offset values to interpolated data
|
||||
autoPtr<Function1<Type>> 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<Type> fieldMapper_;
|
||||
|
||||
|
||||
public:
|
||||
@ -248,15 +192,6 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return startSampledValues
|
||||
const Field<Type> startSampledValues()
|
||||
{
|
||||
return startSampledValues_;
|
||||
}
|
||||
|
||||
|
||||
// Mapping functions
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "timeVaryingMappedFvPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(timeVaryingMapped, 0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "timeVaryingMappedFvPatchField.H"
|
||||
#include "Time.H"
|
||||
#include "AverageField.H"
|
||||
#include "IFstream.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::fileName
|
||||
Foam::timeVaryingMappedFvPatchField<Type>::findFieldFile
|
||||
(
|
||||
const word& timeName
|
||||
) const
|
||||
{
|
||||
const fileName fieldFileName
|
||||
(
|
||||
dataDir_/timeName/sampleName_/fieldTableName_
|
||||
);
|
||||
|
||||
const fileName typeFieldFileName
|
||||
(
|
||||
dataDir_/timeName/sampleName_
|
||||
/pTraits<Type>::typeName + Field<Type>::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<class Type>
|
||||
void Foam::timeVaryingMappedFvPatchField<Type>::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<Type> vals;
|
||||
|
||||
if (setAverage_)
|
||||
{
|
||||
AverageField<Type> 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<Type> vals;
|
||||
|
||||
if (setAverage_)
|
||||
{
|
||||
AverageField<Type> 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<class Type>
|
||||
Foam::timeVaryingMappedFvPatchField<Type>::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<class Type>
|
||||
Foam::timeVaryingMappedFvPatchField<Type>::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<fileName>("points", "points")),
|
||||
sampleName_(dict.lookupOrDefault("sample", word::null)),
|
||||
setAverage_(dict.lookupOrDefault("setAverage", false)),
|
||||
perturb_(dict.lookupOrDefault("perturb", 1e-5)),
|
||||
mapMethod_
|
||||
(
|
||||
dict.lookupOrDefault<word>
|
||||
(
|
||||
"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<Type>::New("offset", dict);
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
mapMethod_ != "planarInterpolation"
|
||||
&& mapMethod_ != "nearest"
|
||||
)
|
||||
{
|
||||
FatalIOErrorInFunction
|
||||
(
|
||||
dict
|
||||
) << "mapMethod should be one of 'planarInterpolation'"
|
||||
<< ", 'nearest'" << exit(FatalIOError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::timeVaryingMappedFvPatchField<Type>::
|
||||
timeVaryingMappedFvPatchField
|
||||
(
|
||||
const timeVaryingMappedFvPatchField<Type>& 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<class Type>
|
||||
void Foam::timeVaryingMappedFvPatchField<Type>::autoMap
|
||||
(
|
||||
const fvPatchFieldMapper& m
|
||||
)
|
||||
{
|
||||
if (startSampledValues_.size())
|
||||
{
|
||||
startSampledValues_.autoMap(m);
|
||||
endSampledValues_.autoMap(m);
|
||||
}
|
||||
// Clear interpolator
|
||||
mapperPtr_.clear();
|
||||
startSampleTime_ = -1;
|
||||
endSampleTime_ = -1;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::timeVaryingMappedFvPatchField<Type>::rmap
|
||||
(
|
||||
const fvPatchField<Type>& ptf,
|
||||
const labelList& addr
|
||||
)
|
||||
{
|
||||
const timeVaryingMappedFvPatchField<Type>& tiptf =
|
||||
refCast<const timeVaryingMappedFvPatchField<Type>>(ptf);
|
||||
|
||||
startSampledValues_.rmap(tiptf.startSampledValues_, addr);
|
||||
endSampledValues_.rmap(tiptf.endSampledValues_, addr);
|
||||
|
||||
// Clear interpolator
|
||||
mapperPtr_.clear();
|
||||
startSampleTime_ = -1;
|
||||
endSampleTime_ = -1;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>> Foam::timeVaryingMappedFvPatchField<Type>::map()
|
||||
{
|
||||
checkTable();
|
||||
|
||||
// Interpolate between the sampled data
|
||||
|
||||
tmp<Field<Type>> tfld(new Field<Type>(patch_.size()));
|
||||
Field<Type>& 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<class Type>
|
||||
void Foam::timeVaryingMappedFvPatchField<Type>::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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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/\<patch name\>/ directory:
|
||||
- points : pointField of locations
|
||||
- \<time\>/\<field\> : field of values at time \<time\>
|
||||
|
||||
Alternatively the names and locations of the points and field files may be
|
||||
specified explicitly via the optional dictionary entries:
|
||||
- dataDir \<optional top-level directory of the points and field data>;
|
||||
- points \<optional path including name of points file relative to
|
||||
dataDir\>;
|
||||
- sample \<optional name of the sub-directory in the time directories
|
||||
containing the fields\>;
|
||||
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/\<patch name\>
|
||||
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 Type>
|
||||
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/<patch name>"
|
||||
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<pointToPointPlanarInterpolation> mapperPtr_;
|
||||
|
||||
//- List of boundaryData time directories
|
||||
instantList sampleTimes_;
|
||||
|
||||
//- Current starting index in sampleTimes
|
||||
label startSampleTime_;
|
||||
|
||||
//- Interpolated values from startSampleTime
|
||||
Field<Type> startSampledValues_;
|
||||
|
||||
//- If setAverage: starting average value
|
||||
Type startAverage_;
|
||||
|
||||
//- Current end index in sampleTimes
|
||||
label endSampleTime_;
|
||||
|
||||
//- Interpolated values from endSampleTime
|
||||
Field<Type> endSampledValues_;
|
||||
|
||||
//- If setAverage: end average value
|
||||
Type endAverage_;
|
||||
|
||||
//- Time varying offset values to interpolated data
|
||||
autoPtr<Function1<Type>> 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<Type>&
|
||||
);
|
||||
|
||||
|
||||
// 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<Type>&, const labelList&);
|
||||
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Return the current mapped patch field
|
||||
tmp<Field<Type>> map();
|
||||
|
||||
|
||||
//- Write
|
||||
void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "timeVaryingMappedFvPatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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<word>(os, "U", "U", UName_);
|
||||
writeEntryIfDifferent<word>(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);
|
||||
}
|
||||
|
||||
@ -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<word>(os, "U", "U", UName_);
|
||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||
writeEntryIfDifferent<word>(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);
|
||||
}
|
||||
|
||||
@ -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<class Type>
|
||||
void Foam::turbulentInletFvPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<Type>::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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<word>(os, "U", "U", UName_);
|
||||
writeEntryIfDifferent<word>(os, "phi", "phi", this->phiName_);
|
||||
writeEntry("value", os);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ void Foam::uniformInletOutletFvPatchField<Type>::write(Ostream& os) const
|
||||
fvPatchField<Type>::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);
|
||||
|
||||
@ -229,9 +229,9 @@ void Foam::uniformTotalPressureFvPatchScalarField::write(Ostream& os) const
|
||||
fvPatchScalarField::write(os);
|
||||
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
||||
writeEntryIfDifferent<word>(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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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<vector>::write(os);
|
||||
flowRate_->writeData(os);
|
||||
os.writeKeyword("alpha") << alphaName_ << token::END_STATEMENT << nl;
|
||||
Foam::writeEntry(os, "alpha", alphaName_);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -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<Type>::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<Type>::write(os);
|
||||
|
||||
this->template
|
||||
writeEntryIfDifferent<word>(os, "phi", "phi", this->phiName_);
|
||||
this->template
|
||||
writeEntryIfDifferent<word>(os, "rho", "rho", this->rhoName_);
|
||||
this->template
|
||||
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
|
||||
writeEntryIfDifferent<word>(os, "phi", "phi", this->phiName_);
|
||||
writeEntryIfDifferent<word>(os, "rho", "rho", this->rhoName_);
|
||||
writeEntryIfDifferent<word>(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);
|
||||
|
||||
@ -331,29 +331,11 @@ void Foam::fvPatchField<Type>::manipulateMatrix
|
||||
template<class Type>
|
||||
void Foam::fvPatchField<Type>::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<class Type>
|
||||
template<class EntryType>
|
||||
void Foam::fvPatchField<Type>::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_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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<class EntryType>
|
||||
void writeEntryIfDifferent
|
||||
(
|
||||
Ostream& os,
|
||||
const word& entryName,
|
||||
const EntryType& value1,
|
||||
const EntryType& value2
|
||||
) const;
|
||||
|
||||
|
||||
// Check
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user