From 5126a6a49acd24902001dc7b83f0d1ebe2688119 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 29 Nov 2013 09:25:09 +0000 Subject: [PATCH] ENH: Function object updates --- .../fieldAverage/fieldAverage/fieldAverage.C | 1 - .../fieldCoordinateSystemTransform.C | 40 +++++++++---- .../fieldCoordinateSystemTransformTemplates.C | 2 +- .../field/nearWallFields/nearWallFields.C | 57 ++++++++++--------- .../field/processorField/processorField.C | 46 ++++++++++----- .../fvTools/calcFvcDiv/calcFvcDiv.C | 53 +++++++++++------ .../fvTools/calcFvcDiv/calcFvcDivTemplates.C | 13 +---- .../fvTools/calcFvcGrad/calcFvcGrad.C | 53 +++++++++++------ .../calcFvcGrad/calcFvcGradTemplates.C | 19 +------ .../functionObjects/fvTools/calcMag/calcMag.C | 53 +++++++++++------ .../fvTools/calcMag/calcMagTemplates.C | 22 +------ .../utilities/CourantNo/CourantNo.C | 40 +++++++------ .../DESModelRegions/DESModelRegions.C | 53 +++++++++-------- .../utilities/Lambda2/Lambda2.C | 40 +++++++------ .../functionObjects/utilities/Peclet/Peclet.C | 38 +++++++------ .../functionObjects/utilities/Q/Q.C | 40 +++++++------ .../utilities/pressureTools/pressureTools.C | 40 +++++++------ .../wallShearStress/wallShearStress.C | 43 +++++++------- .../utilities/yPlusLES/yPlusLES.C | 42 ++++++++------ .../utilities/yPlusRAS/yPlusRAS.C | 42 ++++++++------ 20 files changed, 415 insertions(+), 322 deletions(-) diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C index e4074f51a5..5469335d4a 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C @@ -335,7 +335,6 @@ void Foam::fieldAverage::write() { if (active_) { - calcAverages(); writeAverages(); writeAveragingProperties(); diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C index 57cff30637..7fdb74f812 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C @@ -96,7 +96,20 @@ void Foam::fieldCoordinateSystemTransform::read(const dictionary& dict) void Foam::fieldCoordinateSystemTransform::execute() { - // Do nothing + if (active_) + { + Info<< type() << " " << name_ << " output:" << nl; + + forAll(fieldSet_, fieldI) + { + // If necessary load field + transform(fieldSet_[fieldI]); + transform(fieldSet_[fieldI]); + transform(fieldSet_[fieldI]); + transform(fieldSet_[fieldI]); + transform(fieldSet_[fieldI]); + } + } } @@ -114,16 +127,23 @@ void Foam::fieldCoordinateSystemTransform::timeSet() void Foam::fieldCoordinateSystemTransform::write() { - Info<< type() << " " << name_ << " output:" << nl; - - forAll(fieldSet_, fieldI) + if (active_) { - // If necessary load field - transform(fieldSet_[fieldI]); - transform(fieldSet_[fieldI]); - transform(fieldSet_[fieldI]); - transform(fieldSet_[fieldI]); - transform(fieldSet_[fieldI]); + Info<< type() << " " << name_ << " output:" << nl; + + forAll(fieldSet_, fieldI) + { + const word fieldName = fieldSet_[fieldI] + ":Transformed"; + + const regIOobject& field = + obr_.lookupObject(fieldName); + + Info<< " writing field " << field.name() << nl; + + field.write(); + } + + Info<< endl; } } diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C index 945b15532e..872c9b189c 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransformTemplates.C @@ -37,7 +37,7 @@ void Foam::fieldCoordinateSystemTransform::transformField const Type& field ) const { - const word& fieldName = field.name() + "Transformed"; + const word& fieldName = field.name() + ":Transformed"; if (!obr_.foundObject(fieldName)) { diff --git a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C index 83ede96387..40211ae7a2 100644 --- a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C +++ b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C @@ -328,32 +328,8 @@ void Foam::nearWallFields::execute() { 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 @@ -380,7 +356,7 @@ void Foam::nearWallFields::write() Info<< type() << " " << name_ << " output:" << nl; - Info<< " Writing sampled fields to " << obr_.time().timeName() + Info<< " Sampling fields fields to " << obr_.time().timeName() << endl; sampleFields(vsf_); @@ -388,8 +364,37 @@ void Foam::nearWallFields::write() sampleFields(vSpheretf_); sampleFields(vSymmtf_); 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) { vsf_[i].write(); diff --git a/src/postProcessing/functionObjects/field/processorField/processorField.C b/src/postProcessing/functionObjects/field/processorField/processorField.C index 18603fbed2..37c61b5db2 100644 --- a/src/postProcessing/functionObjects/field/processorField/processorField.C +++ b/src/postProcessing/functionObjects/field/processorField/processorField.C @@ -53,6 +53,27 @@ Foam::processorField::processorField if (isA(obr_)) { read(dict); + + const fvMesh& mesh = refCast(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 { @@ -88,7 +109,14 @@ void Foam::processorField::read(const dictionary& dict) void Foam::processorField::execute() { - // Do nothing + if (active_) + { + const volScalarField& procField = + obr_.lookupObject("processorID"); + + const_cast(procField) == + dimensionedScalar("procI", dimless, Pstream::myProcNo()); + } } @@ -108,20 +136,8 @@ void Foam::processorField::write() { if (active_) { - const fvMesh& mesh = refCast(obr_); - volScalarField procField - ( - IOobject - ( - "processorID", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionedScalar("procI", dimless, Pstream::myProcNo()) - ); + const volScalarField& procField = + obr_.lookupObject("processorID"); procField.write(); } diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C index 185e83b0a4..9620fe3222 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C @@ -125,29 +125,16 @@ void Foam::calcFvcDiv::read(const dictionary& dict) { dict.lookup("fieldName") >> fieldName_; dict.lookup("resultName") >> resultName_; + + if (resultName_ == "none") + { + resultName_ = "fvc::div(" + fieldName_ + ")"; + } } } 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_) { @@ -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(resultName_)) + { + const regIOobject& field = + obr_.lookupObject(resultName_); + + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << field.name() << nl << endl; + + field.write(); + } + } +} + + // ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C index d7db1e4081..d7561744dc 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C @@ -38,25 +38,14 @@ void Foam::calcFvcDiv::calcDiv { const fvMesh& mesh = refCast(obr_); - word divName = resultName; - if (divName == "none") - { - divName = "fvc::div(" + fieldName + ")"; - } - if (mesh.foundObject(fieldName)) { const FieldType& vf = mesh.lookupObject(fieldName); - volScalarField& field = divField(divName, vf.dimensions()); + volScalarField& field = divField(resultName, vf.dimensions()); field = fvc::div(vf); - Info<< type() << " " << name_ << " output:" << nl - << " writing field " << field.name() << nl << endl; - - field.write(); - processed = true; } } diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C index 6b8efee0c8..31d24da4e9 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C @@ -87,29 +87,16 @@ void Foam::calcFvcGrad::read(const dictionary& dict) { dict.lookup("fieldName") >> fieldName_; dict.lookup("resultName") >> resultName_; + + if (resultName_ == "none") + { + resultName_ = "fvc::grad(" + fieldName_ + ")"; + } } } 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_) { @@ -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(resultName_)) + { + const regIOobject& field = + obr_.lookupObject(resultName_); + + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << field.name() << nl << endl; + + field.write(); + } + } +} + + // ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C index d8180c1e30..c028628e37 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C @@ -91,40 +91,25 @@ void Foam::calcFvcGrad::calcGrad const fvMesh& mesh = refCast(obr_); - word gradName = resultName; - if (gradName == "none") - { - gradName = "fvc::grad(" + fieldName + ")"; - } if (mesh.foundObject(fieldName)) { const vfType& vf = mesh.lookupObject(fieldName); - vfGradType& field = gradField(gradName, vf.dimensions()); + vfGradType& field = gradField(resultName, vf.dimensions()); field = fvc::grad(vf); - Info<< type() << " output:" << nl - << " writing " << field.name() << " field" << nl << endl; - - field.write(); - processed = true; } else if (mesh.foundObject(fieldName)) { const sfType& sf = mesh.lookupObject(fieldName); - vfGradType& field = gradField(gradName, sf.dimensions()); + vfGradType& field = gradField(resultName, sf.dimensions()); field = fvc::grad(sf); - Info<< type() << " " << name_ << " output:" << nl - << " writing field " << field.name() << nl << endl; - - field.write(); - processed = true; } } diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C index 93229e7f5d..3b400f4889 100644 --- a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C @@ -87,29 +87,16 @@ void Foam::calcMag::read(const dictionary& dict) { dict.lookup("fieldName") >> fieldName_; dict.lookup("resultName") >> resultName_; + + if (resultName_ == "none") + { + resultName_ = "mag(" + fieldName_ + ")"; + } } } 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_) { @@ -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(resultName_)) + { + const regIOobject& field = + obr_.lookupObject(resultName_); + + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << field.name() << nl << endl; + + field.write(); + } + } +} + + // ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMagTemplates.C b/src/postProcessing/functionObjects/fvTools/calcMag/calcMagTemplates.C index 4435b64f1b..f9db9368f7 100644 --- a/src/postProcessing/functionObjects/fvTools/calcMag/calcMagTemplates.C +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMagTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,26 +80,15 @@ void Foam::calcMag::calc const fvMesh& mesh = refCast(obr_); - word magName = resultName; - if (magName == "none") - { - magName = "mag(" + fieldName + ")"; - } - if (mesh.foundObject(fieldName)) { const vfType& vf = mesh.lookupObject(fieldName); volScalarField& field = - magField(magName, vf.dimensions()); + magField(resultName_, vf.dimensions()); field = mag(vf); - Info<< type() << " output:" << nl - << " writing " << field.name() << " field" << nl << endl; - - field.write(); - processed = true; } else if (mesh.foundObject(fieldName)) @@ -107,15 +96,10 @@ void Foam::calcMag::calc const sfType& sf = mesh.lookupObject(fieldName); surfaceScalarField& field = - magField(magName, sf.dimensions()); + magField(resultName_, sf.dimensions()); field = mag(sf); - Info<< type() << " output:" << nl - << " writing " << field.name() << " field" << nl << endl; - - field.write(); - processed = true; } } diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C index 8afeaa188d..2a662c6513 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C @@ -154,24 +154,6 @@ void Foam::CourantNo::read(const dictionary& dict) 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_) { @@ -197,6 +179,28 @@ void Foam::CourantNo::write() iField = 0.5*sumPhi/mesh.V().field()*mesh.time().deltaTValue(); 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(type()); Info<< type() << " " << name_ << " output:" << nl << " writing field " << CourantNo.name() << nl diff --git a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C index f79a7beb79..d600857a1d 100644 --- a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C +++ b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C @@ -129,24 +129,6 @@ void Foam::DESModelRegions::read(const dictionary& dict) 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::DESModel icoDESModel; @@ -217,12 +199,8 @@ void Foam::DESModelRegions::write() if (log_) { Info<< " LES = " << prc << " % (volume)" << nl - << " RAS = " << 100.0 - prc << " % (volume)" << nl - << " writing field " << DESModelRegions.name() << nl - << endl; + << " RAS = " << 100.0 - prc << " % (volume)" << endl; } - - DESModelRegions.write(); } 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(type()); + + + Info<< type() << " " << name_ << " output:" << nl; + << " writing field " << DESModelRegions.name() << nl + << endl; + + DESModelRegions.write(); + } +} + + // ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C index 32a9c2c594..1bcce20942 100644 --- a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C @@ -115,24 +115,6 @@ void Foam::Lambda2::read(const dictionary& dict) 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_) { @@ -156,6 +138,28 @@ void Foam::Lambda2::write() ); 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(type()) Info<< type() << " " << name_ << " output:" << nl << " writing field " << Lambda2.name() << nl diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C index 38edafd0fa..0f1b262afb 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C @@ -119,23 +119,6 @@ void Foam::Peclet::read(const dictionary& dict) 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 incompressible::turbulenceModel icoTurbModel; @@ -208,6 +191,27 @@ void Foam::Peclet::write() *mesh.surfaceInterpolation::deltaCoeffs() *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(type()); Info<< type() << " " << name_ << " output:" << nl << " writing field " << Peclet.name() << nl diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.C b/src/postProcessing/functionObjects/utilities/Q/Q.C index d2fdbd7b2a..0a484a9eaa 100644 --- a/src/postProcessing/functionObjects/utilities/Q/Q.C +++ b/src/postProcessing/functionObjects/utilities/Q/Q.C @@ -114,24 +114,6 @@ void Foam::Q::read(const dictionary& dict) 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_) { @@ -149,6 +131,28 @@ void Foam::Q::write() ); 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(type()) Info<< type() << " " << name_ << " output:" << nl << " writing field " << Q.name() << nl diff --git a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C index e3f681f64b..cba7dc4933 100644 --- a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C +++ b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C @@ -291,24 +291,6 @@ void Foam::pressureTools::read(const dictionary& dict) 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_) { @@ -321,6 +303,28 @@ void Foam::pressureTools::write() ); 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(pName()) Info<< type() << " " << name_ << " output:" << nl << " writing field " << pResult.name() << nl diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C index 30f4f34ff8..a507428c6f 100644 --- a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C @@ -224,24 +224,6 @@ void Foam::wallShearStress::read(const dictionary& dict) 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 incompressible::turbulenceModel icoModel; @@ -286,8 +268,31 @@ void Foam::wallShearStress::write() << "database" << exit(FatalError); } - 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(type()); if (log_) { diff --git a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C index acad1aef70..e1b22eeb56 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C +++ b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C @@ -268,24 +268,6 @@ void Foam::yPlusLES::read(const dictionary& dict) 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_) { @@ -317,6 +299,30 @@ void Foam::yPlusLES::write() { 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(type()) if (log_) { diff --git a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C index 610cc28bbf..bacd1019d6 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C +++ b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C @@ -255,24 +255,6 @@ void Foam::yPlusRAS::read(const dictionary& dict) 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_) { @@ -302,6 +284,30 @@ void Foam::yPlusRAS::write() { 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(type()) if (log_) {