diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake index 6851210bd764c8878a8aaca887aa9e2cce5190ac..1568f8afb808e9df76a3c9e244ccce0cb0aba9f5 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake @@ -1,6 +1,6 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory -set -x +#set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] then @@ -15,6 +15,8 @@ then wmake libso vtkPV3Readers PV3blockMeshReader/Allwmake PV3FoamReader/Allwmake +else + echo "ERROR: ParaView not found in $ParaView_DIR" fi # ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/postProcessing/wall/wallShearStress/Make/options b/applications/utilities/postProcessing/wall/wallShearStress/Make/options index 88625658635aad84f541d7f9cb1adcdff85fac08..b386fa4540210e189a3c8887c3f08ae89f9d2f49 100644 --- a/applications/utilities/postProcessing/wall/wallShearStress/Make/options +++ b/applications/utilities/postProcessing/wall/wallShearStress/Make/options @@ -1,11 +1,14 @@ EXE_INC = \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/turbulenceModels \ - -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lincompressibleRASModels \ -lincompressibleTransportModels \ + -lincompressibleRASModels \ + -lbasicThermophysicalModels \ + -lspecie \ + -lcompressibleRASModels \ -lfiniteVolume \ -lgenericPatchFields diff --git a/applications/utilities/postProcessing/wall/wallShearStress/createFields.H b/applications/utilities/postProcessing/wall/wallShearStress/createFields.H deleted file mode 100644 index d069c4545db5789774099457c72b280146f082f5..0000000000000000000000000000000000000000 --- a/applications/utilities/postProcessing/wall/wallShearStress/createFields.H +++ /dev/null @@ -1,22 +0,0 @@ - Info<< "Reading field U\n" << endl; - volVectorField U - ( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - -# include "createPhi.H" - - singlePhaseTransportModel laminarTransport(U, phi); - - autoPtr<incompressible::RASModel> RASModel - ( - incompressible::RASModel::New(U, phi, laminarTransport) - ); diff --git a/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C b/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C index 7d440417dfbe48ca5aa60b86b72739fa2331685b..6069837b9513d27ca51c72792ffde69f3eec68a4 100644 --- a/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C +++ b/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C @@ -25,23 +25,130 @@ Application wallShearStress Description - Calculates and writes the wall shear stress, for the specified times. + Calculates and reports wall shear stress for all patches, for the + specified times when using RAS turbulence models. + + Default behaviour assumes operating in incompressible mode. + Use the -compressible option for compressible RAS cases. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" + #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" -#include "RASModel.H" +#include "incompressible/RAS/RASModel/RASModel.H" + +#include "basicPsiThermo.H" +#include "compressible/RAS/RASModel/RASModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +void calcIncompressible +( + const fvMesh& mesh, + const Time& runTime, + const volVectorField& U, + volVectorField& wallShearStress +) +{ + #include "createPhi.H" + + singlePhaseTransportModel laminarTransport(U, phi); + + autoPtr<incompressible::RASModel> model + ( + incompressible::RASModel::New(U, phi, laminarTransport) + ); + + const volSymmTensorField Reff(model->devReff()); + + forAll(wallShearStress.boundaryField(), patchI) + { + wallShearStress.boundaryField()[patchI] = + ( + -mesh.Sf().boundaryField()[patchI] + /mesh.magSf().boundaryField()[patchI] + ) & Reff.boundaryField()[patchI]; + } +} + + +void calcCompressible +( + const fvMesh& mesh, + const Time& runTime, + const volVectorField& U, + volVectorField& wallShearStress +) +{ + IOobject rhoHeader + ( + "rho", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (!rhoHeader.headerOk()) + { + Info<< " no rho field" << endl; + return; + } + + Info<< "Reading field rho\n" << endl; + volScalarField rho(rhoHeader, mesh); + + #include "compressibleCreatePhi.H" + + autoPtr<basicPsiThermo> pThermo + ( + basicPsiThermo::New(mesh) + ); + basicPsiThermo& thermo = pThermo(); + + autoPtr<compressible::RASModel> model + ( + compressible::RASModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + const volSymmTensorField Reff(model->devRhoReff()); + + forAll(wallShearStress.boundaryField(), patchI) + { + wallShearStress.boundaryField()[patchI] = + ( + -mesh.Sf().boundaryField()[patchI] + /mesh.magSf().boundaryField()[patchI] + ) & Reff.boundaryField()[patchI]; + } +} + + int main(int argc, char *argv[]) { timeSelector::addOptions(); + + #include "addRegionOption.H" + + argList::addBoolOption + ( + "compressible", + "calculate compressible wall shear stress" + ); + #include "setRootCase.H" #include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); - #include "createMesh.H" + #include "createNamedMesh.H" + + const bool compressible = args.optionFound("compressible"); forAll(timeDirs, timeI) { @@ -49,10 +156,6 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << endl; mesh.readUpdate(); - #include "createFields.H" - - volSymmTensorField Reff(RASModel->devReff()); - volVectorField wallShearStress ( IOobject @@ -67,19 +170,41 @@ int main(int argc, char *argv[]) dimensionedVector ( "wallShearStress", - Reff.dimensions(), + sqr(dimLength)/sqr(dimTime), vector::zero ) ); - forAll(wallShearStress.boundaryField(), patchi) + IOobject UHeader + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (UHeader.headerOk()) { - wallShearStress.boundaryField()[patchi] = - ( - -mesh.Sf().boundaryField()[patchi] - /mesh.magSf().boundaryField()[patchi] - ) & Reff.boundaryField()[patchi]; + Info<< "Reading field U\n" << endl; + volVectorField U(UHeader, mesh); + + if (compressible) + { + calcCompressible(mesh, runTime, U, wallShearStress); + } + else + { + calcIncompressible(mesh, runTime, U, wallShearStress); + } } + else + { + Info<< " no U field" << endl; + } + + Info<< "Writing wall shear stress to field " << wallShearStress.name() + << nl << endl; wallShearStress.write(); } diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C index 98a742e16bf12562525fc0da02f587defff2f0c6..7ff31db0eca3fa6caae875008875c13f106b89e8 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C @@ -196,9 +196,10 @@ bool Foam::pimpleControl::loop() bool completed = false; if (criteriaSatisfied()) { - Info<< algorithmName_ << ": converged in " << corr_ << " iterations" + Info<< algorithmName_ << ": converged in " << corr_ - 1 << " iterations" << endl; completed = true; + corr_ = 0; } else {