mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Function object updates
This commit is contained in:
@ -335,7 +335,6 @@ void Foam::fieldAverage::write()
|
|||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
calcAverages();
|
|
||||||
writeAverages();
|
writeAverages();
|
||||||
writeAveragingProperties();
|
writeAveragingProperties();
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,20 @@ void Foam::fieldCoordinateSystemTransform::read(const dictionary& dict)
|
|||||||
|
|
||||||
void Foam::fieldCoordinateSystemTransform::execute()
|
void Foam::fieldCoordinateSystemTransform::execute()
|
||||||
{
|
{
|
||||||
// Do nothing
|
if (active_)
|
||||||
|
{
|
||||||
|
Info<< type() << " " << name_ << " output:" << nl;
|
||||||
|
|
||||||
|
forAll(fieldSet_, fieldI)
|
||||||
|
{
|
||||||
|
// If necessary load field
|
||||||
|
transform<scalar>(fieldSet_[fieldI]);
|
||||||
|
transform<vector>(fieldSet_[fieldI]);
|
||||||
|
transform<sphericalTensor>(fieldSet_[fieldI]);
|
||||||
|
transform<symmTensor>(fieldSet_[fieldI]);
|
||||||
|
transform<tensor>(fieldSet_[fieldI]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -114,16 +127,23 @@ void Foam::fieldCoordinateSystemTransform::timeSet()
|
|||||||
|
|
||||||
void Foam::fieldCoordinateSystemTransform::write()
|
void Foam::fieldCoordinateSystemTransform::write()
|
||||||
{
|
{
|
||||||
Info<< type() << " " << name_ << " output:" << nl;
|
if (active_)
|
||||||
|
|
||||||
forAll(fieldSet_, fieldI)
|
|
||||||
{
|
{
|
||||||
// If necessary load field
|
Info<< type() << " " << name_ << " output:" << nl;
|
||||||
transform<scalar>(fieldSet_[fieldI]);
|
|
||||||
transform<vector>(fieldSet_[fieldI]);
|
forAll(fieldSet_, fieldI)
|
||||||
transform<sphericalTensor>(fieldSet_[fieldI]);
|
{
|
||||||
transform<symmTensor>(fieldSet_[fieldI]);
|
const word fieldName = fieldSet_[fieldI] + ":Transformed";
|
||||||
transform<tensor>(fieldSet_[fieldI]);
|
|
||||||
|
const regIOobject& field =
|
||||||
|
obr_.lookupObject<regIOobject>(fieldName);
|
||||||
|
|
||||||
|
Info<< " writing field " << field.name() << nl;
|
||||||
|
|
||||||
|
field.write();
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ void Foam::fieldCoordinateSystemTransform::transformField
|
|||||||
const Type& field
|
const Type& field
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const word& fieldName = field.name() + "Transformed";
|
const word& fieldName = field.name() + ":Transformed";
|
||||||
|
|
||||||
if (!obr_.foundObject<Type>(fieldName))
|
if (!obr_.foundObject<Type>(fieldName))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -328,32 +328,8 @@ void Foam::nearWallFields::execute()
|
|||||||
{
|
{
|
||||||
Info<< "nearWallFields:execute()" << endl;
|
Info<< "nearWallFields:execute()" << endl;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::nearWallFields::end()
|
|
||||||
{
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "nearWallFields:end()" << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::nearWallFields::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::nearWallFields::write()
|
|
||||||
{
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "nearWallFields:write()" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Do nothing
|
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
@ -380,7 +356,7 @@ void Foam::nearWallFields::write()
|
|||||||
|
|
||||||
Info<< type() << " " << name_ << " output:" << nl;
|
Info<< type() << " " << name_ << " output:" << nl;
|
||||||
|
|
||||||
Info<< " Writing sampled fields to " << obr_.time().timeName()
|
Info<< " Sampling fields fields to " << obr_.time().timeName()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
sampleFields(vsf_);
|
sampleFields(vsf_);
|
||||||
@ -388,8 +364,37 @@ void Foam::nearWallFields::write()
|
|||||||
sampleFields(vSpheretf_);
|
sampleFields(vSpheretf_);
|
||||||
sampleFields(vSymmtf_);
|
sampleFields(vSymmtf_);
|
||||||
sampleFields(vtf_);
|
sampleFields(vtf_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::nearWallFields::end()
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "nearWallFields:end()" << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::nearWallFields::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::nearWallFields::write()
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "nearWallFields:write()" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
Info<< " Writing sampled fields to " << obr_.time().timeName()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
// Write fields
|
|
||||||
forAll(vsf_, i)
|
forAll(vsf_, i)
|
||||||
{
|
{
|
||||||
vsf_[i].write();
|
vsf_[i].write();
|
||||||
|
|||||||
@ -53,6 +53,27 @@ Foam::processorField::processorField
|
|||||||
if (isA<fvMesh>(obr_))
|
if (isA<fvMesh>(obr_))
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
|
|
||||||
|
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||||
|
|
||||||
|
volScalarField* procFieldPtr
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"processorID",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar("0", dimless, 0.0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
mesh.objectRegistry::store(procFieldPtr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -88,7 +109,14 @@ void Foam::processorField::read(const dictionary& dict)
|
|||||||
|
|
||||||
void Foam::processorField::execute()
|
void Foam::processorField::execute()
|
||||||
{
|
{
|
||||||
// Do nothing
|
if (active_)
|
||||||
|
{
|
||||||
|
const volScalarField& procField =
|
||||||
|
obr_.lookupObject<volScalarField>("processorID");
|
||||||
|
|
||||||
|
const_cast<volScalarField&>(procField) ==
|
||||||
|
dimensionedScalar("procI", dimless, Pstream::myProcNo());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -108,20 +136,8 @@ void Foam::processorField::write()
|
|||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
const volScalarField& procField =
|
||||||
volScalarField procField
|
obr_.lookupObject<volScalarField>("processorID");
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"processorID",
|
|
||||||
mesh.time().timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("procI", dimless, Pstream::myProcNo())
|
|
||||||
);
|
|
||||||
|
|
||||||
procField.write();
|
procField.write();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,29 +125,16 @@ void Foam::calcFvcDiv::read(const dictionary& dict)
|
|||||||
{
|
{
|
||||||
dict.lookup("fieldName") >> fieldName_;
|
dict.lookup("fieldName") >> fieldName_;
|
||||||
dict.lookup("resultName") >> resultName_;
|
dict.lookup("resultName") >> resultName_;
|
||||||
|
|
||||||
|
if (resultName_ == "none")
|
||||||
|
{
|
||||||
|
resultName_ = "fvc::div(" + fieldName_ + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcFvcDiv::execute()
|
void Foam::calcFvcDiv::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcFvcDiv::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcFvcDiv::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcFvcDiv::write()
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
@ -165,4 +152,34 @@ void Foam::calcFvcDiv::write()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::calcFvcDiv::end()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::calcFvcDiv::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::calcFvcDiv::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
if (obr_.foundObject<regIOobject>(resultName_))
|
||||||
|
{
|
||||||
|
const regIOobject& field =
|
||||||
|
obr_.lookupObject<regIOobject>(resultName_);
|
||||||
|
|
||||||
|
Info<< type() << " " << name_ << " output:" << nl
|
||||||
|
<< " writing field " << field.name() << nl << endl;
|
||||||
|
|
||||||
|
field.write();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -38,25 +38,14 @@ void Foam::calcFvcDiv::calcDiv
|
|||||||
{
|
{
|
||||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||||
|
|
||||||
word divName = resultName;
|
|
||||||
if (divName == "none")
|
|
||||||
{
|
|
||||||
divName = "fvc::div(" + fieldName + ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mesh.foundObject<FieldType>(fieldName))
|
if (mesh.foundObject<FieldType>(fieldName))
|
||||||
{
|
{
|
||||||
const FieldType& vf = mesh.lookupObject<FieldType>(fieldName);
|
const FieldType& vf = mesh.lookupObject<FieldType>(fieldName);
|
||||||
|
|
||||||
volScalarField& field = divField(divName, vf.dimensions());
|
volScalarField& field = divField(resultName, vf.dimensions());
|
||||||
|
|
||||||
field = fvc::div(vf);
|
field = fvc::div(vf);
|
||||||
|
|
||||||
Info<< type() << " " << name_ << " output:" << nl
|
|
||||||
<< " writing field " << field.name() << nl << endl;
|
|
||||||
|
|
||||||
field.write();
|
|
||||||
|
|
||||||
processed = true;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,29 +87,16 @@ void Foam::calcFvcGrad::read(const dictionary& dict)
|
|||||||
{
|
{
|
||||||
dict.lookup("fieldName") >> fieldName_;
|
dict.lookup("fieldName") >> fieldName_;
|
||||||
dict.lookup("resultName") >> resultName_;
|
dict.lookup("resultName") >> resultName_;
|
||||||
|
|
||||||
|
if (resultName_ == "none")
|
||||||
|
{
|
||||||
|
resultName_ = "fvc::grad(" + fieldName_ + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcFvcGrad::execute()
|
void Foam::calcFvcGrad::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcFvcGrad::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcFvcGrad::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcFvcGrad::write()
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
@ -127,4 +114,34 @@ void Foam::calcFvcGrad::write()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::calcFvcGrad::end()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::calcFvcGrad::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::calcFvcGrad::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
if (obr_.foundObject<regIOobject>(resultName_))
|
||||||
|
{
|
||||||
|
const regIOobject& field =
|
||||||
|
obr_.lookupObject<regIOobject>(resultName_);
|
||||||
|
|
||||||
|
Info<< type() << " " << name_ << " output:" << nl
|
||||||
|
<< " writing field " << field.name() << nl << endl;
|
||||||
|
|
||||||
|
field.write();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -91,40 +91,25 @@ void Foam::calcFvcGrad::calcGrad
|
|||||||
|
|
||||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||||
|
|
||||||
word gradName = resultName;
|
|
||||||
if (gradName == "none")
|
|
||||||
{
|
|
||||||
gradName = "fvc::grad(" + fieldName + ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mesh.foundObject<vfType>(fieldName))
|
if (mesh.foundObject<vfType>(fieldName))
|
||||||
{
|
{
|
||||||
const vfType& vf = mesh.lookupObject<vfType>(fieldName);
|
const vfType& vf = mesh.lookupObject<vfType>(fieldName);
|
||||||
|
|
||||||
vfGradType& field = gradField<Type>(gradName, vf.dimensions());
|
vfGradType& field = gradField<Type>(resultName, vf.dimensions());
|
||||||
|
|
||||||
field = fvc::grad(vf);
|
field = fvc::grad(vf);
|
||||||
|
|
||||||
Info<< type() << " output:" << nl
|
|
||||||
<< " writing " << field.name() << " field" << nl << endl;
|
|
||||||
|
|
||||||
field.write();
|
|
||||||
|
|
||||||
processed = true;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (mesh.foundObject<sfType>(fieldName))
|
else if (mesh.foundObject<sfType>(fieldName))
|
||||||
{
|
{
|
||||||
const sfType& sf = mesh.lookupObject<sfType>(fieldName);
|
const sfType& sf = mesh.lookupObject<sfType>(fieldName);
|
||||||
|
|
||||||
vfGradType& field = gradField<Type>(gradName, sf.dimensions());
|
vfGradType& field = gradField<Type>(resultName, sf.dimensions());
|
||||||
|
|
||||||
field = fvc::grad(sf);
|
field = fvc::grad(sf);
|
||||||
|
|
||||||
Info<< type() << " " << name_ << " output:" << nl
|
|
||||||
<< " writing field " << field.name() << nl << endl;
|
|
||||||
|
|
||||||
field.write();
|
|
||||||
|
|
||||||
processed = true;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,29 +87,16 @@ void Foam::calcMag::read(const dictionary& dict)
|
|||||||
{
|
{
|
||||||
dict.lookup("fieldName") >> fieldName_;
|
dict.lookup("fieldName") >> fieldName_;
|
||||||
dict.lookup("resultName") >> resultName_;
|
dict.lookup("resultName") >> resultName_;
|
||||||
|
|
||||||
|
if (resultName_ == "none")
|
||||||
|
{
|
||||||
|
resultName_ = "mag(" + fieldName_ + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcMag::execute()
|
void Foam::calcMag::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcMag::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcMag::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::calcMag::write()
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
@ -130,4 +117,34 @@ void Foam::calcMag::write()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::calcMag::end()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::calcMag::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::calcMag::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
if (obr_.foundObject<regIOobject>(resultName_))
|
||||||
|
{
|
||||||
|
const regIOobject& field =
|
||||||
|
obr_.lookupObject<regIOobject>(resultName_);
|
||||||
|
|
||||||
|
Info<< type() << " " << name_ << " output:" << nl
|
||||||
|
<< " writing field " << field.name() << nl << endl;
|
||||||
|
|
||||||
|
field.write();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -80,26 +80,15 @@ void Foam::calcMag::calc
|
|||||||
|
|
||||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||||
|
|
||||||
word magName = resultName;
|
|
||||||
if (magName == "none")
|
|
||||||
{
|
|
||||||
magName = "mag(" + fieldName + ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mesh.foundObject<vfType>(fieldName))
|
if (mesh.foundObject<vfType>(fieldName))
|
||||||
{
|
{
|
||||||
const vfType& vf = mesh.lookupObject<vfType>(fieldName);
|
const vfType& vf = mesh.lookupObject<vfType>(fieldName);
|
||||||
|
|
||||||
volScalarField& field =
|
volScalarField& field =
|
||||||
magField<volScalarField>(magName, vf.dimensions());
|
magField<volScalarField>(resultName_, vf.dimensions());
|
||||||
|
|
||||||
field = mag(vf);
|
field = mag(vf);
|
||||||
|
|
||||||
Info<< type() << " output:" << nl
|
|
||||||
<< " writing " << field.name() << " field" << nl << endl;
|
|
||||||
|
|
||||||
field.write();
|
|
||||||
|
|
||||||
processed = true;
|
processed = true;
|
||||||
}
|
}
|
||||||
else if (mesh.foundObject<sfType>(fieldName))
|
else if (mesh.foundObject<sfType>(fieldName))
|
||||||
@ -107,15 +96,10 @@ void Foam::calcMag::calc
|
|||||||
const sfType& sf = mesh.lookupObject<sfType>(fieldName);
|
const sfType& sf = mesh.lookupObject<sfType>(fieldName);
|
||||||
|
|
||||||
surfaceScalarField& field =
|
surfaceScalarField& field =
|
||||||
magField<surfaceScalarField>(magName, sf.dimensions());
|
magField<surfaceScalarField>(resultName_, sf.dimensions());
|
||||||
|
|
||||||
field = mag(sf);
|
field = mag(sf);
|
||||||
|
|
||||||
Info<< type() << " output:" << nl
|
|
||||||
<< " writing " << field.name() << " field" << nl << endl;
|
|
||||||
|
|
||||||
field.write();
|
|
||||||
|
|
||||||
processed = true;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -154,24 +154,6 @@ void Foam::CourantNo::read(const dictionary& dict)
|
|||||||
|
|
||||||
|
|
||||||
void Foam::CourantNo::execute()
|
void Foam::CourantNo::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::CourantNo::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::CourantNo::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::CourantNo::write()
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
@ -197,6 +179,28 @@ void Foam::CourantNo::write()
|
|||||||
iField = 0.5*sumPhi/mesh.V().field()*mesh.time().deltaTValue();
|
iField = 0.5*sumPhi/mesh.V().field()*mesh.time().deltaTValue();
|
||||||
|
|
||||||
CourantNo.correctBoundaryConditions();
|
CourantNo.correctBoundaryConditions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::CourantNo::end()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::CourantNo::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::CourantNo::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
const volScalarField& CourantNo =
|
||||||
|
obr_.lookupObject<volScalarField>(type());
|
||||||
|
|
||||||
Info<< type() << " " << name_ << " output:" << nl
|
Info<< type() << " " << name_ << " output:" << nl
|
||||||
<< " writing field " << CourantNo.name() << nl
|
<< " writing field " << CourantNo.name() << nl
|
||||||
|
|||||||
@ -129,24 +129,6 @@ void Foam::DESModelRegions::read(const dictionary& dict)
|
|||||||
|
|
||||||
|
|
||||||
void Foam::DESModelRegions::execute()
|
void Foam::DESModelRegions::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::DESModelRegions::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::DESModelRegions::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::DESModelRegions::write()
|
|
||||||
{
|
{
|
||||||
typedef incompressible::turbulenceModel icoModel;
|
typedef incompressible::turbulenceModel icoModel;
|
||||||
typedef incompressible::DESModel icoDESModel;
|
typedef incompressible::DESModel icoDESModel;
|
||||||
@ -217,12 +199,8 @@ void Foam::DESModelRegions::write()
|
|||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
Info<< " LES = " << prc << " % (volume)" << nl
|
Info<< " LES = " << prc << " % (volume)" << nl
|
||||||
<< " RAS = " << 100.0 - prc << " % (volume)" << nl
|
<< " RAS = " << 100.0 - prc << " % (volume)" << endl;
|
||||||
<< " writing field " << DESModelRegions.name() << nl
|
|
||||||
<< endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DESModelRegions.write();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -236,4 +214,33 @@ void Foam::DESModelRegions::write()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::DESModelRegions::end()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::DESModelRegions::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::DESModelRegions::write()
|
||||||
|
{
|
||||||
|
if (log_)
|
||||||
|
{
|
||||||
|
const volScalarField& DESModelRegions =
|
||||||
|
obr_.lookupObject<volScalarField>(type());
|
||||||
|
|
||||||
|
|
||||||
|
Info<< type() << " " << name_ << " output:" << nl;
|
||||||
|
<< " writing field " << DESModelRegions.name() << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
DESModelRegions.write();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -115,24 +115,6 @@ void Foam::Lambda2::read(const dictionary& dict)
|
|||||||
|
|
||||||
|
|
||||||
void Foam::Lambda2::execute()
|
void Foam::Lambda2::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::Lambda2::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::Lambda2::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::Lambda2::write()
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
@ -156,6 +138,28 @@ void Foam::Lambda2::write()
|
|||||||
);
|
);
|
||||||
|
|
||||||
Lambda2 = -eigenValues(SSplusWW)().component(vector::Y);
|
Lambda2 = -eigenValues(SSplusWW)().component(vector::Y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::Lambda2::end()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::Lambda2::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::Lambda2::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
const volScalarField& Lambda2 =
|
||||||
|
obr_.lookupObject<volScalarField>(type())
|
||||||
|
|
||||||
Info<< type() << " " << name_ << " output:" << nl
|
Info<< type() << " " << name_ << " output:" << nl
|
||||||
<< " writing field " << Lambda2.name() << nl
|
<< " writing field " << Lambda2.name() << nl
|
||||||
|
|||||||
@ -119,23 +119,6 @@ void Foam::Peclet::read(const dictionary& dict)
|
|||||||
|
|
||||||
|
|
||||||
void Foam::Peclet::execute()
|
void Foam::Peclet::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::Peclet::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
void Foam::Peclet::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::Peclet::write()
|
|
||||||
{
|
{
|
||||||
typedef compressible::turbulenceModel cmpTurbModel;
|
typedef compressible::turbulenceModel cmpTurbModel;
|
||||||
typedef incompressible::turbulenceModel icoTurbModel;
|
typedef incompressible::turbulenceModel icoTurbModel;
|
||||||
@ -208,6 +191,27 @@ void Foam::Peclet::write()
|
|||||||
*mesh.surfaceInterpolation::deltaCoeffs()
|
*mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
*fvc::interpolate(nuEff)
|
*fvc::interpolate(nuEff)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::Peclet::end()
|
||||||
|
{
|
||||||
|
// Do nothing - only valid on write
|
||||||
|
}
|
||||||
|
|
||||||
|
void Foam::Peclet::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing - only valid on write
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::Peclet::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
const surfaceScalarField& Peclet =
|
||||||
|
mesh.lookupObject<surfaceScalarField>(type());
|
||||||
|
|
||||||
Info<< type() << " " << name_ << " output:" << nl
|
Info<< type() << " " << name_ << " output:" << nl
|
||||||
<< " writing field " << Peclet.name() << nl
|
<< " writing field " << Peclet.name() << nl
|
||||||
|
|||||||
@ -114,24 +114,6 @@ void Foam::Q::read(const dictionary& dict)
|
|||||||
|
|
||||||
|
|
||||||
void Foam::Q::execute()
|
void Foam::Q::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::Q::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::Q::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::Q::write()
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
@ -149,6 +131,28 @@ void Foam::Q::write()
|
|||||||
);
|
);
|
||||||
|
|
||||||
Q = 0.5*(sqr(tr(gradU)) - tr(((gradU) & (gradU))));
|
Q = 0.5*(sqr(tr(gradU)) - tr(((gradU) & (gradU))));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::Q::end()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::Q::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::Q::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
const volScalarField& Q =
|
||||||
|
mesh.lookupObject<volScalarField>(type())
|
||||||
|
|
||||||
Info<< type() << " " << name_ << " output:" << nl
|
Info<< type() << " " << name_ << " output:" << nl
|
||||||
<< " writing field " << Q.name() << nl
|
<< " writing field " << Q.name() << nl
|
||||||
|
|||||||
@ -291,24 +291,6 @@ void Foam::pressureTools::read(const dictionary& dict)
|
|||||||
|
|
||||||
|
|
||||||
void Foam::pressureTools::execute()
|
void Foam::pressureTools::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::pressureTools::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::pressureTools::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::pressureTools::write()
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
@ -321,6 +303,28 @@ void Foam::pressureTools::write()
|
|||||||
);
|
);
|
||||||
|
|
||||||
pResult == convertToCoeff(rhoScale(p)*p + pDyn(p) + pRef());
|
pResult == convertToCoeff(rhoScale(p)*p + pDyn(p) + pRef());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::pressureTools::end()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::pressureTools::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::pressureTools::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
const volScalarField& pResult =
|
||||||
|
obr_.lookupObject<volScalarField>(pName())
|
||||||
|
|
||||||
Info<< type() << " " << name_ << " output:" << nl
|
Info<< type() << " " << name_ << " output:" << nl
|
||||||
<< " writing field " << pResult.name() << nl
|
<< " writing field " << pResult.name() << nl
|
||||||
|
|||||||
@ -224,24 +224,6 @@ void Foam::wallShearStress::read(const dictionary& dict)
|
|||||||
|
|
||||||
|
|
||||||
void Foam::wallShearStress::execute()
|
void Foam::wallShearStress::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::wallShearStress::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::wallShearStress::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::wallShearStress::write()
|
|
||||||
{
|
{
|
||||||
typedef compressible::turbulenceModel cmpModel;
|
typedef compressible::turbulenceModel cmpModel;
|
||||||
typedef incompressible::turbulenceModel icoModel;
|
typedef incompressible::turbulenceModel icoModel;
|
||||||
@ -286,8 +268,31 @@ void Foam::wallShearStress::write()
|
|||||||
<< "database" << exit(FatalError);
|
<< "database" << exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
calcShearStress(mesh, Reff(), wallShearStress);
|
calcShearStress(mesh, Reff(), wallShearStress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::wallShearStress::end()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::wallShearStress::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::wallShearStress::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
functionObjectFile::write();
|
||||||
|
|
||||||
|
const volVectorField& wallShearStress =
|
||||||
|
obr_.lookupObject<volVectorField>(type());
|
||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -268,24 +268,6 @@ void Foam::yPlusLES::read(const dictionary& dict)
|
|||||||
|
|
||||||
|
|
||||||
void Foam::yPlusLES::execute()
|
void Foam::yPlusLES::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::yPlusLES::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::yPlusLES::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::yPlusLES::write()
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
@ -317,6 +299,30 @@ void Foam::yPlusLES::write()
|
|||||||
{
|
{
|
||||||
calcIncompressibleYPlus(mesh, U, yPlusLES);
|
calcIncompressibleYPlus(mesh, U, yPlusLES);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::yPlusLES::end()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::yPlusLES::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::yPlusLES::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
functionObjectFile::write();
|
||||||
|
|
||||||
|
const volScalarField& yPlusLES =
|
||||||
|
obr_.lookupObject<volScalarField>(type())
|
||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -255,24 +255,6 @@ void Foam::yPlusRAS::read(const dictionary& dict)
|
|||||||
|
|
||||||
|
|
||||||
void Foam::yPlusRAS::execute()
|
void Foam::yPlusRAS::execute()
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::yPlusRAS::end()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::yPlusRAS::timeSet()
|
|
||||||
{
|
|
||||||
// Do nothing - only valid on write
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::yPlusRAS::write()
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
@ -302,6 +284,30 @@ void Foam::yPlusRAS::write()
|
|||||||
{
|
{
|
||||||
calcIncompressibleYPlus(mesh, yPlusRAS);
|
calcIncompressibleYPlus(mesh, yPlusRAS);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::yPlusRAS::end()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::yPlusRAS::timeSet()
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::yPlusRAS::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
functionObjectFile::write();
|
||||||
|
|
||||||
|
const volScalarField& yPlusRAS =
|
||||||
|
mesh.lookupObject<volScalarField>(type())
|
||||||
|
|
||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user