diff --git a/etc/caseDicts/postProcessing/fields/AMIWeights b/etc/caseDicts/postProcessing/fields/AMIWeights index ce628f15ca7155cdf193156850ec2671dcda1df6..4b78063da0b52e0e68658e4798ea90368ab51a59 100644 --- a/etc/caseDicts/postProcessing/fields/AMIWeights +++ b/etc/caseDicts/postProcessing/fields/AMIWeights @@ -6,14 +6,16 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Description - Calculates and writes the second largest eigenvalue of the sum of the - square of the symmetrical and anti-symmetrical parts of the velocity - gradient tensor. + Computes the min/max/average arbitrary mesh interface (AMI) weights, and + optionally reports to a text file or writes VTK surfaces of the sum of + the weights and mask fields for arbitrarily coupled mesh interface (ACMI) + patches. \*---------------------------------------------------------------------------*/ type AMIWeights; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); + writeFields yes; writeControl writeTime; diff --git a/etc/caseDicts/postProcessing/fields/CourantNo b/etc/caseDicts/postProcessing/fields/CourantNo index 7278240a67a8a28f20000e8dae4c54e68313cadb..0b1dd48a50212a9ff7978b408cc0474c8af35d50 100644 --- a/etc/caseDicts/postProcessing/fields/CourantNo +++ b/etc/caseDicts/postProcessing/fields/CourantNo @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type CourantNo; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field phi; diff --git a/etc/caseDicts/postProcessing/fields/lambVector b/etc/caseDicts/postProcessing/fields/LambVector similarity index 68% rename from etc/caseDicts/postProcessing/fields/lambVector rename to etc/caseDicts/postProcessing/fields/LambVector index 2726b04e60d9c79191b59965b9b0405a26939483..bea01caba0e3f77976bf0a75a351704fd3fe3787 100644 --- a/etc/caseDicts/postProcessing/fields/lambVector +++ b/etc/caseDicts/postProcessing/fields/LambVector @@ -6,14 +6,14 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Description - Calculates and writes the second largest eigenvalue of the sum of the - square of the symmetrical and anti-symmetrical parts of the velocity - gradient tensor. + Calculates Lamb vector, i.e. the cross product of vorticity and velocity. + Calculation of the divergence of the Lamb vector can be performed by using + \c div function object on this \c LambVector function object. \*---------------------------------------------------------------------------*/ -type lambVector; -libs ("libfieldFunctionObjects.so"); +type LambVector; +libs (fieldFunctionObjects); field U; diff --git a/etc/caseDicts/postProcessing/fields/Lambda2 b/etc/caseDicts/postProcessing/fields/Lambda2 index af2eb9883ae49763e1a10802aed351b99afaeb1a..27afb5dc914901778a755402c540dcbb6e352e22 100644 --- a/etc/caseDicts/postProcessing/fields/Lambda2 +++ b/etc/caseDicts/postProcessing/fields/Lambda2 @@ -13,7 +13,7 @@ Description \*---------------------------------------------------------------------------*/ type Lambda2; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field U; diff --git a/etc/caseDicts/postProcessing/fields/MachNo b/etc/caseDicts/postProcessing/fields/MachNo index 3656ffe7a63ad8bb89f2df6c75b16c7d68d66290..5153ad23d5aa08e3305845b3519b2adb78a56965 100644 --- a/etc/caseDicts/postProcessing/fields/MachNo +++ b/etc/caseDicts/postProcessing/fields/MachNo @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type MachNo; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field U; diff --git a/etc/caseDicts/postProcessing/fields/PecletNo b/etc/caseDicts/postProcessing/fields/PecletNo index 066e674834da1614723388c13d4490841ce43029..6015538603395d3616cd6a71f7ef846320fafca1 100644 --- a/etc/caseDicts/postProcessing/fields/PecletNo +++ b/etc/caseDicts/postProcessing/fields/PecletNo @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type PecletNo; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field phi; diff --git a/etc/caseDicts/postProcessing/fields/Q b/etc/caseDicts/postProcessing/fields/Q index 98429a767f01223ba2c393c42c785111e0a76f69..3f8b7f8a2b0aee31a01a7b622b24e1980a6479b4 100644 --- a/etc/caseDicts/postProcessing/fields/Q +++ b/etc/caseDicts/postProcessing/fields/Q @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type Q; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field U; diff --git a/etc/caseDicts/postProcessing/fields/R b/etc/caseDicts/postProcessing/fields/R index 27d7e9f64300d9e3ba0f57b421f30e5732d5d23c..0294d5e6ed01fbafad8fd4e14f954104bea718e9 100644 --- a/etc/caseDicts/postProcessing/fields/R +++ b/etc/caseDicts/postProcessing/fields/R @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type turbulenceFields; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field R; diff --git a/etc/caseDicts/postProcessing/fields/XiReactionRate b/etc/caseDicts/postProcessing/fields/XiReactionRate index 862dc8b03c1dacd4dca4b643cea7617476e18b85..9be07bcae52a88fdce7ab10a62a1ad41bbabdbca 100644 --- a/etc/caseDicts/postProcessing/fields/XiReactionRate +++ b/etc/caseDicts/postProcessing/fields/XiReactionRate @@ -12,7 +12,7 @@ Description \*---------------------------------------------------------------------------*/ type XiReactionRate; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); fields (b Xi Su); diff --git a/etc/caseDicts/postProcessing/fields/add b/etc/caseDicts/postProcessing/fields/add index c08d952698108dceb704d88e3a371fc5bbadd467..2b1543521400f4b9af39526f11567e348ca42878 100644 --- a/etc/caseDicts/postProcessing/fields/add +++ b/etc/caseDicts/postProcessing/fields/add @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type add; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); fields (<field names>); diff --git a/etc/caseDicts/postProcessing/fields/components b/etc/caseDicts/postProcessing/fields/components index 23537c3fa1591442f3a82f59ef60bd57423717b8..779790366b27c33a766a7e09839c6d5ba8870ea1 100644 --- a/etc/caseDicts/postProcessing/fields/components +++ b/etc/caseDicts/postProcessing/fields/components @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type components; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field <fieldName>; diff --git a/etc/caseDicts/postProcessing/fields/ddt b/etc/caseDicts/postProcessing/fields/ddt index 8296c6f6e897a73840f6295c8118442002aadf98..27f130b9217fe5da4b2ead2f1e81548d6850d4a8 100644 --- a/etc/caseDicts/postProcessing/fields/ddt +++ b/etc/caseDicts/postProcessing/fields/ddt @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type ddt; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field <fieldName>; diff --git a/etc/caseDicts/postProcessing/fields/div b/etc/caseDicts/postProcessing/fields/div index ff2c533c85d2f5da9d61145745693c698877d342..257695fda8ef52a95f7dc7a3595553be45e64c05 100644 --- a/etc/caseDicts/postProcessing/fields/div +++ b/etc/caseDicts/postProcessing/fields/div @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type div; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field <fieldName>; diff --git a/etc/caseDicts/postProcessing/fields/energySpectrum b/etc/caseDicts/postProcessing/fields/energySpectrum index cc45b2efe451d80b4fd2d730ec7f059fe1940ca9..91d5b64c8b29419fc295810a3cc0f09c46affc8d 100644 --- a/etc/caseDicts/postProcessing/fields/energySpectrum +++ b/etc/caseDicts/postProcessing/fields/energySpectrum @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type energySpectrum; -libs ("librandomProcessesFunctionObjects.so"); +libs (randomProcessesFunctionObjects); executeControl writeTime; writeControl writeTime; diff --git a/etc/caseDicts/postProcessing/fields/enstrophy b/etc/caseDicts/postProcessing/fields/enstrophy index 11f0004e076793240dce4c890843d306f580672f..82b7a084b042f59b2ae2ec88304308113e025cc3 100644 --- a/etc/caseDicts/postProcessing/fields/enstrophy +++ b/etc/caseDicts/postProcessing/fields/enstrophy @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type enstrophy; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field U; diff --git a/etc/caseDicts/postProcessing/fields/fieldMinMax b/etc/caseDicts/postProcessing/fields/fieldMinMax index df66d158caee8c6cee98205ea8b6cd67c3c1bd14..663c0d932d275dfba79fcb958d595c25b6bea48a 100644 --- a/etc/caseDicts/postProcessing/fields/fieldMinMax +++ b/etc/caseDicts/postProcessing/fields/fieldMinMax @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type fieldMinMax; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); fields (".*"); diff --git a/etc/caseDicts/postProcessing/fields/flowType b/etc/caseDicts/postProcessing/fields/flowType index 2b47419d10d4269b9ad9605f7b886e2fee2d7970..4db371d01ac32e972d7317e427fb7dcbd7b1f65d 100644 --- a/etc/caseDicts/postProcessing/fields/flowType +++ b/etc/caseDicts/postProcessing/fields/flowType @@ -14,7 +14,7 @@ Description \*---------------------------------------------------------------------------*/ type flowType; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field U; diff --git a/etc/caseDicts/postProcessing/fields/grad b/etc/caseDicts/postProcessing/fields/grad index 394dd7336dfdffd002b08c9d6e8a83ef1892fe65..b87820565f8e0803ec2e64d83b3a1aa253031e75 100644 --- a/etc/caseDicts/postProcessing/fields/grad +++ b/etc/caseDicts/postProcessing/fields/grad @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type grad; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field <fieldName>; diff --git a/etc/caseDicts/postProcessing/fields/mag b/etc/caseDicts/postProcessing/fields/mag index cb067e51d20c3e8a9ba72f64ab4471c81ad0a647..2cad0ea778ee8c4a288d15858885bb901417ab36 100644 --- a/etc/caseDicts/postProcessing/fields/mag +++ b/etc/caseDicts/postProcessing/fields/mag @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type mag; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field <fieldName>; diff --git a/etc/caseDicts/postProcessing/fields/magSqr b/etc/caseDicts/postProcessing/fields/magSqr index 9cf8553a8c4ff17eea5e81b56e2aedb472ace46f..1b0e2925195e1fb5f4115d2fc7d91af62d036b64 100644 --- a/etc/caseDicts/postProcessing/fields/magSqr +++ b/etc/caseDicts/postProcessing/fields/magSqr @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type magSqr; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field <fieldName>; diff --git a/etc/caseDicts/postProcessing/fields/processorField b/etc/caseDicts/postProcessing/fields/processorField index 5a4631d89ff385b88c194bc0eb746823a5f7ccbc..883a675e2bf6b3405f234dd3899634807626f035 100644 --- a/etc/caseDicts/postProcessing/fields/processorField +++ b/etc/caseDicts/postProcessing/fields/processorField @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type processorField; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); executeControl writeTime; writeControl writeTime; diff --git a/etc/caseDicts/postProcessing/fields/streamFunction b/etc/caseDicts/postProcessing/fields/streamFunction index 6f3afa456e2fa99763b8a5e9706f2ce3212e6a6d..9f66d37f4ec9a7dc9778e9f8aaae3244ddeaadc3 100644 --- a/etc/caseDicts/postProcessing/fields/streamFunction +++ b/etc/caseDicts/postProcessing/fields/streamFunction @@ -12,7 +12,7 @@ Description \*---------------------------------------------------------------------------*/ type streamFunction; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field phi; diff --git a/etc/caseDicts/postProcessing/fields/subtract b/etc/caseDicts/postProcessing/fields/subtract index 1a2ed45d020213e858017a70183c35381d16dcb4..8416b90929d9a8bb7ffcce490798d99f572bc1f7 100644 --- a/etc/caseDicts/postProcessing/fields/subtract +++ b/etc/caseDicts/postProcessing/fields/subtract @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type subtract; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); fields (<field names>); diff --git a/etc/caseDicts/postProcessing/fields/turbulenceFields b/etc/caseDicts/postProcessing/fields/turbulenceFields index 99536ba2e032ac2c040419e8b5c88edb18ff224c..82f51daad538ad143d637247ccd7366a5330dbdc 100644 --- a/etc/caseDicts/postProcessing/fields/turbulenceFields +++ b/etc/caseDicts/postProcessing/fields/turbulenceFields @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type turbulenceFields; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); fields (<field names>); diff --git a/etc/caseDicts/postProcessing/fields/vorticity b/etc/caseDicts/postProcessing/fields/vorticity index dbd514057df9a2de759d905057158fd3a690cdbf..108b6a3f2bac95e217b4ca99772f440eae6ac925 100644 --- a/etc/caseDicts/postProcessing/fields/vorticity +++ b/etc/caseDicts/postProcessing/fields/vorticity @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type vorticity; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); field U; diff --git a/etc/caseDicts/postProcessing/fields/wallHeatFlux b/etc/caseDicts/postProcessing/fields/wallHeatFlux index a91079d4a3bb2bae4f1dbf32e231c3222c09c449..1663648d15bf1cf067609b9350749feef6e8e615 100644 --- a/etc/caseDicts/postProcessing/fields/wallHeatFlux +++ b/etc/caseDicts/postProcessing/fields/wallHeatFlux @@ -12,7 +12,7 @@ Description \*---------------------------------------------------------------------------*/ type wallHeatFlux; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); executeControl writeTime; writeControl writeTime; diff --git a/etc/caseDicts/postProcessing/fields/wallShearStress b/etc/caseDicts/postProcessing/fields/wallShearStress index 1a82871c51e8ee130633d6d04613439f53e72d0d..d7001e3b215d81c3b2977f2172798fb9d8fb5ef7 100644 --- a/etc/caseDicts/postProcessing/fields/wallShearStress +++ b/etc/caseDicts/postProcessing/fields/wallShearStress @@ -12,7 +12,7 @@ Description \*---------------------------------------------------------------------------*/ type wallShearStress; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); executeControl writeTime; writeControl writeTime; diff --git a/etc/caseDicts/postProcessing/fields/writeCellCentres b/etc/caseDicts/postProcessing/fields/writeCellCentres index dd164ba147d10ee16ef3a1ee06f4e77c2ef57e85..241da057e7f6fbf142bc856dd1c57d24aae2902a 100644 --- a/etc/caseDicts/postProcessing/fields/writeCellCentres +++ b/etc/caseDicts/postProcessing/fields/writeCellCentres @@ -13,7 +13,7 @@ Description \*---------------------------------------------------------------------------*/ type writeCellCentres; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); executeControl writeTime; writeControl writeTime; diff --git a/etc/caseDicts/postProcessing/fields/writeCellVolumes b/etc/caseDicts/postProcessing/fields/writeCellVolumes index 060757869de476f6b05cfde01e2dfb76eb983dbf..b6cc0cbbe442b2005e2bdc47405207a711c1c2f4 100644 --- a/etc/caseDicts/postProcessing/fields/writeCellVolumes +++ b/etc/caseDicts/postProcessing/fields/writeCellVolumes @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type writeCellVolumes; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); executeControl writeTime; writeControl writeTime; diff --git a/etc/caseDicts/postProcessing/fields/writeObjects b/etc/caseDicts/postProcessing/fields/writeObjects index e1da3e863af7b3342596ec09cc6f3a267d898a50..9ea6cdd4518ab2f5e92030128ae505ba465d368b 100644 --- a/etc/caseDicts/postProcessing/fields/writeObjects +++ b/etc/caseDicts/postProcessing/fields/writeObjects @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type writeObjects; -libs ("libutilityFunctionObjects.so"); +libs (utilityFunctionObjects); objects (<object names>); diff --git a/etc/caseDicts/postProcessing/fields/yPlus b/etc/caseDicts/postProcessing/fields/yPlus index 76b394d6b3306c5f42a334ad111f810c9230655f..9024836e9457f013aac7551ae5d792fb15b5ffef 100644 --- a/etc/caseDicts/postProcessing/fields/yPlus +++ b/etc/caseDicts/postProcessing/fields/yPlus @@ -11,7 +11,7 @@ Description \*---------------------------------------------------------------------------*/ type yPlus; -libs ("libfieldFunctionObjects.so"); +libs (fieldFunctionObjects); executeControl writeTime; writeControl writeTime; diff --git a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C index 40f456e632daa99989e07e9ff2a9d6f2b0c8df2e..e6cb9ceb6cabd4aa7267c5a3d98332bf7a64540a 100644 --- a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C +++ b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C @@ -52,28 +52,23 @@ Foam::functionObjects::FUNCTIONOBJECT::FUNCTIONOBJECT ) : fvMeshFunctionObject(name, runTime, dict), + boolData_(dict.getOrDefault<bool>("boolData"), true), + labelData_(dict.get<label>("labelData")), wordData_(dict.getOrDefault<word>("wordData", "defaultWord")), - scalarData_(dict.get<scalar>("scalarData")), - labelData_(dict.get<label>("labelData")) + scalarData_(dict.getOrDefault<scalar>("scalarData", 1.0)) { read(dict); } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::FUNCTIONOBJECT::~FUNCTIONOBJECT() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::FUNCTIONOBJECT::read(const dictionary& dict) { + dict.readEntry("boolData", boolData_); + dict.readEntry("labelData", labelData_); dict.readIfPresent("wordData", wordData_); - dict.readEntry("scalarData", scalarData_); - dict.readEntry("labelData", labelData_); return true; } diff --git a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H index b4bb82b67dda2e95396b325c25f560a5c76e7f81..ca4e55a94c0da34e4d5e4290e601a9d3dcc96b4a 100644 --- a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H +++ b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) YEAR YEAR AUTHOR,AFFILIATION + Copyright (C) YEAR AUTHOR, AFFILIATION ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,34 +27,120 @@ Class Foam::functionObjects::FUNCTIONOBJECT Group + grpFieldFunctionObjects Description - This function object... + <minimal description of the function object> - Example of function object specification: + <equation> + \f[ + x = x_{ref}^x + \rho \omega + \f] + + <variable-explanation table> + where + \vartable + \rho | <explanation> [units, e.g. kg/m3] + \omega | \f$ \nabla \cdot \vec U \f$ + ... | ... + \endvartable + + <inline equation> + where \f$ x_k \f$ is ... + + <input-output table> + \table + Operand | Type | Location + input | {vol,surface}\<Type\>Field(s) <!-- + --> |$FOAM_CASE/\<time\>/\<inpField\>s + output file | dat <!-- + --> | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: \verbatim FUNCTIONOBJECT1 { + // Mandatory entries (unmodifiable) type FUNCTIONOBJECT; - libs ("libFUNCTIONOBJECTFunctionObject.so"); + libs (FUNCTIONOBJECTFunctionObject); + + // Mandatory entries (runtime modifiable) + ... + + // Mandatory (inherited) entries (unmodifiable) + ... + + // Mandatory (inherited) entries (runtime unmodifiable) + ... + + // Optional entries (unmodifiable) + ... + + // Optional entries (runtime modifiable) + boolData <bool>; + labelData <label>; + wordData <word>; + scalarData <scalar>; + + // Optional (inherited) entries ... - wordData someWord; - scalarData 1.0; - labelData 1; } \endverbatim -Usage + where the entries mean: \table - Property | Description | Required | Default value - type | type name: FUNCTIONOBJECT | yes | - wordData | some word option... | no | defaultWord - scalarData | some scalar value... | yes | - labelData | some label value... | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: FUNCTIONOBJECT | word | yes | - + libs | Library name: FUNCTIONOBJECTFunctionObject <!-- + --> | word | yes | - + boolData | <explanation> | bool | yes | - + labelData | <explanation> | label | yes | - + wordData | <explanation> | word | yes | - + scalarData | <explanation> | scalar | no | 1.0 + wordListData | <explanation> | wordList | yes | - \endtable + Options for the \c ENTRY entry: + \verbatim + <option1> + <option2> | <explanation> + ... + \endverbatim + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + - \link fieldsExpression.H \endlink + - \link writeFile.H \endlink + ... + + <if \c postProcess is applicable> + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func FUNCTIONOBJECT + \endverbatim + + <if \c postProcess is not applicable> + Usage by the \c postProcess utility is not available. + +Note + - <note1> + - <note2> + ... + +See also + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::FUNCTIONOBJECT + ... + SourceFiles FUNCTIONOBJECT.C + FUNCTIONOBJECTTEMPLATES.C + ... \*---------------------------------------------------------------------------*/ @@ -78,26 +164,19 @@ class FUNCTIONOBJECT : public fvMeshFunctionObject { - // Private data - - //- word - word wordData_; + // Private Data - //- scalar - scalar scalarData_; + //- bool + bool boolData_; //- label label labelData_; + //- word + word wordData_; - // Private Member Functions - - - //- No copy construct - FUNCTIONOBJECT(const FUNCTIONOBJECT&); - - //- No copy assignment - void operator=(const FUNCTIONOBJECT&); + //- scalar + scalar scalarData_; public: @@ -116,9 +195,15 @@ public: const dictionary& dict ); + //- No copy construct + FUNCTIONOBJECT(const FUNCTIONOBJECT&) = delete; + + //- No copy assignment + void operator=(const FUNCTIONOBJECT&) = delete; + //- Destructor - virtual ~FUNCTIONOBJECT(); + virtual ~FUNCTIONOBJECT() = default; // Member Functions diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H index a6979cda63ff269b04830eb14d3fa51af40bccd0..852ff5ac7acadb17aafba1da4c0231486361764c 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H @@ -28,52 +28,88 @@ Namespace Foam::functionObjects Description - Namespace for functionObjects. - - OpenFOAM includes a collection of functionObjects selected by the user at - run-time to manipulate the simulation and provide mechanisms to extract - field and derived quantities. Alternatively, the same actions can be - executed after the simulation using the \c -postProcess command-line option. + Function objects are OpenFOAM utilities to ease workflow configurations and + enhance workflows by producing additional user-requested data both during + runtime and postprocessing calculations, typically in the form of + additional logging to the screen, or generating text, image and field files. + + Function objects eliminate the need to store all runtime generated data, + hence saving considerable resources. Furthermore, function objects are + readily applied to batch-driven processes, improving reliability by + standardising the sequence of operations and reducing the amount of manual + interaction. + + In addition, the output of most function objects, e.g. output fields, are + stored on the mesh database so that it can be retrieved and used for other + applications (e.g. directly using \c wallShearStress function object output + in \c fieldAverage function object to produce \c wallShearStressMean field). \section secFunctionObjects Using function objects - FunctionObjects are selected by additional entries in the global case - system/controlDict dictionary. Each object is listed in the \c - functions sub-dictionary, e.g. to select the \c functionObjectType - functionObject the following entry would be specified: + Function objects can be executed by using two methods: + + - \c functions sub-dictionary in the \c system/controlDict file + - \c postProcess command-line utility + + For the first method, each selected function object should be listed inside + \c functions sub-dictionary of the \c system/controlDict file as a nested + sub-dictionary, typically as in the following example: \verbatim - functions + functions // sub-dictionary name under the system/controlDict file { - <functionObjectName> + <userDefinedSubDictName1> { - type functionObjectType; - libs (myFunctionObjectLib); - region defaultRegion; - enabled yes; + // Mandatory entries + type <functionObjectTypeName>; + libs (<libType>FunctionObjects); + + // Mandatory entries defined in <functionObjectType> + ... + + // Optional entries defined in <functionObjectType> + ... + + // Optional (inherited) entries + region region0; + enabled true; + log true; timeStart 0; - timeEnd 10; - writeControl writeTime; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl timeStep; writeInterval 1; + } + + <userDefinedSubDictName2> + { + ... + } + + ... + + <userDefinedSubDictNameN> + { ... } } \endverbatim - Where: + where the entries mean: \table - Property | Description | Required | Default - type | Type of function object | yes | - libs | Libraries containing implementation | yes | - region | Name of region for multi-region cases | no | - enabled | On/off switch | no | yes - log | Log information to standard output | no | yes - timeStart| Start time | no | - timeEnd | End time | no | - executeControl | See time controls below | no | timeStep - executeInterval | Steps/time between execute phases | no | 1 - writeControl | See time controls below | no | timeStep - writeInterval | Steps/time between write phases | no | 1 + Property | Description | Type | Req'd | Dflt + type | Type name of function object | word | yes | - + libs | Library name containing implementation | word | yes | - + region | Name of region for multi-region cases | word | no | region0 + enabled | Switch to turn function object on/off | bool | no | true + log | Switch to write log info to standard output | bool | no | true + timeStart | Start time for function object execution | scalar | no | 0 + timeEnd | End time for function object execution | scalar | no | inf + executeControl | See time controls below | word | no | timeStep + executeInterval | Steps/time between execute phases | label | no | 1 + writeControl | See time controls below | word | no | timeStep + writeInterval | Steps/time between write phases | label | no | 1 \endtable Time controls: @@ -86,15 +122,17 @@ Description adjustableRunTime | Currently identical to "runTime" clockTime | Trigger every 'Interval' clock time period cpuTime | Trigger every 'Interval' CPU time period - onEnd | Trigger on end of run + onEnd | Trigger on end of simulation run \endtable - The sub-dictionary name \c \<functionObjectName\> is chosen by the user, and - is typically used as the name of the output directory for any data written - by the functionObject. The \c type entry defines the type of function - object properties that follow. FunctionObjects are packaged into separate - libraries and the \c libs entry is used to specify which library should be - loaded. + The sub-dictionary name \c <userDefinedSubDictName> is chosen by the user, + and is typically used as the name of the output directory for any data + written by the function object. + + As the base mandatory entries, the \c type entry defines the type of + function object properties that follow. Function objects are packaged into + separate libraries for flexibility and the \c libs entry is used to specify + which library should be loaded. Each function object has two separate run phases: @@ -104,6 +142,36 @@ Description For each phase the respective time controls are provided, as listed above. + + The second method of executing function objects is to use \c postProcess + utility. + + When specified without additional arguments, the \c postProcess utility + executes all function objects defined in the \c system/controlDict file + for all time directories: + + \verbatim + postProcess + \endverbatim + + Most function objects can be invoked directly without the need to specify + the input dictionary using the \c -func option, e.g. to execute the Courant + number function object: + + \verbatim + postProcess -func CourantNo + \endverbatim + + In addition, the \c -postProcess option is available to all solvers, + and operates similarly to the stand-alone \c postProcess utility. + For example, having completed a \c simpleFoam calculation, the following + will execute all function objects defined in the \c system/controlDict file + for all time directories: + + \verbatim + simpleFoam -postProcess + \endverbatim + Class Foam::functionObject @@ -111,8 +179,8 @@ Description Abstract base-class for Time/database function objects. See also - Foam::functionObjectList - Foam::functionObjects::timeControl + - Foam::functionObjectList + - Foam::functionObjects::timeControl SourceFiles functionObject.C @@ -142,7 +210,7 @@ class mapPolyMesh; class functionObject { - // Private data + // Private Data //- Name const word name_; @@ -164,6 +232,7 @@ public: //- Runtime type information virtual const word& type() const = 0; + //- Flag to execute debug content static int debug; //- Global post-processing mode switch @@ -172,7 +241,7 @@ public: //- Directory prefix static word outputPrefix; - //- Switch write log to Info + //- Flag to write log into Info bool log; diff --git a/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObject.H b/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObject.H index bb1062c93dbddb531df80b9a555fa77b589d479f..d9fed7b56b2929aa8dc2d7351c7324577dfa5aad 100644 --- a/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/regionFunctionObject/regionFunctionObject.H @@ -37,9 +37,9 @@ Description Dictionary controls \table - Property | Description | Required | Default - region | Name of the mesh region | no | region0 - subRegion | Name for alternative objectRegistry | no | "" + Property | Description | Type | Req'd | Dflt + region | Name of the mesh region | word | no | region0 + subRegion | Name for alternative objectRegistry | word | no | "" \endtable See also diff --git a/src/OpenFOAM/db/functionObjects/stateFunctionObject/stateFunctionObject.H b/src/OpenFOAM/db/functionObjects/stateFunctionObject/stateFunctionObject.H index 94d9b343ff164018075a17baa7ea9f2fd80399b3..bd8de02e32cbcb39cef69bba3a89d28333879937 100644 --- a/src/OpenFOAM/db/functionObjects/stateFunctionObject/stateFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/stateFunctionObject/stateFunctionObject.H @@ -34,7 +34,7 @@ Description Note: cannot access the state dictionary until after construction of the function objects, since the owner container functionObjectList is owned - by time, and time owns the state dictionary. I.e. need to wait for time + by time, and time owns the state dictionary i.e. need to wait for time to be fully constructed. See also diff --git a/src/OpenFOAM/db/functionObjects/writeFile/writeFile.C b/src/OpenFOAM/db/functionObjects/writeFile/writeFile.C index f749f472ba61d4a3b586f17f44a806a4bf63fc1e..6b88808921ad5767ba16ef6904899eeda3d0d567 100644 --- a/src/OpenFOAM/db/functionObjects/writeFile/writeFile.C +++ b/src/OpenFOAM/db/functionObjects/writeFile/writeFile.C @@ -214,7 +214,12 @@ Foam::functionObjects::writeFile::writeFile bool Foam::functionObjects::writeFile::read(const dictionary& dict) { writePrecision_ = - dict.getOrDefault("writePrecision", IOstream::defaultPrecision()); + dict.getCheckOrDefault + ( + "writePrecision", + IOstream::defaultPrecision(), + labelMinMax::ge(0) + ); updateHeader_ = dict.lookupOrDefault("updateHeader", updateHeader_); diff --git a/src/OpenFOAM/db/functionObjects/writeFile/writeFile.H b/src/OpenFOAM/db/functionObjects/writeFile/writeFile.H index d5c673c6efbca586423d3578b4d9cf971316650a..6a5f5f3a8842e74cafb50ce76709fc19b52d3988 100644 --- a/src/OpenFOAM/db/functionObjects/writeFile/writeFile.H +++ b/src/OpenFOAM/db/functionObjects/writeFile/writeFile.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,11 +28,34 @@ Class Foam::functionObjects::writeFile Description - functionObject base class for writing single files + Base class for writing single files from the function objects. + +Usage + + \verbatim + <userDefinedSubDictName1> + { + // Mandatory and other optional entries + ... + + // Optional (inherited) entries (runtime modifiable) + writePrecision 8; + writeToFile true; + useUserTime true; + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + writePrecision | Number of decimal points | label | no | \<system dflt\> + writeToFile | Flag to produce text file output | bool | no | true + useUserTime | Flag to use user time, e.g. degrees | bool | no | true + \endtable See also - Foam::functionObject - Foam::functionObjects::logFiles + - Foam::functionObject + - Foam::functionObjects::logFiles SourceFiles writeFile.C diff --git a/src/functionObjects/field/AMIWeights/AMIWeights.C b/src/functionObjects/field/AMIWeights/AMIWeights.C index e61e1899a5f01d9a26b6ce71870dc8647af654a8..8ff16fa42cb3ae00444b3efc26af4ffc9ffe6f10 100644 --- a/src/functionObjects/field/AMIWeights/AMIWeights.C +++ b/src/functionObjects/field/AMIWeights/AMIWeights.C @@ -370,7 +370,6 @@ bool Foam::functionObjects::AMIWeights::write() } } - return true; } diff --git a/src/functionObjects/field/AMIWeights/AMIWeights.H b/src/functionObjects/field/AMIWeights/AMIWeights.H index 6d2067930a5d8e48181959fe619f51200a9f3445..b4cf42698e3984f7871f220dfc19543af91fe673 100644 --- a/src/functionObjects/field/AMIWeights/AMIWeights.H +++ b/src/functionObjects/field/AMIWeights/AMIWeights.H @@ -30,33 +30,60 @@ Group grpFieldFunctionObjects Description - Reports the min/max/average AMI weights to text file and optionally - writes VTK surfaces of the sum of the weights, and mask field for - ACMI patches. + Computes the min/max/average weights of arbitrary mesh interface (AMI) + patches, and optionally reports to a text file or writes VTK surfaces of + the sum of the weights and mask fields for arbitrarily coupled mesh + interface (ACMI) patches. + + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $POST/\<file\> + output field | vtp | $POST/\<AMINames\>_{src,tgt}.vtp + \endtable + + where \c $POST=$FOAM_CASE/postProcessing/\<FO\>/\<time\>. Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim AMIWeights1 { + // Mandatory entries (unmodifiable) type AMIWeights; libs (fieldFunctionObjects); - writeFields yes; + + // Mandatory entries (runtime modifiable) + writeFields false; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: AMIWeights | yes | - writeFields | write weights as VTK fields | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: AMIWeights | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + writeFields | Write weights as VTK fields | bool | yes | - \endtable - Output data is written to the file \<timeDir\>/AMIWeights.dat + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func AMIWeights + \endverbatim See also - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::AMIWeights SourceFiles AMIWeights.C @@ -89,7 +116,7 @@ class AMIWeights { protected: - // Protected data + // Protected Data //- Flag to write AMI fields (as VTK files) bool writeFields_; @@ -106,6 +133,7 @@ protected: //- Helper function to report patch information virtual void reportPatch(const cyclicAMIPolyPatch& pp); + //- Write weight field void writeWeightField ( const cyclicAMIPolyPatch& cpp, @@ -113,14 +141,9 @@ protected: const word& side ) const; + //- Write weight fields if writeFields=true void writeWeightFields(const cyclicAMIPolyPatch& cpp) const; - //- No copy construct - AMIWeights(const AMIWeights&) = delete; - - //- No copy assignment - void operator=(const AMIWeights&) = delete; - public: @@ -138,6 +161,12 @@ public: const dictionary& dict ); + //- No copy construct + AMIWeights(const AMIWeights&) = delete; + + //- No copy assignment + void operator=(const AMIWeights&) = delete; + //- Destructor virtual ~AMIWeights() = default; diff --git a/src/functionObjects/field/CourantNo/CourantNo.C b/src/functionObjects/field/CourantNo/CourantNo.C index fcdd6d16f93811009b112ecee0796413594d42bf..04da791febbd77d3b072224bd3b006df10941e56 100644 --- a/src/functionObjects/field/CourantNo/CourantNo.C +++ b/src/functionObjects/field/CourantNo/CourantNo.C @@ -39,13 +39,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(CourantNo, 0); - - addToRunTimeSelectionTable - ( - functionObject, - CourantNo, - dictionary - ); + addToRunTimeSelectionTable(functionObject, CourantNo, dictionary); } } @@ -137,12 +131,6 @@ Foam::functionObjects::CourantNo::CourantNo } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::CourantNo::~CourantNo() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::CourantNo::read(const dictionary& dict) diff --git a/src/functionObjects/field/CourantNo/CourantNo.H b/src/functionObjects/field/CourantNo/CourantNo.H index c7e644a3e9d637c7423c5c6fb480c755d556f4be..a06f27e57fba886f9dd967640e191313e32e087a 100644 --- a/src/functionObjects/field/CourantNo/CourantNo.H +++ b/src/functionObjects/field/CourantNo/CourantNo.H @@ -31,34 +31,55 @@ Group grpFieldFunctionObjects Description - This function object calculates and outputs the Courant number as a - volScalarField. The field is stored on the mesh database so that it can - be retrieved and used for other applications. + Computes the Courant number field for time-variant simulations. + + Operands: + \table + Operand | Type | Location + input | - | - + output file | - | - + output field | volScalarField | $FOAM_CASE/<time>/<outField> + \endtable Usage - Example of function object specification to calculate the Courant number: + Minimal example by using \c system/controlDict.functions: \verbatim CourantNo1 { + // Mandatory entries (unmodifiable) type CourantNo; libs (fieldFunctionObjects); + + // Optional entries (runtime modifiable) + rho rho; + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: CourantNo | yes | - rho | Name of density field | no | rho - field | Name of flux field | no | phi - result | Name of Courant number field | no | \<function name\> - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: CourantNo | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + rho | Name of density field | word | no | rho \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func CourantNo + \endverbatim + See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fieldExpression + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::CourantNo SourceFiles CourantNo.C @@ -86,9 +107,9 @@ class CourantNo : public fieldExpression { - // Private data + // Private Data - //- Name of density field (optional) + //- Name of density field word rhoName_; @@ -120,9 +141,15 @@ public: const dictionary& dict ); + //- No copy construct + CourantNo(const CourantNo&) = delete; + + //- No copy assignment + void operator=(const CourantNo&) = delete; + //- Destructor - virtual ~CourantNo(); + virtual ~CourantNo() = default; // Member Functions diff --git a/src/functionObjects/field/Curle/Curle.C b/src/functionObjects/field/Curle/Curle.C index bec580e608242750324053dd265d8c402eb98d96..d3a16edbb5e6a2cc10f28d3c523319947397bb19 100644 --- a/src/functionObjects/field/Curle/Curle.C +++ b/src/functionObjects/field/Curle/Curle.C @@ -39,13 +39,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(Curle, 0); - - addToRunTimeSelectionTable - ( - functionObject, - Curle, - dictionary - ); + addToRunTimeSelectionTable(functionObject, Curle, dictionary); } } @@ -146,6 +140,13 @@ bool Foam::functionObjects::Curle::read(const dictionary& dict) // Read the reference speed of sound dict.readEntry("c0", c0_); + if (c0_.value() < VSMALL) + { + FatalErrorInFunction + << "Reference speed of sound = " << c0_ + << " cannot be negative or zero." + << abort(FatalError); + } // Set the location of the effective point source to the area-average // of the patch face centres diff --git a/src/functionObjects/field/Curle/Curle.H b/src/functionObjects/field/Curle/Curle.H index ba58799a723bde214f3328b955d2b31d38390af0..92b2451ae083492e3c5ed4706adde51cf0641d1a 100644 --- a/src/functionObjects/field/Curle/Curle.H +++ b/src/functionObjects/field/Curle/Curle.H @@ -30,54 +30,71 @@ Group grpFieldFunctionObjects Description - Calculates the acoustic pressure based on Curle's analogy. + Computes the acoustic pressure based on Curle's analogy. Curle's analogy is implemented as: \f[ - p' = \frac{1}{4 \pi c_0}\frac{\vec d}{|\vec d|^2}\frac{d(F)}{d(t)} + p' = \frac{1}{4 \pi c_0}\frac{\vec d}{|\vec d|^2}\cdot\frac{d\vec F}{dt} \f] - where \vartable - p' | Curle's acoustic pressure [Pa] or [Pa (m3/rho)] - c_0 | Reference speed of sound [m/s] - \vec d | Distance vector to observer locations [m] - F | Force [N] or [N (m3/rho)] + p' | Curle's acoustic pressure [Pa] or [Pa \f$(m^3/\rho)\f$] + c_0 | Reference speed of sound [m/s] + \vec d | Distance vector to observer locations [m] + \vec F | Force [N] or [N (\f$m^3/\rho\f$)] \endvartable -Note - Only the normal-pressure force is included in the force calculation + Operands: + \table + Operand | Type | Location + input | volScalarField | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable +Note + Only the normal-pressure force is included in the force calculation. Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim Curle1 { - type Curle; - libs (fieldFunctionObjects); + // Mandatory entries (unmodifiable) + type Curle; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + patches (<patch1> <patch2> ... <patchN>) + c0 343; + + // Optional (inherited) entries ... - patches (surface1 surface2); - c0 330; } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: Curle | yes | - field | Pressure field name | no | p - result | Acoustic pressure field name | no | Curle - patches | Sound generation patch names | yes | - c0 | Reference speed of sound | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: Curle | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + patches | Names of the operand patches | wordList | yes | - + c0 | Reference speed of sound [m/s] | scalar | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Usage by the \c postProcess utility is not available. See also - - Foam::functionObjects::fieldExpression - - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::Curle SourceFiles Curle.C @@ -122,6 +139,7 @@ class Curle protected: +<<<<<<< HEAD // Protected Member Functions //- Calculate acoustic pressure field and return true if successful @@ -133,6 +151,11 @@ protected: //- No copy assignment void operator=(const Curle&) = delete; +======= + //- Calculate the acoustic pressure field and return true if successful + virtual bool calc(); + +>>>>>>> DOC: elaborate the usage of function objects public: @@ -150,6 +173,12 @@ public: const dictionary& dict ); + //- No copy construct + Curle(const Curle&) = delete; + + //- No copy assignment + void operator=(const Curle&) = delete; + //- Destructor virtual ~Curle() = default; diff --git a/src/functionObjects/field/DESModelRegions/DESModelRegions.C b/src/functionObjects/field/DESModelRegions/DESModelRegions.C index 4612dea461614cd812be4ec841dd87cba31decd3..965bc86970a067a61c1f8463b0d78f121cf95b10 100644 --- a/src/functionObjects/field/DESModelRegions/DESModelRegions.C +++ b/src/functionObjects/field/DESModelRegions/DESModelRegions.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2015 OpenFOAM Foundation - Copyright (C) 2015-2016 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,13 +39,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(DESModelRegions, 0); - - addToRunTimeSelectionTable - ( - functionObject, - DESModelRegions, - dictionary - ); + addToRunTimeSelectionTable(functionObject, DESModelRegions, dictionary); } } @@ -59,7 +53,7 @@ void Foam::functionObjects::DESModelRegions::writeFileHeader(Ostream& os) const writeCommented(os, "Time"); writeTabbed(os, "LES"); writeTabbed(os, "RAS"); - os << endl; + os << endl; } @@ -98,12 +92,6 @@ Foam::functionObjects::DESModelRegions::DESModelRegions } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::DESModelRegions::~DESModelRegions() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::DESModelRegions::read(const dictionary& dict) @@ -135,7 +123,7 @@ bool Foam::functionObjects::DESModelRegions::execute() DESModelRegions == model.LESRegion(); - scalar prc = + const scalar prc = gSum(DESModelRegions.primitiveField()*mesh_.V()) /gSum(mesh_.V())*100.0; diff --git a/src/functionObjects/field/DESModelRegions/DESModelRegions.H b/src/functionObjects/field/DESModelRegions/DESModelRegions.H index e2e09a112a5c93482001f06e180d6a61d09f51be..992939db47e04443395a869e66208c233723dc59 100644 --- a/src/functionObjects/field/DESModelRegions/DESModelRegions.H +++ b/src/functionObjects/field/DESModelRegions/DESModelRegions.H @@ -31,33 +31,62 @@ Group grpFieldFunctionObjects Description - This function object writes out an indicator field for DES turbulence - calculations, that is: - - 0 for RAS regions - - 1 for LES regions + Computes an indicator field for detached eddy simulation (DES) turbulence + calculations, where the values of the indicator mean: - The field is stored on the mesh database so that it can be retrieved and - used for other applications. + \verbatim + 0 = Reynolds-averaged Navier-Stokes (RAS) regions + 1 = Large eddy simulation (LES) regions + \endverbatim + + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable Usage - Example of function object specification to generate DES indicator field: + Minimal example by using \c system/controlDict.functions: \verbatim DESModelRegions1 { + // Mandatory entries (unmodifiable) type DESModelRegions; libs (fieldFunctionObjects); + + // Optional entries (runtime modifiable) + result DESField; + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: DESModelRegions| yes | - resultName | Name of DES indicator field | no | \<function name\> - log | log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: DESModelRegions | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + result | Name of DES indicator field | word | no | <FO> \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. + +Note + \c DESModelRegions function object can only be executed for DES simulations. + +See also + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::DESModelRegions + SourceFiles DESModelRegions.C @@ -89,9 +118,9 @@ class DESModelRegions { protected: - // Protected data + // Protected Data - //- Result name + //- Name of DES indicator field word resultName_; @@ -100,12 +129,6 @@ protected: //- File header information virtual void writeFileHeader(Ostream& os) const; - //- No copy construct - DESModelRegions(const DESModelRegions&) = delete; - - //- No copy assignment - void operator=(const DESModelRegions&) = delete; - public: @@ -114,6 +137,7 @@ public: // Constructors + //- Construct from Time and dictionary DESModelRegions ( @@ -122,9 +146,15 @@ public: const dictionary& dict ); + //- No copy construct + DESModelRegions(const DESModelRegions&) = delete; + + //- No copy assignment + void operator=(const DESModelRegions&) = delete; + //- Destructor - virtual ~DESModelRegions(); + virtual ~DESModelRegions() = default; // Member Functions diff --git a/src/functionObjects/field/lambVector/lambVector.C b/src/functionObjects/field/LambVector/LambVector.C similarity index 87% rename from src/functionObjects/field/lambVector/lambVector.C rename to src/functionObjects/field/LambVector/LambVector.C index 27fe937df43ce9e4b46669bb6bc64fd0745f47dd..d847ae1511d1dc6f14167dd998595df1e9744054 100644 --- a/src/functionObjects/field/lambVector/lambVector.C +++ b/src/functionObjects/field/LambVector/LambVector.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ -#include "lambVector.H" +#include "LambVector.H" #include "fvcCurl.H" #include "fvcDiv.H" #include "addToRunTimeSelectionTable.H" @@ -36,14 +36,14 @@ namespace Foam { namespace functionObjects { - defineTypeNameAndDebug(lambVector, 0); - addToRunTimeSelectionTable(functionObject, lambVector, dictionary); + defineTypeNameAndDebug(LambVector, 0); + addToRunTimeSelectionTable(functionObject, LambVector, dictionary); } } // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -bool Foam::functionObjects::lambVector::calc() +bool Foam::functionObjects::LambVector::calc() { if (foundObject<volVectorField>(fieldName_)) { @@ -57,7 +57,7 @@ bool Foam::functionObjects::lambVector::calc() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::functionObjects::lambVector::lambVector +Foam::functionObjects::LambVector::LambVector ( const word& name, const Time& runTime, @@ -66,7 +66,8 @@ Foam::functionObjects::lambVector::lambVector : fieldExpression(name, runTime, dict, "U") { - setResultName(typeName, fieldName_); + setResultName(typeName, "U"); } + // ************************************************************************* // diff --git a/src/functionObjects/field/lambVector/lambVector.H b/src/functionObjects/field/LambVector/LambVector.H similarity index 50% rename from src/functionObjects/field/lambVector/lambVector.H rename to src/functionObjects/field/LambVector/LambVector.H index bf8e2622351e166c289aab4a60d4eeeb68f59c7e..f0ff8ad93bc0e09a1078f7b4bf9fa87d8787f235 100644 --- a/src/functionObjects/field/lambVector/lambVector.H +++ b/src/functionObjects/field/LambVector/LambVector.H @@ -24,47 +24,79 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::functionObjects::lambVector + Foam::functionObjects::LambVector Group grpFieldFunctionObjects Description - Calculates Lamb vector, i.e. the cross product of vorticity and velocity. + Computes Lamb vector, i.e. the cross product of vorticity and velocity. Calculation of the divergence of the Lamb vector can be performed by using - 'div' functionObject on this 'lambVector' functionObject. + \c div function object on this \c LambVector function object. - The field is stored on the mesh database so that it can be retrieved - and used for other applications. + The motivation of the function object is the literature-reported + quantitative connection between the Lamb vector (divergence) and + the spatially localised instantaneous fluid motions, e.g. high- and + low-momentum fluid parcels, which possess considerable level of capacity + to affect the rate of change of momentum, and to generate forces such as + drag. + + Operands: + \table + Operand | Type | Location + input | volVectorField | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | volVectorField | $FOAM_CASE/\<time\>/\<outField\> + \endtable Usage + Minimal example by using \c system/controlDict.functions: \verbatim - lambVector1 + LambVector1 { - type lambVector; - libs (fieldFunctionObjects); - field UMean; - ... Base options of fieldExpression ... + // Mandatory entries (unmodifiable) + type LambVector; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: lambVector | yes | - field | Name of volVectorField | no | U + Property | Description | Type | Req'd | Dflt + type | Type name: LambVector | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func LambVector + \endverbatim + +Note + To execute \c LambVector function object on an input <field>, a numerical + scheme should be defined for \c div(LambVector) in + \c system/fvSchemes.divSchemes. + See also - Foam::functionObjects::fieldExpression + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::LambVector SourceFiles - lambVector.C + LambVector.C \*---------------------------------------------------------------------------*/ -#ifndef functionObjects_lambVector_H -#define functionObjects_lambVector_H +#ifndef functionObjects_LambVector_H +#define functionObjects_LambVector_H #include "fieldExpression.H" @@ -76,38 +108,44 @@ namespace functionObjects { /*---------------------------------------------------------------------------*\ - Class lambVector Declaration + Class LambVector Declaration \*---------------------------------------------------------------------------*/ -class lambVector +class LambVector : public fieldExpression { // Private Member Functions - //- Calculate the lambVector field and return true if successful + //- Calculate the LambVector field and return true if successful virtual bool calc(); public: //- Runtime type information - TypeName("lambVector"); + TypeName("LambVector"); // Constructors //- Construct from Time and dictionary - lambVector + LambVector ( const word& name, const Time& runTime, const dictionary& dict ); + //- No copy construct + LambVector(const LambVector&) = delete; + + //- No copy assignment + void operator=(const LambVector&) = delete; + //- Destructor - virtual ~lambVector() = default; + virtual ~LambVector() = default; }; diff --git a/src/functionObjects/field/Lambda2/Lambda2.C b/src/functionObjects/field/Lambda2/Lambda2.C index c1aa6ec28fc10b418d5443847ddb826f812c4d88..f527212162f479053c3d0cb0531840dcc302f97d 100644 --- a/src/functionObjects/field/Lambda2/Lambda2.C +++ b/src/functionObjects/field/Lambda2/Lambda2.C @@ -37,13 +37,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(Lambda2, 0); - - addToRunTimeSelectionTable - ( - functionObject, - Lambda2, - dictionary - ); + addToRunTimeSelectionTable(functionObject, Lambda2, dictionary); } } @@ -93,10 +87,4 @@ Foam::functionObjects::Lambda2::Lambda2 } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::Lambda2::~Lambda2() -{} - - // ************************************************************************* // diff --git a/src/functionObjects/field/Lambda2/Lambda2.H b/src/functionObjects/field/Lambda2/Lambda2.H index 437fb633f8bdc539c870a180668d0bffff493f1a..65ee40d9f1b8fa64244399a38b58ac149ae8ff65 100644 --- a/src/functionObjects/field/Lambda2/Lambda2.H +++ b/src/functionObjects/field/Lambda2/Lambda2.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,13 +31,52 @@ Group grpFieldFunctionObjects Description - Calculates and outputs the second largest eigenvalue of the sum of the - square of the symmetrical and anti-symmetrical parts of the velocity - gradient tensor. + Computes the second largest eigenvalue of the sum of the square of + the symmetrical and anti-symmetrical parts of the velocity gradient tensor. + + Operands: + \table + Operand | Type | Location + input | volVectorField | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + Lambda21 + { + // Mandatory entries (unmodifiable) + type Lambda2; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: Lambda2 | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func Lambda2 + \endverbatim See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::Lambda2 SourceFiles Lambda2.C @@ -85,9 +125,15 @@ public: const dictionary& dict ); + //- No copy construct + Lambda2(const Lambda2&) = delete; + + //- No copy assignment + void operator=(const Lambda2&) = delete; + //- Destructor - virtual ~Lambda2(); + virtual ~Lambda2() = default; }; diff --git a/src/functionObjects/field/MachNo/MachNo.C b/src/functionObjects/field/MachNo/MachNo.C index dae3d17be155750dd2cd40aa8741727c6ccbc60e..c9f891a892fc94268153e8fc079bea102b170696 100644 --- a/src/functionObjects/field/MachNo/MachNo.C +++ b/src/functionObjects/field/MachNo/MachNo.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,13 +37,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(MachNo, 0); - - addToRunTimeSelectionTable - ( - functionObject, - MachNo, - dictionary - ); + addToRunTimeSelectionTable(functionObject, MachNo, dictionary); } } @@ -89,10 +83,4 @@ Foam::functionObjects::MachNo::MachNo } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::MachNo::~MachNo() -{} - - // ************************************************************************* // diff --git a/src/functionObjects/field/MachNo/MachNo.H b/src/functionObjects/field/MachNo/MachNo.H index b57b0b6fb31c9877d7f4435f30f4393725332ebb..e28a0486bc6b5e33c4838dd2e67c5ff669df18d3 100644 --- a/src/functionObjects/field/MachNo/MachNo.H +++ b/src/functionObjects/field/MachNo/MachNo.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,11 +31,51 @@ Group grpFieldFunctionObjects Description - Calculates and writes the Mach number as a volScalarField. + Computes the Mach number as a \c volScalarField. + + Operands: + \table + Operand | Type | Location + input | volVectorField | $FOAM_CASE/<time>/<inpField> + output file | - | - + output field | volScalarField | $FOAM_CASE/<time>/<outField> + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + MachNo1 + { + // Mandatory entries (unmodifiable) + type MachNo; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: MachNo | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func MachNo + \endverbatim See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::MachNo SourceFiles MachNo.C @@ -84,9 +125,15 @@ public: const dictionary& dict ); + //- No copy construct + MachNo(const MachNo&) = delete; + + //- No copy assignment + void operator=(const MachNo&) = delete; + //- Destructor - virtual ~MachNo(); + virtual ~MachNo() = default; }; diff --git a/src/functionObjects/field/Make/files b/src/functionObjects/field/Make/files index 580d9a33406d9492e22ae0686db2cd9bcb92ade9..acf12cb0a4b5c5d9719ad4a554ca7f302eb78884 100644 --- a/src/functionObjects/field/Make/files +++ b/src/functionObjects/field/Make/files @@ -65,7 +65,7 @@ ddt/ddt.C mag/mag.C magSqr/magSqr.C vorticity/vorticity.C -lambVector/lambVector.C +LambVector/LambVector.C enstrophy/enstrophy.C Q/Q.C Lambda2/Lambda2.C diff --git a/src/functionObjects/field/PecletNo/PecletNo.C b/src/functionObjects/field/PecletNo/PecletNo.C index 6ce51e4be86f8ac18bee212bf17708ed7b764050..45509542075a5c2f89b7b8cb9eac3cf4bba98354 100644 --- a/src/functionObjects/field/PecletNo/PecletNo.C +++ b/src/functionObjects/field/PecletNo/PecletNo.C @@ -38,13 +38,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(PecletNo, 0); - - addToRunTimeSelectionTable - ( - functionObject, - PecletNo, - dictionary - ); + addToRunTimeSelectionTable(functionObject, PecletNo, dictionary); } } @@ -143,11 +137,6 @@ Foam::functionObjects::PecletNo::PecletNo } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::PecletNo::~PecletNo() -{} - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::PecletNo::read(const dictionary& dict) diff --git a/src/functionObjects/field/PecletNo/PecletNo.H b/src/functionObjects/field/PecletNo/PecletNo.H index 30259f32c2e234b91ad3870c71e71acbd34f7755..83ddaa76fcb9294cf4fe3c732ee5c9d23bb63367 100644 --- a/src/functionObjects/field/PecletNo/PecletNo.H +++ b/src/functionObjects/field/PecletNo/PecletNo.H @@ -31,29 +31,56 @@ Group grpFieldFunctionObjects Description - Calculates and outputs the Peclet number as a surfaceScalarField. + Computes the Peclet number as a \c surfaceScalarField. + + Operands: + \table + Operand | Type | Location + input | surfaceScalarField | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | surfaceScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable Usage - Example of function object specification to calculate the Peclet number: + Minimal example by using \c system/controlDict.functions: \verbatim PecletNo1 { - type PecletNo; - libs (fieldFunctionObjects); + // Mandatory entries (unmodifiable) + type PecletNo; + libs (fieldFunctionObjects); + + // Optional entries (runtime modifiable) + rho rho; + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: Peclet | yes | - phi | Name of flux field | no | phi - rho | Name of density field | no | rho - result | Name of Peclet field | no | \<function name\> - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: PecletNo | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + rho | Name of density field | word | no | rho \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func PecletNo + \endverbatim + +See also + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::PecletNo + SourceFiles PecletNo.C @@ -80,9 +107,9 @@ class PecletNo : public fieldExpression { - // Private data + // Private Data - //- Name of density field, default is "rho" + //- Name of density field word rhoName_; @@ -111,9 +138,15 @@ public: const dictionary& dict ); + //- No copy construct + PecletNo(const PecletNo&) = delete; + + //- No copy assignment + void operator=(const PecletNo&) = delete; + //- Destructor - virtual ~PecletNo(); + virtual ~PecletNo() = default; // Member Functions diff --git a/src/functionObjects/field/Q/Q.C b/src/functionObjects/field/Q/Q.C index d5ee4a9dbaac785642a85362b44aae5d19fd472e..c43c0ce6a42bededbb6875cdfcb88d2b79e9bdea 100644 --- a/src/functionObjects/field/Q/Q.C +++ b/src/functionObjects/field/Q/Q.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,13 +37,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(Q, 0); - - addToRunTimeSelectionTable - ( - functionObject, - Q, - dictionary - ); + addToRunTimeSelectionTable(functionObject, Q, dictionary); } } @@ -84,10 +78,4 @@ Foam::functionObjects::Q::Q } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::Q::~Q() -{} - - // ************************************************************************* // diff --git a/src/functionObjects/field/Q/Q.H b/src/functionObjects/field/Q/Q.H index 57393012c58d6450f6f45d8c97f773ef3af1f97d..379c8e8dad5f1b70dd68f802df2a83c2c8621e6e 100644 --- a/src/functionObjects/field/Q/Q.H +++ b/src/functionObjects/field/Q/Q.H @@ -31,41 +31,63 @@ Group grpFieldFunctionObjects Description - Calculates and outputs the second invariant of the velocity gradient tensor - [1/s^2]. + Computes the second invariant of + the velocity gradient tensor \f$[s^{-2}]\f$. \f[ - Q = 0.5(sqr(tr(\nabla U)) - tr(((\nabla U) \cdot (\nabla U)))) + \vec Q = \frac{1}{2} + [ (tr (\nabla \vec U) )^2 + - tr (\nabla \vec U \cdot \nabla \vec U) ] \f] where \vartable - U | velocity [m/s] + \vec U | velocity [m/s] \endvartable + Operands: + \table + Operand | Type | Location + input | volVectorField | $FOAM_CASE/<time>/<inpField> + output file | - | - + output field | volScalarField | $FOAM_CASE/<time>/<outField> + \endtable + Usage - Example of function object specification to calculate Q: + Minimal example by using \c system/controlDict.functions: \verbatim Q1 { + // Mandatory entries (unmodifiable) type Q; libs (fieldFunctionObjects); + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: Q | yes | - U | Name of velocity field | no | U - result | Name of Q field | no | \<function name\> - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: Q | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func Q + \endverbatim + See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fieldExpression + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::Q SourceFiles Q.C @@ -114,9 +136,15 @@ public: const dictionary& dict ); + //- No copy construct + Q(const Q&) = delete; + + //- No copy assignment + void operator=(const Q&) = delete; + //- Destructor - virtual ~Q(); + virtual ~Q() = default; }; diff --git a/src/functionObjects/field/STDMD/STDMD.H b/src/functionObjects/field/STDMD/STDMD.H index 8133004bafdbccec563877d166f7baa171121816..42d137b97062e718903944ccc7c529191048adb7 100644 --- a/src/functionObjects/field/STDMD/STDMD.H +++ b/src/functionObjects/field/STDMD/STDMD.H @@ -46,57 +46,58 @@ Description References: \verbatim - STDMD and mode-sorting algorithms (tags:K, HRDC, KZ, HWR): - Kiewat, M. (2019). - Streaming modal decomposition approaches for vehicle aerodynamics. - PhD thesis. Munich: Technical University of Munich. - URL:mediatum.ub.tum.de/doc/1482652/1482652.pdf - - Hemati, M. S., Rowley, C. W., Deem, E. A., & Cattafesta, L. N. (2017). - De-biasing the dynamic mode decomposition for applied Koopman - spectral analysis of noisy datasets. - Theoretical and Computational Fluid Dynamics, 31(4), 349-368. - DOI:10.1007/s00162-017-0432-2 - - Kou, J., & Zhang, W. (2017). - An improved criterion to select dominant modes from dynamic mode - decomposition. - European Journal of Mechanics-B/Fluids, 62, 109-129. - DOI:10.1016/j.euromechflu.2016.11.015 - - Hemati, M. S., Williams, M. O., & Rowley, C. W. (2014). - Dynamic mode decomposition for large and streaming datasets. - Physics of Fluids, 26(11), 111701. - DOI:10.1063/1.4901016 - - Parallel classical Gram-Schmidt process (tag:Ka): - Katagiri, T. (2003). - Performance evaluation of parallel Gram-Schmidt re-orthogonalization - methods. - In: Palma J. M. L. M., Sousa A. A., Dongarra J., Hernández V. (eds) - High Performance Computing for Computational Science — VECPAR 2002. - Lecture Notes in Computer Science, vol 2565, p. 302-314. - Berlin, Heidelberg: Springer. - DOI:10.1007/3-540-36569-9_19 - - Parallel direct tall-skinny QR decomposition (tags:BGD, DGHL): - Benson, A. R., Gleich, D. F., & Demmel, J. (2013). - Direct QR factorizations for tall-and-skinny matrices in MapReduce - architectures. - 2013 IEEE International Conference on Big Data. - DOI:10.1109/bigdata.2013.6691583 - - Demmel, J., Grigori, L., Hoemmen, M., & Langou, J. (2012). - Communication-optimal parallel and sequential QR and LU - factorizations. - SIAM Journal on Scientific Computing, 34(1), A206-A239. - DOI:10.1137/080731992 - - DMD properties: - Brunton S. L. (2018). - Dynamic mode decomposition overview. - Seattle, Washington: University of Washington. - youtu.be/sQvrK8AGCAo (Retrieved:24-04-20) + STDMD and mode-sorting algorithms (tags:K, HRDC, KZ, HWR): + Kiewat, M. (2019). + Streaming modal decomposition approaches for vehicle aerodynamics. + PhD thesis. Munich: Technical University of Munich. + URL:mediatum.ub.tum.de/doc/1482652/1482652.pdf + + Hemati, M. S., Rowley, C. W., + Deem, E. A., & Cattafesta, L. N. (2017). + De-biasing the dynamic mode decomposition + for applied Koopman spectral analysis of noisy datasets. + Theoretical and Computational Fluid Dynamics, 31(4), 349-368. + DOI:10.1007/s00162-017-0432-2 + + Kou, J., & Zhang, W. (2017). + An improved criterion to select + dominant modes from dynamic mode decomposition. + European Journal of Mechanics-B/Fluids, 62, 109-129. + DOI:10.1016/j.euromechflu.2016.11.015 + + Hemati, M. S., Williams, M. O., & Rowley, C. W. (2014). + Dynamic mode decomposition for large and streaming datasets. + Physics of Fluids, 26(11), 111701. + DOI:10.1063/1.4901016 + + Parallel classical Gram-Schmidt process (tag:Ka): + Katagiri, T. (2003). + Performance evaluation of parallel + Gram-Schmidt re-orthogonalization methods. + In: Palma J. M. L. M., Sousa A. A., Dongarra J., Hernández V. (eds) + High Performance Computing for Computational Science — VECPAR 2002. + Lecture Notes in Computer Science, vol 2565, p. 302-314. + Berlin, Heidelberg: Springer. + DOI:10.1007/3-540-36569-9_19 + + Parallel direct tall-skinny QR decomposition (tags:BGD, DGHL): + Benson, A. R., Gleich, D. F., & Demmel, J. (2013). + Direct QR factorizations for + tall-and-skinny matrices in MapReduce architectures. + 2013 IEEE International Conference on Big Data. + DOI:10.1109/bigdata.2013.6691583 + + Demmel, J., Grigori, L., Hoemmen, M., & Langou, J. (2012). + Communication-optimal parallel + and sequential QR and LU factorizations. + SIAM Journal on Scientific Computing, 34(1), A206-A239. + DOI:10.1137/080731992 + + DMD properties: + Brunton S. L. (2018). + Dynamic mode decomposition overview. + Seattle, Washington: University of Washington. + youtu.be/sQvrK8AGCAo (Retrieved:24-04-20) \endverbatim Operands: @@ -109,7 +110,7 @@ Description output field | volScalarField(s) | $FOAM_CASE/\<time\>/\<outField\>(s) \endtable - where Type={Scalar,SphericalTensor,SymmTensor,Tensor}. + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. Output fields: \verbatim diff --git a/src/functionObjects/field/XiReactionRate/XiReactionRate.C b/src/functionObjects/field/XiReactionRate/XiReactionRate.C index c9ee4a18e65062c8e60cb3140cab8d81f2479115..6ec82a9dc78b2a2b5895a424eb838d87f5b46477 100644 --- a/src/functionObjects/field/XiReactionRate/XiReactionRate.C +++ b/src/functionObjects/field/XiReactionRate/XiReactionRate.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -58,12 +58,6 @@ Foam::functionObjects::XiReactionRate::XiReactionRate } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::XiReactionRate::~XiReactionRate() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::XiReactionRate::read(const dictionary& dict) @@ -89,7 +83,7 @@ bool Foam::functionObjects::XiReactionRate::write() const volScalarField& Xi = mesh_.lookupObject<volScalarField>("Xi"); - volScalarField St + const volScalarField St ( IOobject ( @@ -105,7 +99,7 @@ bool Foam::functionObjects::XiReactionRate::write() St.write(); - volScalarField wdot + const volScalarField wdot ( IOobject ( diff --git a/src/functionObjects/field/XiReactionRate/XiReactionRate.H b/src/functionObjects/field/XiReactionRate/XiReactionRate.H index 5a5263cdea770bc3b34f4ac137807187711ca888..9c4571181f598053e6152c1a2225dd5d1e604bdf 100644 --- a/src/functionObjects/field/XiReactionRate/XiReactionRate.H +++ b/src/functionObjects/field/XiReactionRate/XiReactionRate.H @@ -34,25 +34,44 @@ Description Writes the turbulent flame-speed and reaction-rate volScalarFields for the Xi-based combustion models. + Operands: + \table + Operand | Type | Location + input | - | - + output file | - | - + output field | volScalarField | $FOAM_CASE/\<time\>/{St,wdot} + \endtable + Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim - XiReactionRate + XiReactionRate1 { + // Mandatory entries (unmodifiable) type XiReactionRate; libs (fieldFunctionObjects); + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: XiReactionRate | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: XiReactionRate | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. + See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::XiReactionRate SourceFiles XiReactionRate.C @@ -79,15 +98,6 @@ class XiReactionRate : public fvMeshFunctionObject { - // Private member functions - - //- No copy construct - XiReactionRate(const XiReactionRate&) = delete; - - //- No copy assignment - void operator=(const XiReactionRate&) = delete; - - public: //- Runtime type information @@ -104,9 +114,15 @@ public: const dictionary& dict ); + //- No copy construct + XiReactionRate(const XiReactionRate&) = delete; + + //- No copy assignment + void operator=(const XiReactionRate&) = delete; + //- Destructor - virtual ~XiReactionRate(); + virtual ~XiReactionRate() = default; // Member Functions diff --git a/src/functionObjects/field/add/add.C b/src/functionObjects/field/add/add.C index 3a0cf1af49a50aa936669742365ea2a73d5c285e..7bb9b92fba42b8483b1617241a7b0d42da689818 100644 --- a/src/functionObjects/field/add/add.C +++ b/src/functionObjects/field/add/add.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -63,10 +64,4 @@ Foam::functionObjects::add::add } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::add::~add() -{} - - // ************************************************************************* // diff --git a/src/functionObjects/field/add/add.H b/src/functionObjects/field/add/add.H index 4c23eeea2277e7b7f90daa1abb1ab4ead056b461..399ac851266a73af425ab48cb0538c1d79217cdd 100644 --- a/src/functionObjects/field/add/add.H +++ b/src/functionObjects/field/add/add.H @@ -31,30 +31,68 @@ Group grpFieldFunctionObjects Description - Add a list of fields. + Sums a given list of (at least two or more) fields and outputs the result + into a new field, where the fields possess the same sizes and dimensions: - The operation can be applied to any volume or surface fields generating a - volume or surface scalar field. + \verbatim + fieldResult = field1 + field2 + ... + fieldN + \endverbatim + + Operands: + \table + Operand | Type | Location + input | {vol,surface}\<Type\>Field(s) <!-- + --> |$FOAM_CASE/\<time\>/\<inpField\>s + output file | - |- + output field | {vol,surface}\<Type\>Field <!-- + --> | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. - Example of function object specification: +Usage + Minimal example by using \c system/controlDict.functions: \verbatim - Ttot + add1 { + // Mandatory entries (unmodifiable) type add; libs (fieldFunctionObjects); - fields (T Tdelta); - result Ttot; - executeControl writeTime; - writeControl writeTime; + + // Mandatory (inherited) entry (runtime modifiable) + fields (<field1> <field2> ... <fieldN>); + + // Optional (inherited) entries + ... } \endverbatim + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: add | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of the operand fields | wordList | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldsExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func "add(<field1>, <field2>, ..., <fieldN>)" + \endverbatim + See also - Foam::functionObjects::fieldsExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fieldsExpression + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::add SourceFiles add.C + addTemplates.C \*---------------------------------------------------------------------------*/ @@ -81,7 +119,7 @@ class add // Private Member Functions //- Add the list of fields of the specified type - // and return the result + //- and return the result template<class GeoFieldType> tmp<GeoFieldType> calcFieldType() const; @@ -108,9 +146,15 @@ public: const dictionary& dict ); + //- No copy construct + add(const add&) = delete; + + //- No copy assignment + void operator=(const add&) = delete; + //- Destructor - virtual ~add(); + virtual ~add() = default; }; diff --git a/src/functionObjects/field/add/addTemplates.C b/src/functionObjects/field/add/addTemplates.C index 79a00f7c9bfd07e9cf32534cf0d0bac263053c23..95f205e66c9f8167d1f6a0341fda8f3bc81c10d7 100644 --- a/src/functionObjects/field/add/addTemplates.C +++ b/src/functionObjects/field/add/addTemplates.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,7 +38,7 @@ Foam::functionObjects::add::calcFieldType() const + lookupObject<GeoFieldType>(fieldNames_[1]) ); - for (label i=2; i<fieldNames_.size(); i++) + for (label i = 2; i < fieldNames_.size(); ++i) { tresult.ref() += lookupObject<GeoFieldType>(fieldNames_[i]); } diff --git a/src/functionObjects/field/blendingFactor/blendingFactor.C b/src/functionObjects/field/blendingFactor/blendingFactor.C index c2b077746e33b6f46fc111b20679d768fbde575f..e207f4cc10e669de95f4b4a9bd4dfc2c0cc25ebd 100644 --- a/src/functionObjects/field/blendingFactor/blendingFactor.C +++ b/src/functionObjects/field/blendingFactor/blendingFactor.C @@ -103,12 +103,6 @@ Foam::functionObjects::blendingFactor::blendingFactor } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::blendingFactor::~blendingFactor() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::blendingFactor::read(const dictionary& dict) @@ -117,17 +111,13 @@ bool Foam::functionObjects::blendingFactor::read(const dictionary& dict) { phiName_ = dict.getOrDefault<word>("phi", "phi"); - tolerance_ = 0.001; - if - ( - dict.readIfPresent("tolerance", tolerance_) - && (tolerance_ < 0 || tolerance_ > 1) - ) - { - FatalErrorInFunction - << "tolerance must be in the range 0 to 1. Supplied value: " - << tolerance_ << exit(FatalError); - } + tolerance_ = + dict.getCheckOrDefault + ( + "tolerance", + 0.001, + [&](const scalar tol){ return (tol > 0) && (tol < 1); } + ); return true; } @@ -147,10 +137,8 @@ bool Foam::functionObjects::blendingFactor::write() label nCellsScheme1 = 0; label nCellsScheme2 = 0; label nCellsBlended = 0; - forAll(indicator, celli) + for (const auto i : indicator) { - scalar i = indicator[celli]; - if (i < tolerance_) { nCellsScheme1++; diff --git a/src/functionObjects/field/blendingFactor/blendingFactor.H b/src/functionObjects/field/blendingFactor/blendingFactor.H index c9ef01cc3fa6383fe4771003aaa55ceafad1b897..ba5e09aa3622d87534c2c8a87671de8af5ddf5e6 100644 --- a/src/functionObjects/field/blendingFactor/blendingFactor.H +++ b/src/functionObjects/field/blendingFactor/blendingFactor.H @@ -31,61 +31,85 @@ Group grpFieldFunctionObjects Description - Calculates and outputs the blendingFactor as used by the bended convection - schemes. The output is a volume field (cells) whose value is calculated via - the maximum blending factor for any cell face. + Computes the blending coefficient employed by blended divergence schemes, + giving an indicator as to which of the schemes is active across the domain. - The weight of a blended scheme is given by a function of the blending - factor, f: + Blended schemes combine contributions from two schemes, i.e. \f$\phi_1\f$ + and \f$\phi_2\f$, using a weight field, i.e. \f$w\f$, such that the + effective scheme value, i.e. \f$\phi_{eff}\f$, is computed as follows: \f[ - weight = f scheme1 + (1 - f) scheme2 + \phi_{eff} = w \phi_1 + (1 - w) \phi_2 \f] - The factor is a face-based quantity, which is converted to a cell-based - quantity by assigning the minimum blending factor for any cell face. + The weight field, i.e. \f$w\f$, is surface field and converted to a volume + field for easier post-processing by setting the cell value to one minus + the minimum of the face values. - An indicator (volume) field, named \<functionObjectName\>:\<fieldName\>, is - generated that is set to (1 - f), i.e. values of: - - 0 represent scheme1 as active, and - - 1 represent scheme2 as active. - - intermediate values show the contribution to scheme2 + This conversion leads to blending indicator field whose values mean: + \verbatim + 0 = scheme 0 + 1 = scheme 1 + 0-1 = a blend between scheme 0 and scheme 1 + \endverbatim - Additional reporting is written to the standard output, providing - statistics as to the number of cells used by each scheme. + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable Usage - Example of function object specification to calculate the blending factor: + Minimal example by using \c system/controlDict.functions: \verbatim blendingFactor1 { - type blendingFactor; - libs (fieldFunctionObjects); + // Mandatory entries (unmodifiable) + type blendingFactor; + libs (fieldFunctionObjects); - ... + // Mandatory (inherited) entry (runtime modifiable) + field <field>; + + // Optional entries (runtime modifiable) + phi phi; + tolerance 0.001; - // Name of field - field U; + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: blendingFactor | yes | - phi | Name of flux field | no | phi - field | Name of field to evaluate | yes | - tolerance | Tolerance for number of blended cells | no | 0.001 - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Deflt + type | Type name: blendingFactor | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + field | Name of the operand field | word | yes | - + phi | Name of flux field | word | no | phi + tolerance | Tolerance for number of blended cells | scalar | no | 0.001 \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. + See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile + - Foam::functionObject + - Foam::functionObjects::fieldExpression + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - Foam::CoBlended + - ExtendedCodeGuide::functionObjects::field::blendingFactor SourceFiles blendingFactor.C + blendingFactorTemplates.C \*---------------------------------------------------------------------------*/ @@ -112,9 +136,9 @@ class blendingFactor public fieldExpression, public writeFile { - // Private member data + // Private Data - //- Name of flux field, default is "phi" + //- Name of flux field word phiName_; //- Tolerance used when calculating the number of blended cells @@ -163,9 +187,15 @@ public: const dictionary& dict ); + //- No copy construct + blendingFactor(const blendingFactor&) = delete; + + //- No copy assignment + void operator=(const blendingFactor&) = delete; + //- Destructor - virtual ~blendingFactor(); + virtual ~blendingFactor() = default; // Member Functions diff --git a/src/functionObjects/field/columnAverage/columnAverage.H b/src/functionObjects/field/columnAverage/columnAverage.H index 03289082c8cfcd96286a6b094c9818bd98e54c84..0a5352954fe9ba65fbce03c689cddbcdb77caba7 100644 --- a/src/functionObjects/field/columnAverage/columnAverage.H +++ b/src/functionObjects/field/columnAverage/columnAverage.H @@ -30,41 +30,66 @@ Group grpFieldFunctionObjects Description - Averages columns of cells for layered meshes. + Computes the arithmetic average of given quantities along columns of cells + in a given direction for structured-like layered meshes. It is, for example, + useful for channel-like cases where spanwise average of a field is desired. + However, the \c columnAverage function object does not operate on arbitrary + unstructured meshes. For each patch face, calculates the average value of all cells attached in the patch face normal direction, and then pushes the average value back to all cells in the column. - Useful for channel-like cases where we want to average fields in the - spanwise direction. + Operands: + \table + Operand | Type | Location + input | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim columnAverage1 { - type columnAverage; - libs (fieldFunctionObjects); + // Mandatory entries (unmodifiable) + type columnAverage; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + patches (<patch1> <patch2> ... <patchN>); + fields (<field1> <field2> ... <fieldN>); + + // Optional (inherited) entries ... - patches (front side); - fields (U p); } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default - type | type name: columnAverage | yes | - patches | list of patches to collapse onto | yes | - fields | list of fields to process | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: columnAverage | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + patches | Names of patches to collapse onto | word | yes | - + fields | Names of the operand fields | word | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. + See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::columnAverage SourceFiles columnAverage.C + columnAverageTemplates.C \*---------------------------------------------------------------------------*/ @@ -137,6 +162,12 @@ public: const dictionary& dict ); + //- No copy construct + columnAverage(const columnAverage&) = delete; + + //- No copy assignment + void operator=(const columnAverage&) = delete; + //- Destructor virtual ~columnAverage() = default; diff --git a/src/functionObjects/field/components/components.H b/src/functionObjects/field/components/components.H index 4e4c3363eed85ba54ba8c9a09180ab96ce074c15..a594cdb99aa91061a024ebc492637e1baf1aa62d 100644 --- a/src/functionObjects/field/components/components.H +++ b/src/functionObjects/field/components/components.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,16 +31,75 @@ Group grpFieldFunctionObjects Description - Calculates the components of a field. - - The operation can be applied to any volume or surface fields generating a - volume or surface scalar fields for each component. + Extracts the components of elements of a field and outputs the result + into new fields, where the fields possess the same sizes and dimensions. + + Depending on the base type of the input field, the number of output fields + and output suffixes are as follows (the base type cannot be scalar since + scalars have no components): + + \table + Base type | Number of components | Suffixes + vector | 3 | (x y z) + sphericalTensor | 3 | (x y z) + symmTensor | 6 | (xx xy xz yy yz zz) + tensor | 9 | (xx xy xz yx yy yz zx zy zz) + \endtable + + Operands: + \table + Operand | Type | Location + input | {vol,surface}\<Type\>Field (Type != Scalar) <!-- + --> | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | {vol,surface}ScalarField for each component <!-- + --> | $FOAM_CASE/\<time\>/\<outField\>\<suffix\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + components1 + { + // Mandatory entries (unmodifiable) + type components; + libs (fieldFunctionObjects); + + // Mandatory (inherited) entry (runtime modifiable) + field <field>; + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: components | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + field | Name of the operand field | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func "components(<field>)" + \endverbatim See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::components SourceFiles components.C + componentsTemplates.C \*---------------------------------------------------------------------------*/ @@ -64,7 +123,7 @@ class components : public fieldExpression { - // Private member data + // Private Member Data //- List of the component field names wordList resultNames_; @@ -73,12 +132,12 @@ class components // Private Member Functions //- Calculate the components of the field with the specified type - // and register the result + //- and register the result template<class GeoFieldType> bool calcFieldComponents(); //- Calculate the components of the field with the specified - // element type and register the result + //- element type and register the result template<class Type> bool calcComponents(); @@ -102,6 +161,12 @@ public: const dictionary& dict ); + //- No copy construct + components(const components&) = delete; + + //- No copy assignment + void operator=(const components&) = delete; + //- Destructor virtual ~components() = default; diff --git a/src/functionObjects/field/components/componentsTemplates.C b/src/functionObjects/field/components/componentsTemplates.C index 64c54cb015cc1a04c69b85485624813d8c25108f..64f152e6f4af3d1b3a2951e72d2814efba3b646e 100644 --- a/src/functionObjects/field/components/componentsTemplates.C +++ b/src/functionObjects/field/components/componentsTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,13 +36,13 @@ bool Foam::functionObjects::components::calcFieldComponents() { typedef typename GeoFieldType::value_type Type; - const GeoFieldType& field(lookupObject<GeoFieldType>(fieldName_)); + const GeoFieldType& field = lookupObject<GeoFieldType>(fieldName_); resultNames_.setSize(Type::nComponents); bool stored = true; - for (direction i=0; i<Type::nComponents; i++) + for (direction i = 0; i < Type::nComponents; ++i) { resultName_ = fieldName_ + word(Type::componentNames[i]); resultNames_[i] = resultName_; diff --git a/src/functionObjects/field/continuityError/continuityError.C b/src/functionObjects/field/continuityError/continuityError.C index c0364e98380dfea6966185f939c5d18d17fa79b7..5036d164a5b075adae7f9b4c289d4d5e9237c229 100644 --- a/src/functionObjects/field/continuityError/continuityError.C +++ b/src/functionObjects/field/continuityError/continuityError.C @@ -115,8 +115,8 @@ bool Foam::functionObjects::continuityError::write() const volScalarField error(fvc::div(*phiPtr)); const scalar deltaT = mesh_.time().deltaTValue(); - scalar local = deltaT*mag(error)().weightedAverage(mesh_.V()).value(); - scalar global = deltaT*error.weightedAverage(mesh_.V()).value(); + const scalar local = deltaT*mag(error)().weightedAverage(mesh_.V()).value(); + const scalar global = deltaT*error.weightedAverage(mesh_.V()).value(); cumulative_ += global; Ostream& os = file(); diff --git a/src/functionObjects/field/continuityError/continuityError.H b/src/functionObjects/field/continuityError/continuityError.H index 3966a2ba9e9b27277a0ccb92d8f5b0c32f2766fc..5a9d64ce9a977b78702433ae1ad71a23d8ffb2d5 100644 --- a/src/functionObjects/field/continuityError/continuityError.H +++ b/src/functionObjects/field/continuityError/continuityError.H @@ -30,40 +30,78 @@ Group grpFieldFunctionObjects Description - Calculates the continuity error for a flux field + Computes local, global and cumulative continuity errors for a flux field. + + Local continuity error, \f$ \epsilon_{local} \f$: + \f[ + \epsilon_{local} = \Delta_t \langle |x| \rangle + \f] + + Global continuity error, \f$ \epsilon_{global} \f$: + \f[ + \epsilon_{global} = \Delta_t \langle |x| \rangle + \f] + + Cumulative continuity, \f$ \epsilon_{cum} \f$: + \f[ + \epsilon_{cum} += \epsilon_{global} + \f] + + where + \vartable + \Delta_t | Time-step size + \langle . \rangle | Cell-volume weighted average operator + x | \f$ \div \phi \f$ + phi | Flux field + \endvartable + + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | - | - + \endtable Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim continuityError1 { + // Mandatory entries (unmodifiable) type continuityError; libs (fieldFunctionObjects); - ... - writeToFile yes; - log yes; + + // Optional entries (runtime modifiable) phi phi; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: continuityError | yes | - writeToFile | write min/max data to file | no | yes - log | write min/max data to standard output | no | yes - phi | name of flux field | no | phi + Property | Description | Type | Req'd | Dflt + type | Type name: continuityError | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + phi | Name of flux field | word | no | phi \endtable - Output data is written to the file \<timeDir\>/continuityError.dat + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::continuityError SourceFiles continuityError.C - continuityErrorTemplates.C \*---------------------------------------------------------------------------*/ @@ -90,22 +128,11 @@ class continuityError public fvMeshFunctionObject, public writeFile { -private: - - // Private Member Functions - - //- No copy construct - continuityError(const continuityError&) = delete; - - //- No copy assignment - void operator=(const continuityError&) = delete; - - protected: - // Protected data + // Protected Data - //- Name of the flux field; default = "phi + //- Name of flux field word phiName_; //- Cumulative error @@ -134,6 +161,12 @@ public: const dictionary& dict ); + //- No copy construct + continuityError(const continuityError&) = delete; + + //- No copy assignment + void operator=(const continuityError&) = delete; + //- Destructor virtual ~continuityError() = default; diff --git a/src/functionObjects/field/ddt/ddt.H b/src/functionObjects/field/ddt/ddt.H index 47ac9fb4587172ab41cf736c44e052f6afc95608..4ccb25958f5cf27ee78886bb093a64dcee5d0f74 100644 --- a/src/functionObjects/field/ddt/ddt.H +++ b/src/functionObjects/field/ddt/ddt.H @@ -31,13 +31,58 @@ Group grpFieldFunctionObjects Description - Calculates the Eulerian time derivative of a field. - - The operation can be applied to any volume field generating a field of the - same type. + Computes the Eulerian time derivative of an input volume field for + time-variant simulations (not appropriate to steady-state simulations). + + Operands: + \table + Operand | Type | Location + input | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + ddt1 + { + // Mandatory entries (unmodifiable) + type ddt; + libs (fieldFunctionObjects); + + // Mandatory (inherited) entries (runtime modifiable) + field <field>; + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: ddt | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + field | Name of operand field | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func "ddt(<field>)" + \endverbatim See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::ddt SourceFiles ddt.C @@ -65,6 +110,7 @@ class ddt : public fieldExpression { + // Private Member Functions //- Calculate and store the result @@ -93,6 +139,12 @@ public: const dictionary& dict ); + //- No copy construct + ddt(const ddt&) = delete; + + //- No copy assignment + void operator=(const ddt&) = delete; + //- Destructor virtual ~ddt() = default; diff --git a/src/functionObjects/field/ddt2/ddt2.C b/src/functionObjects/field/ddt2/ddt2.C index f5965f6df35ef2b413567fc0e1227a8c13243543..f613f1197db145049f94533c17ac8629d5a3b495 100644 --- a/src/functionObjects/field/ddt2/ddt2.C +++ b/src/functionObjects/field/ddt2/ddt2.C @@ -40,13 +40,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(ddt2, 0); - - addToRunTimeSelectionTable - ( - functionObject, - ddt2, - dictionary - ); + addToRunTimeSelectionTable(functionObject, ddt2, dictionary); } } diff --git a/src/functionObjects/field/ddt2/ddt2.H b/src/functionObjects/field/ddt2/ddt2.H index 59b3bc0741e579c8672ae9c6fd9f3d4c15a08265..061f673222a3fd11851c94df3fcf3326dee9cafa 100644 --- a/src/functionObjects/field/ddt2/ddt2.H +++ b/src/functionObjects/field/ddt2/ddt2.H @@ -30,37 +30,57 @@ Group grpFieldFunctionObjects Description - This function object calculates the magnitude squared - of d(scalarField)/dt. + Computes the magnitude or magnitude squared of the Eulerian time derivative + of an input volume field for time-variant simulations + (not appropriate to steady-state simulations). - The result can be used further for determining variance or RMS values - (for example). + The result can be further used for determining e.g. variance or RMS values. + + Operands: + \table + Operand | Type | Location + input | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim - dpdt2 + ddt21 { - type ddt2; - libs (fieldFunctionObjects); - fields (p); - result d@@dt2; + // Mandatory entries (unmodifiable) + type ddt2; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + fields (<field1> <field2> ... <fieldN>); + + // Optional entries (unmodifiable) + mag false; + + // Optional entries (runtime modifiable) + result d@@dt2; + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: ddt2 | yes | - fields | Name of fields to process | yes | - result | Name of results | no | magSqr(ddt(@@)) - log | Log to standard output | no | yes - mag | Use 'mag' instead of 'magSqr' | no | false + Property | Description | Type | Req'd | Dflt + type | Type name: ddt2 | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of the operand fields | wordList | yes | - + mag | Compute 'mag' instead of 'magSqr' | bool | no | false + result | Name of results | word | no | magSqr(ddt2(@@)) \endtable - Note that the optional 'mag' entry cannot be changed during the simulation - since it alters the dimensions of the output field. + The inherited entries are elaborated in: + - \link functionObject.H \endlink A list of fields can contain exact names or regular expressions. The token '\@\@' in the result name is replaced by the name of the source @@ -70,6 +90,13 @@ Usage The function object will skip over fields that appear to have already been processed (ie, their names are similar to the output names). + Usage by the \c postProcess utility is not available. + +See also + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::ddt2 + SourceFiles ddt2.C ddt2Templates.C @@ -101,29 +128,29 @@ class ddt2 : public fvMeshFunctionObject { - // Private data + // Private Data - //- Name of fields to process. + //- Name of fields to process wordRes selectFields_; - //- Formatting for the result fields. + //- Formatting for the result fields word resultName_; - //- Avoid processing the same field twice. + //- Avoid processing the same field twice mutable regExp blacklist_; - //- Hashed names of result fields. + //- Hashed names of result fields wordHashSet results_; - //- Use 'mag' instead of 'magSqr'. + //- Flat to use 'mag' instead of 'magSqr' // Cannot be adjusted during the simulation since it alters the - // dimensions of the output field. + // dimensions of the output field const bool mag_; // Private Member Functions - //- Check that string contains the appropriate substitution token(s). + //- Check that string contains the appropriate substitution token(s) static bool checkFormatName(const std::string& str); @@ -134,17 +161,10 @@ class ddt2 template<class FieldType> int apply(const word& inputName, int& state); - //- Process by trying to apply for various volume field types. + //- Process by trying to apply for various volume field types int process(const word& inputName); - //- No copy construct - ddt2(const ddt2&) = delete; - - //- No copy assignment - void operator=(const ddt2&) = delete; - - public: //- Runtime type information @@ -161,6 +181,12 @@ public: const dictionary& dict ); + //- No copy construct + ddt2(const ddt2&) = delete; + + //- No copy assignment + void operator=(const ddt2&) = delete; + //- Destructor virtual ~ddt2() = default; @@ -174,7 +200,7 @@ public: //- Calculate the ddt2 fields virtual bool execute(); - //- Write the ddt fields + //- Write the ddt2 fields virtual bool write(); }; diff --git a/src/functionObjects/field/derivedFields/derivedFields.C b/src/functionObjects/field/derivedFields/derivedFields.C index 4af8618311ff618fece2e5e59baf8f694a78f69d..664faa3a9e5a18397375a9c3029a4e41ee92a75d 100644 --- a/src/functionObjects/field/derivedFields/derivedFields.C +++ b/src/functionObjects/field/derivedFields/derivedFields.C @@ -39,13 +39,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(derivedFields, 0); - - addToRunTimeSelectionTable - ( - functionObject, - derivedFields, - dictionary - ); + addToRunTimeSelectionTable(functionObject, derivedFields, dictionary); } } @@ -62,7 +56,6 @@ Foam::functionObjects::derivedFields::knownNames }); - // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * // namespace Foam diff --git a/src/functionObjects/field/derivedFields/derivedFields.H b/src/functionObjects/field/derivedFields/derivedFields.H index 469ec66fd43fef0cdc32e8e79fda86ebe0148df2..6b433ebbb9a0a716497aacee610eef1eb7a03083 100644 --- a/src/functionObjects/field/derivedFields/derivedFields.H +++ b/src/functionObjects/field/derivedFields/derivedFields.H @@ -30,34 +30,60 @@ Group grpFieldFunctionObjects Description - A limited set of predefined derived fields ("rhoU", "pTotal"). + Computes two predefined derived fields, i.e. \c rhoU, and \c pTotal, where + the defined fields are hard-coded as follows: + \vartable + rhoU | \f$ \rho \vec U \f$ + pTotal | \f$ p + 1/2 \rho \, mag(\vec U)^2 \f$ + \endvartable + + Operands: + \table + Operand | Type | Location + input | vol{Scalar,Vector}Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | vol{Scalar,Vector}Field | $FOAM_CASE/\<time\>/\<outField\> + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: \verbatim - derived + derivedFields1 { - type derivedFields; - libs (fieldFunctionObjects); + // Mandatory entries (unmodifiable) + type derivedFields; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + derived (rhoU pTotal); - fields (rhoU pTotal); + // Optional entries (runtime modifiable) + rhoRef 1.0; - // Optional: reference density for incompressible - rhoRef 1.25; + // Optional (inherited) entries + ... } \endverbatim - Entries: + where the entries mean: \table - Property | Description | Required | Default - type | derivedFields | yes | - derived | Derived fields (pTotal/rhoU) | yes | - rhoRef | Reference density (incompressible) | no | 1 + Property | Description | Type | Req'd | Dflt + type | Type name: derivedFields | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + derived | Names of operand fields (rhoU/pTotal) | word | yes | - + rhoRef | Reference density for incompressible flows | scalar | no | 1.0 \endtable - The known derived fields - \plaintable - rhoU | (rho * U) - pTotal | (p + 1/2 * rho * U) - \endplaintable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. + +See also + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::derivedFields SourceFiles derivedFields.C @@ -89,7 +115,7 @@ public: // Public Enumerations - //- Derived/calculated field type + //- Options for the derived/calculated field type enum derivedType { NONE = 0, //!< "none" @@ -98,7 +124,7 @@ public: UNKNOWN }; - //- Known derived field types + //- Names for derivedType static const Enum<derivedType> knownNames; @@ -113,7 +139,7 @@ protected: scalar rhoRef_; - // Private Member Functions + // Protected Member Functions //- Hard-coded derived field (rho * U) // \return true if field did not previously exist @@ -140,6 +166,12 @@ public: const dictionary& dict ); + //- No copy construct + derivedFields(const derivedFields&) = delete; + + //- No copy assignment + void operator=(const derivedFields&) = delete; + //- Destructor virtual ~derivedFields() = default; diff --git a/src/functionObjects/field/div/div.C b/src/functionObjects/field/div/div.C index bb579902ebe31741211896c75491da50c5364950..51fc3911551404f15cc4a8558f2caf9f2b37dbd9 100644 --- a/src/functionObjects/field/div/div.C +++ b/src/functionObjects/field/div/div.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -68,10 +69,4 @@ Foam::functionObjects::div::div {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::div::~div() -{} - - // ************************************************************************* // diff --git a/src/functionObjects/field/div/div.H b/src/functionObjects/field/div/div.H index 679d5589ba1bb32524cbc68b8e9e8a5eac06a1b8..6cff115851662ed20fc1def0ccf82f5909d2a3d3 100644 --- a/src/functionObjects/field/div/div.H +++ b/src/functionObjects/field/div/div.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,15 +31,63 @@ Group grpFieldFunctionObjects Description - Calculates the divergence of a field. The operation is limited to - surfaceScalarFields and volVectorFields, and the output is a volScalarField. + Computes the divergence of an input field. + + Operands: + \table + Operand | Type | Location + input | {surfaceScalar,volVector}Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + div1 + { + // Mandatory entries (unmodifiable) + type div; + libs (fieldFunctionObjects); + + // Mandatory (inherited) entry (runtime modifiable) + field <field>; + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: add | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + field | Name of the operand field | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func "div(<field>)" + \endverbatim + +Note + To execute \c div function object on an input <field>, a numerical scheme + should be defined for \c div(<field>) in \c system/fvSchemes.divSchemes. See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::div SourceFiles div.C + divTemplates.C \*---------------------------------------------------------------------------*/ @@ -65,7 +114,7 @@ class div // Private Member Functions //- Calculate the divergence of either a - // volScalarField or a surfaceScalarField and register the result + //- volScalarField or a surfaceScalarField and register the result template<class FieldType> bool calcDiv(); @@ -89,9 +138,15 @@ public: const dictionary& dict ); + //- No copy construct + div(const div&) = delete; + + //- No copy assignment + void operator=(const div&) = delete; + //- Destructor - virtual ~div(); + virtual ~div() = default; }; diff --git a/src/functionObjects/field/enstrophy/enstrophy.C b/src/functionObjects/field/enstrophy/enstrophy.C index fa47ca2b50225e40b93056fe91b7eb3a2d13ec44..00401d5b01915c545bc72b9bc7646101b0e1d042 100644 --- a/src/functionObjects/field/enstrophy/enstrophy.C +++ b/src/functionObjects/field/enstrophy/enstrophy.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,13 +37,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(enstrophy, 0); - - addToRunTimeSelectionTable - ( - functionObject, - enstrophy, - dictionary - ); + addToRunTimeSelectionTable(functionObject, enstrophy, dictionary); } } @@ -79,10 +74,4 @@ Foam::functionObjects::enstrophy::enstrophy } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::enstrophy::~enstrophy() -{} - - // ************************************************************************* // diff --git a/src/functionObjects/field/enstrophy/enstrophy.H b/src/functionObjects/field/enstrophy/enstrophy.H index b8be3ddd0ac6cff188f172f17c5cae4d97278e17..e9e6b5df5d4c335b2d600e7597fbda8656d981c4 100644 --- a/src/functionObjects/field/enstrophy/enstrophy.H +++ b/src/functionObjects/field/enstrophy/enstrophy.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,11 +31,59 @@ Group grpFieldFunctionObjects Description - Calculates the enstrophy of the velocity. + Computes the enstrophy of an input \c volVectorField. + + Enstrophy, i.e. \f$\xi\f$: + + \f[ + \xi = 0.5 mag(\nabla \times \vec U )^2 + \f] + + where \f$\vec U\f$ is the input \c volVectorField. + + Operands: + \table + Operand | Type | Location + input | volVectorField | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + enstrophy1 + { + // Mandatory entries (unmodifiable) + type enstrophy; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: enstrophy | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func enstrophy + \endverbatim See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::enstrophy SourceFiles enstrophy.C @@ -83,9 +132,15 @@ public: const dictionary& dict ); + //- No copy construct + enstrophy(const enstrophy&) = delete; + + //- No copy assignment + void operator=(const enstrophy&) = delete; + //- Destructor - virtual ~enstrophy(); + virtual ~enstrophy() = default; }; diff --git a/src/functionObjects/field/externalCoupled/externalCoupled.C b/src/functionObjects/field/externalCoupled/externalCoupled.C index 40b1f2879630f15c7ac6b2d014883f0f99fbe083..e30488bbea0e11c7d7208f7a97990bedaffb483c 100644 --- a/src/functionObjects/field/externalCoupled/externalCoupled.C +++ b/src/functionObjects/field/externalCoupled/externalCoupled.C @@ -42,15 +42,9 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(externalCoupled, 0); - - addToRunTimeSelectionTable - ( - functionObject, - externalCoupled, - dictionary - ); -} // End namespace functionObject -} // End namespace Foam + addToRunTimeSelectionTable(functionObject, externalCoupled, dictionary); +} +} Foam::string Foam::functionObjects::externalCoupled::patchKey = "// Patch:"; @@ -568,7 +562,8 @@ bool Foam::functionObjects::externalCoupled::read(const dictionary& dict) timeFunctionObject::read(dict); externalFileCoupler::readDict(dict); - calcFrequency_ = dict.getOrDefault("calcFrequency", 1); + calcFrequency_ = + dict.getCheckOrDefault("calcFrequency", 1, labelMinMax::ge(1)); // Leave trigger intact diff --git a/src/functionObjects/field/externalCoupled/externalCoupled.H b/src/functionObjects/field/externalCoupled/externalCoupled.H index aaeaf2bc55f189e32d8786bd29c93df3c8c96300..dde7ba1604a34f7ab740affa4b77694bf5fee0da 100644 --- a/src/functionObjects/field/externalCoupled/externalCoupled.H +++ b/src/functionObjects/field/externalCoupled/externalCoupled.H @@ -30,8 +30,10 @@ Group grpFieldFunctionObjects Description - This functionObject provides a simple interface for explicit coupling with - an external application. + Provides a simple file-based communication interface for explicit coupling + with an external application, so that data is transferred to- and from + OpenFOAM. The data exchange employs specialised boundary conditions to + provide either one-way or two-way coupling models. The coupling is through plain text files where OpenFOAM boundary data is read/written as one line per face (data from all processors collated): @@ -43,27 +45,28 @@ Description <fld1> <fld2> .. <fldn> //faceN \endverbatim - where the actual entries depend on the bc type: + where the actual entries depend on the boundary condition type: - mixed: value, snGrad, refValue, refGrad, valueFraction - externalCoupledMixed: output of writeDataMaster - other: value, snGrad These text files are located in a user specified communications directory - which gets read/written on the master processor only. In the - communications directory the structure will be + which gets read/written on the master processor only. + + In the communications directory the structure will be: \verbatim <regionsName>/<patchGroup>/<fieldName>.[in|out] \endverbatim - (where regionsName is either the name of a single region or a composite + (where \c regionsName is either the name of a single region or a composite of multiple region names) - At start-up, the boundary creates a lock file, i.e.. + At start-up, the boundary creates a lock file, i.e.: \verbatim OpenFOAM.lock \endverbatim - ... to signal the external source to wait. During the functionObject + ... to signal the external source to wait. During the function object execution the boundary values are written to files (one per region, per patch(group), per field), e.g. \verbatim @@ -77,21 +80,19 @@ Description <regionsName>/<patchGroup>/<fieldName>.in \endverbatim - ... and then reinstate the lock file. The functionObject will then + ... and then reinstate the lock file. The function object will then read these values, apply them to the boundary conditions and pass program execution back to OpenFOAM. Usage + Minimal example by using \c system/controlDict.functions: \verbatim - externalCoupled + externalCoupled1 { + // Mandatory entries (unmodifiable) type externalCoupled; - ... - log yes; + libs (fieldFunctionObjects); commsDir "<case>/comms"; - initByExternal yes; - statusDone done; // Any arbitrary status=... value - regions { "(region1|region0)" // Name of region(s) @@ -103,6 +104,16 @@ Usage } } } + initByExternal true; + + // Optional entries (runtime modifiable) + waitInterval 1; + timeOut 100; + statusDone done; // Any arbitrary status=... value + calcFrequency 1; + + // Optional (inherited) entries + ... } \endverbatim @@ -126,17 +137,30 @@ Usage The entries comprise: \table - Property | Description | Required | Default - type | Type name: externalCoupled | yes | - commsDir | Communication directory | yes | - waitInterval | wait interval in (s) | no | 1 - timeOut | timeout in (s) | no | 100*waitInterval - statusDone | Lockfile status=... on termination | no | done - initByExternal | Initialization values supplied by external app | yes - calcFrequency | Calculation frequency | no | 1 - regions | The regions to couple | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: externalCoupled | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + commsDir | Communication directory | word | yes | - + regions | The regions to couple | word | yes | - + initByExternal | Initialization values supplied by external app <!-- + --> | bool | yes | - + waitInterval | Wait interval in [s] | label | no | 1 + timeOut | Timeout in [s] | label | no | 100*waitInterval + statusDone | Lockfile status=... on termination | word | no | done + calcFrequency | Calculation frequency | label | no | 1 \endtable + The inherited entries are elaborated in: + - \link timeFunctionObject.H \endlink + + Usage by the \c postProcess utility is not available. + +See also + - Foam::functionObject + - Foam::functionObjects::timeFunctionObject + - Foam::externalFileCouple + - ExtendedCodeGuide::functionObjects::field::externalCoupled + SourceFiles externalCoupled.C externalCoupledTemplates.C @@ -267,12 +291,6 @@ class externalCoupled //- Perform the coupling with necessary initialization etc. void performCoupling(); - //- No copy construct - externalCoupled(const externalCoupled&) = delete; - - //- No copy assignment - void operator=(const externalCoupled&) = delete; - public: @@ -296,6 +314,12 @@ public: const dictionary& dict ); + //- No copy construct + externalCoupled(const externalCoupled&) = delete; + + //- No copy assignment + void operator=(const externalCoupled&) = delete; + //- Destructor virtual ~externalCoupled() = default; @@ -339,7 +363,7 @@ public: // Other //- Create single name by appending words (in sorted order), - // separated by '_' + //- separated by '_' static word compositeName(const wordList&); //- Write geometry for the group as region/patch diff --git a/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H b/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H index d4455bf1b4d2749744f159588d6c29ab981503fe..1d0728a1ffc2ad2557f9826a4b1a391083d367a0 100644 --- a/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H +++ b/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H @@ -95,7 +95,7 @@ Usage Property | Description | Required | Default outputTemperature | Output temperature: fluid/wall | yes | htcRefTemperature | Fluid temperature for htc: cell/user | no | cell - Tref | Reference temperature [K] for htc | partly | + Tref | Reference temperature [K] for htc | conditional | \endtable SeeAlso diff --git a/src/functionObjects/field/externalCoupled/externalCoupledTemplates.C b/src/functionObjects/field/externalCoupled/externalCoupledTemplates.C index ef57453fb9801285ae23af6f859678205dfe7468..c3a7c939755ca7aba8a06060c3668e3b06057d1f 100644 --- a/src/functionObjects/field/externalCoupled/externalCoupledTemplates.C +++ b/src/functionObjects/field/externalCoupled/externalCoupledTemplates.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2015-2017 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,7 +26,6 @@ License \*---------------------------------------------------------------------------*/ #include "externalCoupled.H" -//#include "fvMesh.H" #include "OSspecific.H" #include "Fstream.H" #include "volFields.H" diff --git a/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.C b/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.C index dac6cf2b3331e7a2a40554a68b0201a14974e805..ba2b739a26d49d78a0afe9d5678b5ab492ca203d 100644 --- a/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.C +++ b/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2015-2018 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -44,7 +44,6 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(extractEulerianParticles, 0); - addToRunTimeSelectionTable ( functionObject, @@ -272,7 +271,7 @@ void Foam::functionObjects::extractEulerianParticles::collectParticle { if (Pstream::master()) { - const scalar d = cbrt(6*p.V/constant::mathematical::pi); + const scalar d = cbrt(6.0*p.V/constant::mathematical::pi); const point position = p.VC/(p.V + ROOTVSMALL); const vector U = p.VU/(p.V + ROOTVSMALL); label tag = -1; diff --git a/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.H b/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.H index 123b5d3145e1bf75716897c6d115bf6280a9db51..767c6c9c7a21c2d136fc7c52bd15e010e5bb66b0 100644 --- a/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.H +++ b/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.H @@ -30,41 +30,80 @@ Group grpFieldFunctionObjects Description - Generates particle size information from Eulerian calculations, e.g. VoF. + Generates particle size information from Eulerian calculations, e.g. \c VoF. + + Operands: + \table + Operand | Type | Location + input | - | - + output file | - | - + output field 1 | scalarField | $OUTPUT/d + output field 2 | scalarField | $OUTPUT/soi + output field 3 | labelField | $OUTPUT/tag + output field 4 | vectorField | $OUTPUT/U + \endtable + + where \c $OUTPUT=$FOAM_CASE/\<time\>/lagrangian/eulerianParticleCloud. Usage + Minimal example by using \c system/controlDict.functions: \verbatim extractEulerianParticles1 { + // Mandatory entries (unmodifiable) type extractEulerianParticles; libs (fieldFunctionObjects); - ... + + // Mandatory entries (runtime modifiable) faceZone f0; - nLocations 10; alpha alpha.water; + + // Optional entries (runtime modifiable) + alphaThreshold 0.1; + nLocations 0; U U; rho rho; phi phi; + minDiameter 1e-30; + maxDiameter 1e30; + + // Optional (inherited) entries + ... } \endverbatim - where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: extractEulerianParticles | yes | - faceZone | Name of faceZone used as collection surface | yes | - alpha | Name of phase indicator field | yes | - alphaThreshold | Threshold for alpha field | no | 0.1 | - nLocations | Number of injection bins to generate | no | 0 | - U | Name of velocity field | no | U | - rho | Name of density field | no | rho | - phi | Name of flux field | no | phi | - minDiameter | min diameter | no | small | - maxDiameter | max diameter | no | great | + Property | Description | Type | Req'd | Dflt + type | Type name: extractEulerianParticles | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + faceZone | Name of faceZone used as collection surface | word | yes | - + alpha | Name of phase indicator field | word | yes | - + alphaThreshold | Threshold for alpha field | scalar | no | 0.1 + nLocations | Number of injection bins to generate | label | no | 0 + U | Name of velocity field | word | no | U + rho | Name of density field | word | no | rho + phi | Name of flux field | word | no | phi + minDiameter | Minimum diameter | scalar | no | SMALL + maxDiameter | Maximum diameter | scalar | no | GREAT \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. + +See also + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - Foam::eulerianParticle + - ExtendedCodeGuide::functionObjects::field::extractEulerianParticles + SourceFiles extractEulerianParticles.C + extractEulerianParticlesTemplates.C \*---------------------------------------------------------------------------*/ @@ -95,10 +134,9 @@ class extractEulerianParticles public fvMeshFunctionObject, public writeFile { - protected: - // Protected data + // Protected Data //- Storage for collected particles injectedParticleCloud cloud_; @@ -236,12 +274,6 @@ protected: const label globalFaceI ) const; - //- No copy construct - extractEulerianParticles(const extractEulerianParticles&) = delete; - - //- No copy assignment - void operator=(const extractEulerianParticles&) = delete; - public: @@ -261,6 +293,12 @@ public: const dictionary& dict ); + //- No copy construct + extractEulerianParticles(const extractEulerianParticles&) = delete; + + //- No copy assignment + void operator=(const extractEulerianParticles&) = delete; + //- Destructor virtual ~extractEulerianParticles() = default; diff --git a/src/functionObjects/field/fieldAverage/fieldAverage.H b/src/functionObjects/field/fieldAverage/fieldAverage.H index c2a713d59c8c40a22e5fa0de600ec4ffff5b1810..868bed614791ab15bfcfca9a87b45c1dbffccb57 100644 --- a/src/functionObjects/field/fieldAverage/fieldAverage.H +++ b/src/functionObjects/field/fieldAverage/fieldAverage.H @@ -31,11 +31,9 @@ Group grpFieldFunctionObjects Description - Calculates average quantities for a user-specified selection of volumetric - and surface fields. - With the %subRegion option, also supports fields on functionObject - surface output (eg, sampledSurfaces). - + Computes ensemble- and/or time-based field averages, with optional + windowing, for a user-specified selection of volumetric and/or surface + fields. Fields are entered as a list of sub-dictionaries, which indicate the type of averages to perform, and can be updated during the calculation. The current @@ -49,18 +47,19 @@ Description \overline{x'}^2 = \frac{1}{N}\displaystyle\sum\limits_{i=0}^N (x_i - \overline{x})^2 \f] - - \c base: average over 'time', or 'iteration' (\f$N\f$ in the above) + - \c base: average over 'time', or 'iteration' (\c N in the above) - \c window: optional averaging window, specified in 'base' units Average field names are constructed by concatenating the base field with - the averaging type, e.g. when averaging field 'U', the resultant fields - are: + the averaging type, e.g. when averaging field 'U', the name of resultant + fields becomes: - arithmetic mean field, \c UMean - prime-squared field, \c UPrime2Mean Information regarding the number of averaging steps, and total averaging time are written on a per-field basis to the - \c "<functionObject name>Properties" dictionary, located in \<time\>/uniform + \c "<functionObject name>Properties" dictionary, + located in \c \<time\>/uniform. When restarting form a previous calculation, the averaging is continuous or may be restarted using the \c restartOnRestart option. @@ -70,61 +69,84 @@ Description periodicRestart option and setting \c restartPeriod to the required averaging period. + With the \c subRegion option, also supports fields on function object + surface output (e.g., \c sampledSurfaces). + + Operands: + \table + Operand | Type | Location + input | {vol,surface}\<Type\>Field(s) <!-- + --> |$FOAM_CASE/\<time\>/\<inpField\>s + output file | - | - + output field | {vol,surface}\<Type\>Field(s) <!-- + --> | $FOAM_CASE/\<time\>/\<outField\>s + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. + Usage + Minimal example by using \c system/controlDict.functions: \verbatim fieldAverage1 { + // Mandatory entries (unmodifiable) type fieldAverage; libs (fieldFunctionObjects); - writeControl writeTime; - - restartOnRestart false; - restartOnOutput false; - periodicRestart false; - restartPeriod 0.002; - + // Mandatory entries (runtime modifiable) fields ( - U + <field1> { - mean on; - prime2Mean on; - base time; - windowType exact; - window 10.0; - windowName w1; + // Optional (inherited) entries + ... } - p + + ... + + <fieldN> { - mean on; - prime2Mean on; - base time; + ... } ); + + // Optional entries (runtime modifiable) + restartOnRestart false; + restartOnOutput false; + periodicRestart false; + restartPeriod 0.002; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default - type | Type name: fieldAverage | yes | - restartOnRestart| Restart the averaging on restart | no | no - restartOnOutput | Restart the averaging on output | no | no - periodicRestart | Periodically restart the averaging | no | no - restartPeriod | Periodic restart period | conditional | - restartTime | One-shot reset of the averaging | no | great - fields | list of fields and averaging options | yes | - subRegion | Name for alternative objectRegistry | no | "" + Property | Description | Type | Req'd | Dflt + type | Type name: fieldAverage | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of the operand fields and averaging options <!-- + --> | dict | yes | - + restartOnRestart| Restart the averaging on restart | bool | no | false + restartOnOutput | Restart the averaging on output | bool | no | false + periodicRestart | Periodically restart the averaging | bool | no | false + restartPeriod | Periodic restart period | scalar | conditional | - + restartTime | One-shot reset of the averaging | scalar | no | GREAT + subRegion | Name for alternative objectRegistry | word | no | "" \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldAverageItem.H \endlink -Note - To employ the \c prime2Mean option, the \c mean option must be selected. + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObject + - Foam::functionObject + - Foam::functionObjects::fieldAverageItem + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::fieldAverage SourceFiles fieldAverage.C @@ -159,7 +181,7 @@ class fieldAverage { protected: - // Protected data + // Protected Data //- Time at last call, prevents repeated averaging label prevTimeIndex_; @@ -279,13 +301,6 @@ protected: void readAveragingProperties(); - //- No copy construct - fieldAverage(const fieldAverage&) = delete; - - //- No copy assignment - void operator=(const fieldAverage&) = delete; - - public: //- Runtime type information @@ -302,6 +317,12 @@ public: const dictionary& ); + //- No copy construct + fieldAverage(const fieldAverage&) = delete; + + //- No copy assignment + void operator=(const fieldAverage&) = delete; + //- Destructor virtual ~fieldAverage() = default; diff --git a/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.H b/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.H index eebe29127ea18deb8a3bf5eb738f627c48bd5944..46cdf4b9c7e818b2a3431f7e703c77289ec3f7fe 100644 --- a/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.H +++ b/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItem.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,9 +29,11 @@ Class Description Helper class to describe what form of averaging to apply. A set will be - applied to each base field in Foam::fieldAverage, of the form: + applied to each base field in Foam::fieldAverage, of the following form. +Usage \verbatim + <field1> { mean on; prime2Mean on; @@ -44,14 +46,33 @@ Description } \endverbatim - The averaging window corresponds to the averaging interval (iters or time) - If not specified, the averaging is over 'all iters/time' + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + mean | Flag to calculate average | bool | yes | - + prime2Mean | Flag to calculate prime-square average | bool | yes | - + base | Type of averaging interval | word | yes | - + window | Averaging window | scalar | no | + windowName | Name of the averaging window | word | no | "" + windowType | Type of averaging window | word | no | + allowRestart | Flag to allow restart for windowType=exact | bool | no | + \endtable + + Options for the \c base entry: + \verbatim + time | Averaging interval is based on time + iter | Averaging interval is based on iterations + \endverbatim + + Options for the \c windowType entry: + \verbatim + none | no windowing + exact | allow additional files will be stored and written + approximate | disallow additional files will be stored and written + \endverbatim - Available window types: - - \c none : no windowing - - \c exact : exact windowing - additional files will be stored and written - - \c approximate : approximate variant that does not store/write additional - fields +Note + To employ the \c prime2Mean option, the \c mean option must be enabled. SourceFiles fieldAverageItem.C @@ -92,7 +113,7 @@ class fieldAverageItem { public: - // Public data + // Public Data // File and field name extensions @@ -121,7 +142,7 @@ public: private: - // Private data + // Private Data //- Active flag bool active_; diff --git a/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C b/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C index f05d854b94c61bde77292a491e046c491b9ecbd0..2a6be1053f0f6da7744b89308931d41d3f95992a 100644 --- a/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C +++ b/src/functionObjects/field/fieldAverage/fieldAverageItem/fieldAverageItemIO.C @@ -73,7 +73,11 @@ Foam::Istream& Foam::functionObjects::operator>> faItem.mean_ = dict.get<bool>("mean"); faItem.prime2Mean_ = dict.get<bool>("prime2Mean"); faItem.base_ = faItem.baseTypeNames_.get("base", dict); +<<<<<<< HEAD faItem.window_ = dict.getOrDefault<scalar>("window", -1); +======= + faItem.window_ = dict.getOrDefault<scalar>("window", -1.0); +>>>>>>> DOC: elaborate the usage of function objects if (faItem.window_ > 0) { diff --git a/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C b/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C index 4f245da265085bc5fe369f760dd5ab1adbfde2d0..2c2ca26139476e1715c093dfecf8c83f7160032e 100644 --- a/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C +++ b/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C @@ -36,7 +36,6 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(fieldCoordinateSystemTransform, 0); - addToRunTimeSelectionTable ( functionObject, diff --git a/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H b/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H index 9035f285c5c88f64f7964ddd1031dce955732392..8d544b70f5f4ada0bf27b4ced7a931b8fd3153ef 100644 --- a/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H +++ b/src/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H @@ -32,19 +32,31 @@ Group Description Transforms a user-specified selection of fields from global Cartesian - coordinates to a local coordinate system. - The fields are run-time modifiable. + coordinates to a local user-specified coordinate system. + + Operands: + \table + Operand | Type | Location + input | {vol,surface}\<Type\>Field(s) <!-- + --> | $FOAM_CASE/\<time\>/\<inpField\>s + output file | - | - + output field | {vol,surface}\<Type\>Field(s) <!-- + --> | $FOAM_CASE/\<time\>/\<outField\>s + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim fieldCoordinateSystemTransform1 { + // Mandatory entries (unmodifiable) type fieldCoordinateSystemTransform; libs (fieldFunctionObjects); - ... - fields ( U UMean UPrime2Mean ); + // Mandatory entries (runtime modifiable) + fields ( U UMean UPrime2Mean ); coordinateSystem { origin (0.001 0 0); @@ -55,20 +67,31 @@ Usage e3 (0 0 -1); } } + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: fieldCoordinateSystemTransform | yes | - fields | list of fields to be transformed | yes | - coordinateSystem | local coordinate system | yes | - \endtable + Property | Description | Type | Req'd | Dflt + type | Type name: fieldCoordinateSystemTransform | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of the operand fields | wordList | yes | - + coordinateSystem | Local coordinate system | dict | yes | - + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link coordinateSystem.H \endlink + + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fvMeshFunctionObject - Foam::coordinateSystem + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::coordinateSystem + - ExtendedCodeGuide::functionObjects::field::fieldCoordinateSystemTransform SourceFiles fieldCoordinateSystemTransform.C @@ -162,6 +185,13 @@ public: const dictionary& dict ); + //- No copy construct + fieldCoordinateSystemTransform(const fieldCoordinateSystemTransform&) + = delete; + + //- No copy assignment + void operator=(const fieldCoordinateSystemTransform&) = delete; + //- Destructor virtual ~fieldCoordinateSystemTransform() = default; diff --git a/src/functionObjects/field/fieldExpression/fieldExpression.H b/src/functionObjects/field/fieldExpression/fieldExpression.H index 2b5e1bcb8cd5afa63142c079ca4db9c01fc2433f..ae6df7703a89099a0dc1f2b43e1b77647a22d68f 100644 --- a/src/functionObjects/field/fieldExpression/fieldExpression.H +++ b/src/functionObjects/field/fieldExpression/fieldExpression.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,13 +31,38 @@ Group grpFieldFunctionObjects Description - Base class for field expression function objects + Intermediate class for handling field expression function objects + (e.g. \c blendingFactor etc.) whereinto a single field is input. + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + <userDefinedSubDictName1> + { + // Mandatory and other optional entries + ... + + // Optional (inherited) entries (runtime modifiable) + field <field>; + result <fieldResult>; + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + field | Name of the operand field | word | yes | - + result | Name of the output field | word | no | \<FO\>(\<field\>) + \endtable See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::fieldExpression SourceFiles fieldExpression.C + fieldExpressionTemplates.C \*---------------------------------------------------------------------------*/ @@ -75,19 +100,16 @@ protected: // Protected Member Functions + //- Calculate the components of the field and return true if successful virtual bool calc() = 0; + //- Set the name of result field void setResultName(const word& typeName, const word& defaultArg); + //- Return true if required objects are found template<class Type> bool foundObject(const word& name, const bool verbose = true) const; - //- No copy construct - fieldExpression(const fieldExpression&) = delete; - - //- No copy assignment - void operator=(const fieldExpression&) = delete; - public: @@ -107,6 +129,12 @@ public: const word& resultName = word::null ); + //- No copy construct + fieldExpression(const fieldExpression&) = delete; + + //- No copy assignment + void operator=(const fieldExpression&) = delete; + //- Destructor virtual ~fieldExpression() = default; diff --git a/src/functionObjects/field/fieldExtents/fieldExtents.C b/src/functionObjects/field/fieldExtents/fieldExtents.C index 769cd5e27c0728fb9c483ef84bee5f78186d9360..965520a6408d7a0618ddd4543cfb8954e33e933e 100644 --- a/src/functionObjects/field/fieldExtents/fieldExtents.C +++ b/src/functionObjects/field/fieldExtents/fieldExtents.C @@ -126,10 +126,10 @@ bool Foam::functionObjects::fieldExtents::read(const dictionary& dict) { if (fvMeshFunctionObject::read(dict) && writeFile::read(dict)) { - threshold_ = dict.get<scalar>("threshold"); - dict.readIfPresent<bool>("internalField", internalField_); + threshold_ = dict.get<scalar>("threshold"); + dict.readIfPresent<vector>("referencePosition", C0_); patchIDs_.clear(); diff --git a/src/functionObjects/field/fieldExtents/fieldExtents.H b/src/functionObjects/field/fieldExtents/fieldExtents.H index 18f6b270a8893df2fbe39936f68e2564ea177696..d042870fa3a83798a67764bf89dcc6bc84ae68b5 100644 --- a/src/functionObjects/field/fieldExtents/fieldExtents.H +++ b/src/functionObjects/field/fieldExtents/fieldExtents.H @@ -30,52 +30,72 @@ Group grpFieldFunctionObjects Description - Calculates the spatial minimum and maximum extents of a field + Computes the spatial minimum and maximum extents of an input field. The extents are derived from the bound box limits after identifying the locations where field values exceed the user-supplied threshold value. + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | - | - + \endtable + Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim fieldExtents1 { - type fieldExtents; - libs (fieldFunctionObjects); + // Mandatory entries (unmodifiable) + type fieldExtents; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + fields (<field1> <field2> ... <fieldN>); + threshold 0.5; + + // Optional entries (runtime modifiable) + internalField true; + referencePosition (0 0 0); + + // Optional (inherited) entries ... - writeToFile yes; - log yes; - fields (alpha); - threshold 0.5; - patches (); } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: fieldExtents | yes | - writeToFile | write extents data to file | no | yes - log | write extents data to standard output | no | yes - internalField | Process the internal field | no | yes - threshold | Field value to identify extents boundary | yes | - referencePosition | Reference position | no | (0 0 0) - fields | list of fields to process | yes | - patches | list of patches to process | no | \<all patches\> + Property | Description | Type | Req'd | Dflt + type | Type name: fieldExtents | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + threshold | Value to identify extents boundary | scalar | yes | - + fields | List of operand fields | wordList | yes | - + internalField | Flag to process the internal field | bool | no | true + referencePosition | Reference position | vector | no | (0 0 0) + patches | List of patches to process | wordList | no | \<all patches\> \endtable - Output data is written to the file \<timeDir\>/fieldExtents.dat + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. Note For non-scalar fields, the magnitude of the field is employed and compared - to the threshold value. + to the value of \c threshold. See also - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::fieldExtents SourceFiles fieldExtents.C + fieldExtentsTemplates.C \*---------------------------------------------------------------------------*/ @@ -102,9 +122,10 @@ class fieldExtents public fvMeshFunctionObject, public writeFile { + protected: - // Protected data + // Protected Data //- Flag to write the internal field extents bool internalField_; @@ -112,7 +133,7 @@ protected: //- Threshold value scalar threshold_; - //- Reference position; default = (0 0 0) + //- Reference position point C0_; //- Fields to assess @@ -142,12 +163,6 @@ protected: const bool calcMag = false ); - //- No copy construct - fieldExtents(const fieldExtents&) = delete; - - //- No copy assignment - void operator=(const fieldExtents&) = delete; - public: @@ -165,6 +180,12 @@ public: const dictionary& dict ); + //- No copy construct + fieldExtents(const fieldExtents&) = delete; + + //- No copy assignment + void operator=(const fieldExtents&) = delete; + //- Destructor virtual ~fieldExtents() = default; diff --git a/src/functionObjects/field/fieldMinMax/fieldMinMax.H b/src/functionObjects/field/fieldMinMax/fieldMinMax.H index 8d8ae94cfb0935b2a89db68542e8cfe4f1029f33..e67ce2ada63639fa118a5233d4b5f12ed4c7687d 100644 --- a/src/functionObjects/field/fieldMinMax/fieldMinMax.H +++ b/src/functionObjects/field/fieldMinMax/fieldMinMax.H @@ -31,45 +31,66 @@ Group grpFieldFunctionObjects Description - Calculates the value and location of scalar minimum and maximum for a list - of user-specified fields. + Computes the values and locations of field minima and maxima. + These are good indicators of calculation performance, e.g. to confirm that + predicted results are within expected bounds, or how well a case is + converging. - For variables with a rank greater than zero, either the min/max of a - component value or the magnitude is reported. When operating in parallel, - the processor owning the value is also given. + Multiple fields can be processed, where for rank > 0 primitives, e.g. + vectors and tensors, the extrema can be calculated per component, or by + magnitude. In addition, spatial location and local processor index are + included in the output. + + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | - | - + \endtable Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim fieldMinMax1 { + // Mandatory entries (unmodifiable) type fieldMinMax; libs (fieldFunctionObjects); - ... - writeToFile yes; - log yes; - location yes; + + // Mandatory entries (runtime modifiable) mode magnitude; - fields (U p); + fields (<field1> <field2> ... <fieldN>); + + // Optional entries (runtime modifiable) + location true; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: fieldMinMax | yes | - writeToFile | write min/max data to file | no | yes - log | write min/max data to standard output | no | yes - location | write location of the min/max value | no | yes - mode | calculation mode: magnitude or component | no | magnitude - fields | list of fields to process | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: fieldMinMax | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | List of operand fields | wordList | yes | - + location | Write location of the min/max value | bool | no | true + mode | Calculation mode: magnitude or component | word | no | magnitude \endtable - Output data is written to the file \<timeDir\>/fieldMinMax.dat + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::fieldMinMax SourceFiles fieldMinMax.C @@ -103,9 +124,10 @@ class fieldMinMax public fvMeshFunctionObject, public writeFile { + public: - // Public enumerations + // Public Enumerations enum modeType { @@ -116,12 +138,12 @@ public: protected: - // Protected data + // Protected Data //- Mode type names static const Enum<modeType> modeTypeNames_; - //- Write location of min/max values? + //- Flag to write location of min/max values bool location_; //- Mode for min/max - only applicable for ranks > 0 @@ -153,12 +175,6 @@ protected: //- Output file header information virtual void writeFileHeader(Ostream& os); - //- No copy construct - fieldMinMax(const fieldMinMax&) = delete; - - //- No copy assignment - void operator=(const fieldMinMax&) = delete; - //- Calculate the field min/max for a given field type template<class Type> void calcMinMaxFieldType @@ -192,6 +208,12 @@ public: const dictionary& dict ); + //- No copy construct + fieldMinMax(const fieldMinMax&) = delete; + + //- No copy assignment + void operator=(const fieldMinMax&) = delete; + //- Destructor virtual ~fieldMinMax() = default; diff --git a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C index 4ba4234b26cd9cece17f6d9325b0bd2c39b84f9b..f981f090d00960afae22ae097d9125d454d21fb5 100644 --- a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C +++ b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C @@ -54,11 +54,11 @@ Foam::functionObjects::fieldValue::fieldValue : fvMeshFunctionObject(name, runTime, dict), writeFile(obr_, name, valueType, dict), + writeFields_(false), + regionName_(word::null), scaleFactor_(1.0), dict_(dict), - regionName_(word::null), - fields_(), - writeFields_(false) + fields_() { read(dict); } @@ -74,22 +74,16 @@ Foam::functionObjects::fieldValue::fieldValue : fvMeshFunctionObject(name, obr, dict), writeFile(obr_, name, valueType, dict), + writeFields_(false), + regionName_(word::null), scaleFactor_(1.0), dict_(dict), - regionName_(word::null), - fields_(), - writeFields_(false) + fields_() { read(dict); } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::fieldValue::~fieldValue() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::fieldValue::read(const dictionary& dict) @@ -102,9 +96,9 @@ bool Foam::functionObjects::fieldValue::read(const dictionary& dict) fvMeshFunctionObject::read(dict); writeFile::read(dict); - dict.readEntry("fields", fields_); dict.readEntry("writeFields", writeFields_); - scaleFactor_ = dict.getOrDefault<scalar>("scaleFactor", 1); + scaleFactor_ = dict.getOrDefault<scalar>("scaleFactor", 1.0); + dict.readEntry("fields", fields_); return true; } diff --git a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H index db8fa31a06f62df7caaf4523e2df475b0d8f9cac..5e008f622894dba2ec760ebd539a9e6c7caa5f03 100644 --- a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H +++ b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H @@ -31,15 +31,46 @@ Group grpFieldFunctionObjects Description - Base class for field value-based function objects. + Intermediate class for handling field value-based function objects. + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + <userDefinedSubDictName1> + { + // Mandatory and other optional entries + ... + + // Mandatory (inherited) entries (runtime modifiable) + fields (<field1> <field2> ... <fieldN>); + + // Optional (inherited) entries (runtime modifiable) + writeFields false; + scaleFactor 1.0; + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + fields | Names of operand fields | wordList | yes | - + writeFields | Flag to output field values | bool | no | false + scaleFactor | Scaling factor | scalar | no | 1.0 + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink See also - Foam::functionObject - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::fieldValue SourceFiles fieldValue.C + fieldValueTemplates.C \*---------------------------------------------------------------------------*/ @@ -70,23 +101,23 @@ class fieldValue protected: - // Protected data + // Protected Data - //- Optional scaling factor + //- Flag to output field values + bool writeFields_; + + //- Name of region (patch, zone, etc.) + word regionName_; + + //- Scaling factor scalar scaleFactor_; //- Construction dictionary dictionary dict_; - //- Name of region (patch, zone, etc.) - word regionName_; - - //- List of field names to operate on + //- Names of operand fields wordList fields_; - //- Output field values flag - bool writeFields_; - // Protected Member Functions @@ -151,7 +182,7 @@ public: //- Destructor - virtual ~fieldValue(); + virtual ~fieldValue() = default; // Member Functions diff --git a/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C b/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C index 55819728b44c7f0809b1c723b9231f6a00e1dd46..09f4f91833a5cbc207f075a9e13177647590b50d 100644 --- a/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C +++ b/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2015-2017 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -112,12 +112,6 @@ Foam::functionObjects::fieldValues::fieldValueDelta::fieldValueDelta } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::fieldValues::fieldValueDelta::~fieldValueDelta() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::fieldValues::fieldValueDelta::read diff --git a/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H b/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H index e77bb75e1b93b7c035e5262fa2f768d726beb147..8f6eea9cb988a96136abc47de9140ee569f7472f 100644 --- a/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H +++ b/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H @@ -31,20 +31,22 @@ Group grpFieldFunctionObjects Description - Provides an operation between two 'field value' function objects. + Computes a selected operation between two \c fieldValue function objects. - The operation is applied to all results of each fieldValue object. + The operation is applied to all results of each \c fieldValue object. Accordingly, each object must generate the same number and type of results. Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim fieldValueDelta1 { + // Mandatory entries (unmodifiable) type fieldValueDelta; libs (fieldFunctionObjects); - operation subtract; + // Mandatory entries (runtime modifiable) + operation subtract; region1 { ... @@ -53,16 +55,23 @@ Usage { ... } + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: fieldValueDelta | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: fieldValueDelta | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + operation | Operation type to apply to values | word | yes | - + region1 | Region1 properties | dict | yes | - + region2 | Region2 properties | dict | yes | - \endtable - The \c operation is one of: + Options for the \c operation entry: \plaintable add | add subtract | subtract @@ -71,14 +80,19 @@ Usage average | average \endplaintable + The inherited entries are elaborated in: + - \link fieldValue.H \endlink + + Usage by the \c postProcess utility is not available. + See also - Foam::functionObject - Foam::functionObjects::fieldValue - Foam::functionObjects::regionFunctionObject - Foam::functionObjects::writeFile + - Foam::functionObject + - Foam::functionObjects::fieldValue + - ExtendedCodeGuide::functionObjects::field::fieldValueDelta SourceFiles fieldValueDelta.C + fieldValueDeltaTemplates.C \*---------------------------------------------------------------------------*/ @@ -125,7 +139,7 @@ public: private: - // Private data + // Private Data //- Operation to apply to values operationType operation_; @@ -176,9 +190,15 @@ public: const dictionary& dict ); + //- No copy construct + fieldValueDelta(const fieldValueDelta&) = delete; + + //- No copy assignment + void operator=(const fieldValueDelta&) = delete; + //- Destructor - virtual ~fieldValueDelta(); + virtual ~fieldValueDelta() = default; // Public Member Functions diff --git a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.H b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.H index f6d0ff0a14553684f157b173984e5799bfd54e02..1dde638e5588f43cb4d1b31b7a4dd0af2d9530af 100644 --- a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.H +++ b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.H @@ -31,120 +31,137 @@ Group grpFieldFunctionObjects Description - Provides a 'face regionType' variant of the fieldValues function object. + Provides a 'face regionType' variant of the \c fieldValues function object. Given a list of user-specified fields and a selection of mesh (or general surface) faces, a number of operations can be performed, such as sums, averages and integrations. For example, to calculate the volumetric or mass flux across a patch, - apply the 'sum' operator to the flux field (typically \c phi) + apply the 'sum' operator to the flux field (typically \c phi). Usage - Examples of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim - movingWallPatch + surfaceFieldValuePatch1 { + // Mandatory entries (unmodifiable) type surfaceFieldValue; libs (fieldFunctionObjects); - log true; - writeControl writeTime; - writeFields false; - + // Mandatory entries (runtime modifiable) + fields (<field1> <field2> ... <fieldN>); + operation <operationType>; regionType patch; - name movingWall; + name <patch>; + + // Optional entries (runtime modifiable) + postOperation none; + weightField alpha1; + scaleFactor 1.0; + writeArea false; + surfaceFormat none; - operation areaAverage; - fields (p phi U); + // Optional (inherited) entries + ... } - surfaceFieldValue1 + surfaceFieldValueFaceZone1 { + // Mandatory entries (unmodifiable) type surfaceFieldValue; libs (fieldFunctionObjects); - log true; - writeControl writeTime; - writeFields true; - - surfaceFormat none; + // Mandatory entries (runtime modifiable) + fields (<field1> <field2> ... <fieldN>); + operation <operationType>; regionType faceZone; - name f0; + name <faceZone>; - operation sum; + // Optional entries (runtime modifiable) + postOperation none; weightField alpha1; - fields (p phi U); + scaleFactor 1.0; + writeArea false; + surfaceFormat none; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default - type | Type name: surfaceFieldValue | yes | - log | Write data to standard output | no | no - regionType | Face regionType: see below | yes | - name | Name for regionType | yes | - operation | Operation to perform | yes | - postOperation | Post-operation to perform | no | none - fields | List of fields to operate on | yes | - weightField | Name of field to apply weighting | no | - scaleFactor | Output value scaling factor | no | 1 - writeArea | Write the surface area | no | - writeFields | Write the region field values | yes | - surfaceFormat | Output value format | no | none + Property | Description | Type | Req'd | Dflt + type | Type name: surfaceFieldValue | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of operand fields | wordList | yes | - + regionType | Face regionType: see below | word | yes | - + name | Name for regionType | word | yes | - + operation | Operation type: see below | word | yes | - + postOperation | Post-operation type: see below | word | no | none + weightField | Name of field to apply weighting | word | no | none + scaleFactor | Output value scaling factor | scalar | no | 1.0 + writeArea | Write the surface area | bool | no | false + surfaceFormat | Output value format | word <!-- + --> | conditional on writeFields | none \endtable - Where \c regionType is defined by + The inherited entries are elaborated in: + - \link fieldValue.H \endlink + + Options for the \c regionType entry: \plaintable - faceZone | The \b name entry to specify the faceZone - patch | The \b name entry to specify the patch - functionObjectSurface | The \b name entry to specify a polySurface - sampledSurface | A \b sampledSurfaceDict sub-dictionary and \b name + faceZone | The \b name entry to specify the faceZone + patch | The \b name entry to specify the patch + functionObjectSurface | The \b name entry to specify a polySurface + sampledSurface | A \b sampledSurfaceDict sub-dictionary and \b name \endplaintable - The \c operation is one of: + Options for the \c operation entry: \plaintable - none | no operation - min | minimum - max | maximum - sum | sum - sumMag | sum of component magnitudes - sumDirection | sum values that are positive in given direction - sumDirectionBalance | sum of balance of values in given direction - average | ensemble average - areaAverage | area-weighted average - areaIntegrate | area integral - CoV | coefficient of variation: standard deviation/mean - areaNormalAverage | area-weighted average in face normal direction - areaNormalIntegrate | area-weighted integral in face normal directon - uniformity | uniformity index - weightedSum | weighted sum - weightedAverage | weighted average - weightedAreaAverage | weighted area average - weightedAreaIntegrate | weighted area integral - weightedUniformity | weighted uniformity index - absWeightedSum | sum using absolute weighting - absWeightedAverage | average using absolute weighting - absWeightedAreaAverage | area average using absolute weighting - absWeightedAreaIntegrate | area integral using absolute weighting - absWeightedUniformity | uniformity index using absolute weighting + none | no operation + min | minimum + max | maximum + sum | sum + sumMag | sum of component magnitudes + sumDirection | sum values that are positive in given direction + sumDirectionBalance | sum of balance of values in given direction + average | ensemble average + areaAverage | area-weighted average + areaIntegrate | area integral + CoV | coefficient of variation: standard deviation/mean + areaNormalAverage | area-weighted average in face normal direction + areaNormalIntegrate | area-weighted integral in face normal directon + uniformity | uniformity index + weightedSum | weighted sum + weightedAverage | weighted average + weightedAreaAverage | weighted area average + weightedAreaIntegrate | weighted area integral + weightedUniformity | weighted uniformity index + absWeightedSum | sum using absolute weighting + absWeightedAverage | average using absolute weighting + absWeightedAreaAverage | area average using absolute weighting + absWeightedAreaIntegrate | area integral using absolute weighting + absWeightedUniformity | uniformity index using absolute weighting \endplaintable - The \c postOperation is one of: + Options for the \c postOperation entry: \plaintable none | No additional operation after calculation mag | Component-wise \c mag() after normal operation sqrt | Component-wise \c sqrt() after normal operation \endplaintable + Usage by the \c postProcess utility is not available. + Note - - The values reported by the areaNormalAverage and areaNormalIntegrate + - The values reported by the \c areaNormalAverage and \c areaNormalIntegrate operations are written as the first component of a field with the same rank as the input field. - - Faces on empty patches get ignored - - If the field is a volField the \c faceZone can only consist of boundary - faces + - Faces on empty patches get ignored. + - If the field is a volField the \c faceZone + can only consist of boundary faces. - Using \c functionObjectSurface: - The keyword %subRegion should not be used to select surfaces. Instead specify the regionType 'functionObjectSurface' and provide @@ -159,7 +176,7 @@ Note - take care when using isoSurfaces - these might have duplicate triangles and so integration might be wrong - Uniformity + Uniformity: \f[ UI(\phi) = 1 - \frac{1}{2 \overline{\phi} A} \int{\left| W \phi \cdot \hat{n} - \bar{W} \bar{\phi}\right| d\vec{A}} @@ -171,12 +188,13 @@ Note \f$ \phi = \vec{U} \f$. A scalar concentration uniformity index is calculated with either - \f$ \rho \vec{U} \f$ or \f$ \vec{U} \f$ for weighting and + \f$ \rho \vec U \f$ or \f$ \vec U \f$ for weighting and \f$ \phi = conc \f$. See also - Foam::fieldValues - Foam::functionObject + - Foam::functionObject + - Foam::functionObjects::fieldValues::fieldValue + - ExtendedCodeGuide::functionObjects::field::surfaceFieldValue SourceFiles surfaceFieldValue.C @@ -556,6 +574,12 @@ public: const dictionary& dict ); + //- No copy construct + surfaceFieldValue(const surfaceFieldValue&) = delete; + + //- No copy assignment + void operator=(const surfaceFieldValue&) = delete; + //- Destructor virtual ~surfaceFieldValue() = default; diff --git a/src/functionObjects/field/fieldValues/volFieldValue/volFieldValue.H b/src/functionObjects/field/fieldValues/volFieldValue/volFieldValue.H index 499f7196a78e73278d9abc535253a5b2acb2afe5..a3bc3b4edf30ab997a1ee8d9e35adbcf6f9f1abe 100644 --- a/src/functionObjects/field/fieldValues/volFieldValue/volFieldValue.H +++ b/src/functionObjects/field/fieldValues/volFieldValue/volFieldValue.H @@ -31,88 +31,91 @@ Group grpFieldFunctionObjects Description - Provides a 'volRegion' specialization of the fieldValue function object. + Provides a 'volRegion' specialization of the \c fieldValue function object. Given a list of user-specified fields and a 'volRegion', a number of operations can be performed, such as sums, averages and integrations. Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim volFieldValue1 { + // Mandatory entries (unmodifiable) type volFieldValue; libs (fieldFunctionObjects); - log true; - writeControl writeTime; - writeFields true; - - regionType cellZone; - name c0; - operation volAverage; + // Mandatory entries (runtime modifiable) + fields (<field1> <field2> ... <fieldN>); + operation <operationType>; + regionType <volRegion>; + // Optional entries (runtime modifiable) + postOperation none; weightField alpha1; - fields - ( - p - U - ); + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: volFieldValue | yes | - log | Write data to standard output | no | no - writeFields | Write the region field values | yes | - regionType | volRegion type: see below | yes | - name | Name of volRegion if required | no | - operation | Operation to perform | yes | - postOperation | Post-operation to perform | no | none - weightField | Name of field to apply weighting | no | - fields | List of fields to operate on | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: volFieldValue | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of operand fields | wordList | yes | - + regionType | Face regionType: see below | word | yes | - + name | Name for regionType | word | yes | - + operation | Operation type: see below | word | yes | - + postOperation | Post-operation type: see below | word | no | none + weightField | Name of field to apply weighting | word | no | none \endtable - Where \c regionType is defined by + The inherited entries are elaborated in: + - \link fieldValue.H \endlink + - \link volRegion.H \endlink + + Options for the \c regionType entry: \plaintable - cellZone | requires a 'name' entry to specify the cellZone - all | all cells + cellZone | requires a 'name' entry to specify the cellZone + all | all cells \endplaintable - The \c operation is one of: + Options for the \c operation entry: \plaintable - none | No operation - min | Minimum - max | Maximum - sum | Sum - sumMag | Sum of component magnitudes - average | Ensemble average - volAverage | Volume weighted average - volIntegrate | Volume integral - CoV | Coefficient of variation: standard deviation/mean - weightedSum | Weighted sum - weightedAverage | Weighted average - weightedVolAverage | Weighted volume average - weightedVolIntegrate | Weighted volume integral + none | No operation + min | Minimum + max | Maximum + sum | Sum + sumMag | Sum of component magnitudes + average | Ensemble average + volAverage | Volume weighted average + volIntegrate | Volume integral + CoV | Coefficient of variation: standard deviation/mean + weightedSum | Weighted sum + weightedAverage | Weighted average + weightedVolAverage | Weighted volume average + weightedVolIntegrate | Weighted volume integral \endplaintable - The \c postOperation is one of: + Options for the \c postOperation entry: \plaintable - none | No additional operation after calculation - mag | Component-wise \c mag() after normal operation - sqrt | Component-wise \c sqrt() after normal operation + none | No additional operation after calculation + mag | Component-wise \c mag() after normal operation + sqrt | Component-wise \c sqrt() after normal operation \endplaintable + Usage by the \c postProcess utility is not available. + See also - Foam::functionObjects::fieldValues::fieldValue - Foam::functionObjects::volRegion - Foam::functionObject + - Foam::functionObject + - Foam::functionObjects::fieldValues::fieldValue + - Foam::functionObjects::volRegion SourceFiles volFieldValue.C + volFieldValueTemplates.C \*---------------------------------------------------------------------------*/ @@ -271,10 +274,10 @@ protected: template<class Type> tmp<Field<Type>> filterField(const Field<Type>& field) const; - //- Output file header information virtual void writeFileHeader(Ostream& os) const; + public: //- Declare type-name, virtual type (with debug switch) @@ -299,6 +302,12 @@ public: const dictionary& dict ); + //- No copy construct + volFieldValue(const volFieldValue&) = delete; + + //- No copy assignment + void operator=(const volFieldValue&) = delete; + //- Destructor virtual ~volFieldValue() = default; diff --git a/src/functionObjects/field/fieldsExpression/fieldsExpression.H b/src/functionObjects/field/fieldsExpression/fieldsExpression.H index 9f5c8ed6c17bd647d2761712508dc131925a452b..141fcb845b7601a99bc3798a49fbf60457069c67 100644 --- a/src/functionObjects/field/fieldsExpression/fieldsExpression.H +++ b/src/functionObjects/field/fieldsExpression/fieldsExpression.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,13 +31,38 @@ Group grpFieldFunctionObjects Description - Intermediate class for handling field expressions (add, subtract etc). + Intermediate class for handling field expression function objects + (e.g. \c add, \c subtract etc.) whereinto more than one fields are input. + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + <userDefinedSubDictName1> + { + // Mandatory and other optional entries + ... + + // Optional (inherited) entries (runtime modifiable) + fields (<field1> <field2> ... <fieldN>); + result <fieldResult>; + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + fields | Names of operand fields | wordList | yes | - + result | Names of output fields | wordList | no | \<FO\>(\<f1\>,...) + \endtable See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::fieldsExpression SourceFiles fieldsExpression.C + fieldsExpressionTemplates.C \*---------------------------------------------------------------------------*/ @@ -64,7 +89,7 @@ class fieldsExpression { protected: - // Protected member data + // Protected Member Data //- Names of fields to process wordList fieldNames_; @@ -98,12 +123,6 @@ protected: //- Calculate expression virtual bool calc() = 0; - //- No copy construct - fieldsExpression(const fieldsExpression&) = delete; - - //- No copy assignment - void operator=(const fieldsExpression&) = delete; - public: @@ -123,6 +142,12 @@ public: const word& resultName = word::null ); + //- No copy construct + fieldsExpression(const fieldsExpression&) = delete; + + //- No copy assignment + void operator=(const fieldsExpression&) = delete; + //- Destructor virtual ~fieldsExpression() = default; diff --git a/src/functionObjects/field/flowType/flowType.C b/src/functionObjects/field/flowType/flowType.C index 1e8464d48194be5b813be7b5fbe38d9e2b3b4fc1..ef3da30c2a4e3b726e74120ba642f2f36f4f88d8 100644 --- a/src/functionObjects/field/flowType/flowType.C +++ b/src/functionObjects/field/flowType/flowType.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,13 +37,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(flowType, 0); - - addToRunTimeSelectionTable - ( - functionObject, - flowType, - dictionary - ); + addToRunTimeSelectionTable(functionObject, flowType, dictionary); } } @@ -58,9 +52,9 @@ bool Foam::functionObjects::flowType::calc() const tmp<volTensorField> tgradU(fvc::grad(U)); const volTensorField& gradU = tgradU(); - volScalarField magD(mag(symm(gradU))); - volScalarField magOmega (mag(skew(gradU))); - dimensionedScalar smallMagD("smallMagD", magD.dimensions(), SMALL); + const volScalarField magD(mag(symm(gradU))); + const volScalarField magOmega(mag(skew(gradU))); + const dimensionedScalar smallMagD("sMagD", magD.dimensions(), SMALL); const volTensorField SSplusWW ( @@ -94,10 +88,4 @@ Foam::functionObjects::flowType::flowType } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::flowType::~flowType() -{} - - // ************************************************************************* // diff --git a/src/functionObjects/field/flowType/flowType.H b/src/functionObjects/field/flowType/flowType.H index 0a36fe181c5928d1db38e8d2bb342046774d02b9..fa9179331689d3e2cf258370050aae6762b8cb05 100644 --- a/src/functionObjects/field/flowType/flowType.H +++ b/src/functionObjects/field/flowType/flowType.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,22 +31,70 @@ Group grpFieldFunctionObjects Description - Calculates and writes the flowType of a velocity field. + Computes the flow type indicator of an input velocity field. - The flow type parameter is obtained according to the following equation: + The flow type indicator is obtained according to the following equation: + \f[ + \lambda = \frac{|D| - |\omega|}{|D| + |\omega|} + \f] + + where + \vartable + \lambda | Flow type indicator + D | Symmetric part of the gradient tensor of velocity + \omega | Skew-symmetric part of the gradient tensor of velocity + \endvartable + + The flow type indicator values mean: + \verbatim + -1 = rotational flow + 0 = simple shear flow + 1 = planar extensional flow + \endverbatim + + Operands: + \table + Operand | Type | Location + input | volVectorField | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: \verbatim - |D| - |Omega| - lambda = ------------- - |D| + |Omega| + flowType1 + { + // Mandatory entries (unmodifiable) + type flowType; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: flowType | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink - -1 = rotational flow - 0 = simple shear flow - 1 = planar extensional flow + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func flowType \endverbatim See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fieldExpression + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::flowType SourceFiles flowType.C @@ -94,9 +143,15 @@ public: const dictionary& dict ); + //- No copy construct + flowType(const flowType&) = delete; + + //- No copy assignment + void operator=(const flowType&) = delete; + //- Destructor - virtual ~flowType(); + virtual ~flowType() = default; }; diff --git a/src/functionObjects/field/flux/flux.C b/src/functionObjects/field/flux/flux.C index 93fe1435ab0bc3af05623846f737538f37799196..8ab066bb0039b94d0ab2ccc59719bd99c45a12f2 100644 --- a/src/functionObjects/field/flux/flux.C +++ b/src/functionObjects/field/flux/flux.C @@ -85,10 +85,4 @@ Foam::functionObjects::flux::flux {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::flux::~flux() -{} - - // ************************************************************************* // diff --git a/src/functionObjects/field/flux/flux.H b/src/functionObjects/field/flux/flux.H index 68be9294c553514a531cba96a1645051de00c022..f918031dde02febe59d3e38a28374e904f31766b 100644 --- a/src/functionObjects/field/flux/flux.H +++ b/src/functionObjects/field/flux/flux.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,16 +30,56 @@ Group grpFieldFunctionObjects Description - Calculates the flux of a field. The operation is limited to - surfaceVectorFields and volVectorFields, and the output is a - surfaceScalarField. + Computes the flux of an input vector field. + + Operands: + \table + Operand | Type | Location + input | {vol,surface}VectorField | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | surfaceScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + flowType1 + { + // Mandatory entries (unmodifiable) + type flux; + libs (fieldFunctionObjects); + + // Optional entries (runtime modifiable) + rho none; + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: flux | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + rho | Name of density field | word | no | none + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fieldExpression + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::flux SourceFiles flux.C + fluxTemplates.C \*---------------------------------------------------------------------------*/ @@ -63,6 +103,12 @@ class flux : public fieldExpression { + // Private Data + + //- Name of density field + word rhoName_; + + // Private Member Functions //- Calculate the flux of a volVectorField and register the result @@ -76,9 +122,6 @@ class flux //- Calculate the flux field and return true if successful virtual bool calc(); - //- rho flied name - word rhoName_; - public: @@ -96,9 +139,15 @@ public: const dictionary& dict ); + //- No copy construct + flux(const flux&) = delete; + + //- No copy assignment + void operator=(const flux&) = delete; + //- Destructor - virtual ~flux(); + virtual ~flux() = default; }; diff --git a/src/functionObjects/field/fluxSummary/fluxSummary.C b/src/functionObjects/field/fluxSummary/fluxSummary.C index 6b3f4a7b1441ff99903d53ad060133d4ac9c0a84..ac1d1cd4959076a33a169b30a60aaf2d3fa2350b 100644 --- a/src/functionObjects/field/fluxSummary/fluxSummary.C +++ b/src/functionObjects/field/fluxSummary/fluxSummary.C @@ -46,13 +46,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(fluxSummary, 0); - - addToRunTimeSelectionTable - ( - functionObject, - fluxSummary, - dictionary - ); + addToRunTimeSelectionTable(functionObject, fluxSummary, dictionary); } } @@ -71,7 +65,7 @@ Foam::functionObjects::fluxSummary::modeTypeNames_ }); -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::fluxSummary::isSurfaceMode() const { @@ -975,8 +969,13 @@ bool Foam::functionObjects::fluxSummary::read(const dictionary& dict) needsUpdate_ = true; mode_ = modeTypeNames_.get("mode", dict); phiName_ = dict.getOrDefault<word>("phi", "phi"); +<<<<<<< HEAD scaleFactor_ = dict.getOrDefault<scalar>("scaleFactor", 1); tolerance_ = dict.getOrDefault<scalar>("tolerance", 0.8); +======= + scaleFactor_ = dict.getOrDefault<scalar>("scaleFactor", 1.0); + tolerance_ = dict.getOrDefault<scalar>("tolerance", 0.8); +>>>>>>> DOC: elaborate the usage of function objects zoneNames_.clear(); zoneDirections_.clear(); diff --git a/src/functionObjects/field/fluxSummary/fluxSummary.H b/src/functionObjects/field/fluxSummary/fluxSummary.H index 129e646b6f431df5a96524054dc74123331c355e..f477d68f98134d7c064fccf88f38f486fbbb0c66 100644 --- a/src/functionObjects/field/fluxSummary/fluxSummary.H +++ b/src/functionObjects/field/fluxSummary/fluxSummary.H @@ -31,60 +31,78 @@ Group grpFieldFunctionObjects Description - This function object calculates the flux across selections of faces. + Computes the volumetric- or mass-flux + information across selections of face zones. - Output comprises, per set of faces, the fluxes: - - positive - - negative - - net - - absolute + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<faceN\> + output field | - | - + \endtable Usage + Minimal example by using \c system/controlDict.functions: \verbatim fluxSummary1 { - type fluxSummary; - libs (fieldFunctionObjects); - ... - write yes; - log yes; - mode cellZoneAndDirection; + // Mandatory entries (unmodifiable) + type fluxSummary; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + mode cellZoneAndDirection; cellZoneAndDirection ( (porosity (1 0 0)) ); - scaleFactor 1.2; + + // Optional entries (runtime modifiable) + phi phi; + scaleFactor 1.0; + tolerance 0.8; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default - type | Type name: fluxSummary | yes | - write | Write flux data to file | no | yes - log | Write flux data to standard output | no | yes - mode | Mode to generate faces to test | yes | - scaleFactor | Optional factor to scale result | no | 1 - tolerance | Tolerance for the reference direction | no | 0.8 - phi | Surface flux field | no | phi + Property | Description | Type | Req'd | Dflt + type | Type name: fluxSummary | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + mode | Mode to generate faces to test | word | yes | - + phi | Name of surface flux field | word | no | phi + scaleFactor | Factor to scale results | scalar | no | 1.0 + tolerance | Tolerance for reference direction | scalar | no | 0.8 \endtable - The mode is one of: - - faceZone - - faceZoneAndDirection - - cellZoneAndDirection - - surface - - surfaceAndDirection + Options for the \c mode entry: + \verbatim + faceZone + faceZoneAndDirection + cellZoneAndDirection + surface + surfaceAndDirection + \endverbatim + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink - Output data is written to files of the form \<timeDir\>/\<faceZoneName\>.dat + Usage by the \c postProcess utility is not available. Note - For surface and direction, can use phi = 'U' for determining the fluxes. + For surface and direction, phi='U' can be used for determining the fluxes. See also - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile - Foam::functionObjects::timeControl + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - Foam::functionObjects::timeControl + - ExtendedCodeGuide::functionObjects::field::fluxSummary SourceFiles fluxSummary.C @@ -121,7 +139,7 @@ class fluxSummary { public: - // Public enumerations + // Public Enumerations //- Face mode type enum modeType @@ -144,13 +162,13 @@ protected: //- Track if the surface needs an update bool needsUpdate_; - //- Mode for face determination + //- Mode for face determination/to generate faces to test modeType mode_; - //- Scale factor + //- Factor to scale results scalar scaleFactor_; - //- Name of flux field, default = phi + //- Name of flux field word phiName_; @@ -179,12 +197,12 @@ protected: scalar tolerance_; - // Private Member Functions + // Protected Member Functions //- Check if surface mode instead of zone mode bool isSurfaceMode() const; - //- Check flowType (mass or volume). + //- Check flowType (mass or volume) // Return name on success, fatal error on failure. word checkFlowType ( @@ -252,7 +270,6 @@ protected: //- Initialise - after read(), before write() bool update(); - //- Output file header information virtual void writeFileHeader ( @@ -265,12 +282,6 @@ protected: //- Specialized write for surfaces bool surfaceModeWrite(); - //- No copy construct - fluxSummary(const fluxSummary&) = delete; - - //- No copy assignment - void operator=(const fluxSummary&) = delete; - public: @@ -288,6 +299,12 @@ public: const dictionary& dict ); + //- No copy construct + fluxSummary(const fluxSummary&) = delete; + + //- No copy assignment + void operator=(const fluxSummary&) = delete; + //- Destructor virtual ~fluxSummary() = default; diff --git a/src/functionObjects/field/grad/grad.H b/src/functionObjects/field/grad/grad.H index 4a190aec8a4e70a997a16ff41a4233075854ecf9..d6e90e5b0e6a93ca131395a6c892bb9ecea2595b 100644 --- a/src/functionObjects/field/grad/grad.H +++ b/src/functionObjects/field/grad/grad.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,16 +31,64 @@ Group grpFieldFunctionObjects Description - Calculates the gradient of a field. + Computes the gradient of an input field. The operation is limited to scalar and vector volume or surface fields, and the output is a volume vector or tensor field. + Operands: + \table + Operand | Type | Location + input | {vol,surface}{Scalar,Vector}Field <!-- + --> | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | vol{Vector,Tensor}Field <!-- + --> | $FOAM_CASE/\<time\>/\<outField\> + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + grad1 + { + // Mandatory entries (unmodifiable) + type grad; + libs (fieldFunctionObjects); + + // Mandatory (inherited) entries (runtime modifiable) + field <field>; + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: grad | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + field | Name of the operand field | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func "grad(<field>)" + \endverbatim + See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::grad SourceFiles grad.C + gradTemplates.C \*---------------------------------------------------------------------------*/ @@ -90,6 +138,12 @@ public: const dictionary& dict ); + //- No copy construct + grad(const grad&) = delete; + + //- No copy assignment + void operator=(const grad&) = delete; + //- Destructor virtual ~grad() = default; diff --git a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.C b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.C index d9b48b62d17dfce81e9ec7d3bab0c1373319ce7f..235a42668394c5cb6580c14c3a5d1182a54bad19 100644 --- a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.C +++ b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.C @@ -88,12 +88,6 @@ Foam::functionObjects::heatTransferCoeff::heatTransferCoeff } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::heatTransferCoeff::~heatTransferCoeff() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::heatTransferCoeff::read(const dictionary& dict) diff --git a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.H b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.H index 08cf4258fa73724c9387057f59e14c06e645ebb8..87331b059fd99958c96d90b3129bfb46f71a78f1 100644 --- a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.H +++ b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeff.H @@ -30,21 +30,46 @@ Group grpFieldFunctionObjects Description - This function object calculates and writes the heat transfer coefficient - as a volScalarField for a set of patches. + Computes the heat transfer coefficient as a \c volScalarField + for a set of patches. The field is stored on the mesh database so that it can be retrieved and - used for other applications. Heat transfer coefficient, htc [W/m2/K] - can be evaluated using one of the following modes: - - ReynoldsAnalogy: Reynold's analogy - - localReferenceTemperature: local reference temperature - - fixedReferenceTemperature: specified reference temperature + used for other applications. + + Operands: + \table + Operand | Type | Location + input | - | - + output file | - | - + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable Usage - Example usage for mode 'ReynoldsAnalogy' for incompressible case + Minimal example by using \c system/controlDict.functions: \verbatim - htc + heatTransferCoeff1 + { + // Mandatory entries (unmodifiable) + type heatTransferCoeff; + libs (fieldFunctionObjects); + + field T; + patches ("walls.*"); + + htcModel ReynoldsAnalogy; + UInf (20 0 0); + Cp CpInf; + CpInf 1000; + rho rhoInf; + rhoInf 1.2; + } + \endverbatim + + Example usage for mode \c ReynoldsAnalogy for incompressible case: + \verbatim + heatTransferCoeff1 { + // Mandatory entries (unmodifiable) type heatTransferCoeff; libs (fieldFunctionObjects); @@ -60,7 +85,7 @@ Usage } \endverbatim - Example usage for mode 'ReynoldsAnalogy' for compressible case + Example usage for mode \c ReynoldsAnalogy for compressible case: \verbatim htc { @@ -75,7 +100,7 @@ Usage } \endverbatim - Example usage for mode 'localReferenceTemperature' for compressible case + Example usage for mode \c localReferenceTemperature for compressible case: \verbatim htc { @@ -84,11 +109,11 @@ Usage field T; patches ("walls.*"); - htcModel local; + htcModel localReferenceTemperature; } \endverbatim - Example usage for mode 'fixedReferenceTemperature' for compressible case + Example usage for mode \c fixedReferenceTemperature for compressible case: \verbatim htc { @@ -97,15 +122,30 @@ Usage field T; patches ("walls.*"); - htcModel local; + htcModel fixedReferenceTemperature; TRef 300; } \endverbatim + Options for the \c htcModel entry: + \verbatim + ReynoldsAnalogy | Reynold's analogy + localReferenceTemperature | Local reference temperature + fixedReferenceTemperature | Specified reference temperature + \endverbatim + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Usage by the \c postProcess utility is not available. + See also - Foam::functionObjects::fieldExpression - Foam::heatTransferCoeffModels::fixedReferenceTemperature - Foam::heatTransferCoeffModels::localReferenceTemperature + - Foam::functionObject + - Foam::functionObjects::fieldExpression + - Foam::heatTransferCoeffModels::fixedReferenceTemperature + - Foam::heatTransferCoeffModels::localReferenceTemperature + - ExtendedCodeGuide::functionObjects::field::heatTransferCoeff SourceFiles heatTransferCoeff.C @@ -144,18 +184,10 @@ class heatTransferCoeff protected: - // Protected Member Functions - - //- Calculate the heat transfer coefficient field - // \return true on success + //- Calculate the heat transfer coefficient field and return true + //- if successful virtual bool calc(); - //- No copy construct - heatTransferCoeff(const heatTransferCoeff&) = delete; - - //- No copy assignment - void operator=(const heatTransferCoeff&) = delete; - public: @@ -174,9 +206,15 @@ public: const dictionary& dict ); + //- No copy construct + heatTransferCoeff(const heatTransferCoeff&) = delete; + + //- No copy assignment + void operator=(const heatTransferCoeff&) = delete; + //- Destructor - virtual ~heatTransferCoeff(); + virtual ~heatTransferCoeff() = default; // Member Functions diff --git a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.H b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.H index ebeaf24da60c6101791e0e7c93c722fd75e83e9b..8a19b09766eec16d708b32efd95ce64fb8db37ae 100644 --- a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.H +++ b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.H @@ -104,7 +104,7 @@ public: TypeName("heatTransferCoeffModel"); - // Declare run-time constructor selection table + // Declare runtime constructor selection table declareRunTimeSelectionTable ( diff --git a/src/functionObjects/field/histogram/histogram.C b/src/functionObjects/field/histogram/histogram.C index 06b7bf9b76f3ab6feef92f000f9f6be694da71d1..f6882e71e84f29fb59f08c363b9c3cbaf93e7e8e 100644 --- a/src/functionObjects/field/histogram/histogram.C +++ b/src/functionObjects/field/histogram/histogram.C @@ -95,12 +95,6 @@ Foam::functionObjects::histogram::histogram } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::histogram::~histogram() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::histogram::read(const dictionary& dict) @@ -114,6 +108,14 @@ bool Foam::functionObjects::histogram::read(const dictionary& dict) min_ = dict.getOrDefault<scalar>("min", GREAT); dict.readEntry("nBins", nBins_); + if (nBins_ < 1) + { + FatalErrorInFunction + << "Number of histogram bins = " << nBins_ + << " cannot be negative or zero." + << abort(FatalError); + } + const word format(dict.get<word>("setFormat")); formatterPtr_ = writer<scalar>::New(format); diff --git a/src/functionObjects/field/histogram/histogram.H b/src/functionObjects/field/histogram/histogram.H index b5d191d698ee7f560d3f840a151d98cbc13329cb..acac98c20a37b70b004c8c97dbcdd8fe9cb6ae37 100644 --- a/src/functionObjects/field/histogram/histogram.H +++ b/src/functionObjects/field/histogram/histogram.H @@ -31,45 +31,69 @@ Group grpFieldFunctionObjects Description - Write the volume-weighted histogram of a volScalarField. + Computes the volume-weighted histogram of an input \c volScalarField. + + Operands: + \table + Operand | Type | Location + input | volScalarField | $FOAM_CASE/\<time\>/\<inpField\> + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | - | - + \endtable + + The set written contains two columns, the first the volume averaged values, + the second the raw bin count. Usage - Example: + Minimal example by using \c system/controlDict.functions: \verbatim histogram1 { - type histogram; - libs (fieldFunctionObjects); - - field p; - nBins 100; - min -5; - max 5; - setFormat gnuplot; + // Mandatory entries (unmodifiable) + type histogram; + libs (fieldFunctionObjects); + + // Mandatory (inherited) entries (runtime modifiable) + field p; + nBins 100; + setFormat gnuplot; + + // Optional entries (runtime modifiable) + max 5; + min -5; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: histogram | yes | - field | Field to analyse | yes | - nBins | Number of bins for the histogram | yes| - max | Maximum value sampled | no | field max - min | minimum value sampled | no | 0 - setFormat | Output format | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: histogram | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + field | Name of operand field | word | yes | - + nBins | Number of histogram bins | label | yes | - + setFormat | Output format | word | yes | - + max | Maximum value sampled | scalar | no | fieldMax + min | minimum value sampled | scalar | no | 0.0 \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. + Note - If max is not provided it will use the field's min and max as the bin - extremes. If max is provided but not min it will use 0. The set written - contains two columns, the first the volume averaged values, the second - the raw bin count. + If \c max is not provided it will use the field's min and max as the bin + extremes. If \c max is provided but not \c min it will use 0. See also - Foam::functionObject - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::histogram SourceFiles histogram.C @@ -99,7 +123,10 @@ class histogram public fvMeshFunctionObject, public writeFile { - // Private data + // Private Data + + //- Number of bins + label nBins_; //- Name of field word fieldName_; @@ -110,9 +137,6 @@ class histogram //- Minimum value scalar min_; - //- Number of bins - label nBins_; - //- Output formatter to write autoPtr<writer<scalar>> formatterPtr_; @@ -127,12 +151,6 @@ class histogram const scalarField& absoluteValues ) const; - //- No copy construct - histogram(const histogram&) = delete; - - //- No copy assignment - void operator=(const histogram&) = delete; - public: @@ -150,9 +168,15 @@ public: const dictionary& dict ); + //- No copy construct + histogram(const histogram&) = delete; + + //- No copy assignment + void operator=(const histogram&) = delete; + // Destructor - virtual ~histogram(); + virtual ~histogram() = default; // Member Functions @@ -160,10 +184,10 @@ public: //- Read the histogram data virtual bool read(const dictionary&); - //- Execute, currently does nothing + //- Execute (effectively no-op) virtual bool execute(); - //- Calculate the histogram and write. + //- Calculate the histogram and write // postProcess overrides the usual writeControl behaviour and // forces writing always (used in post-processing mode) virtual bool write(); diff --git a/src/functionObjects/field/interfaceHeight/interfaceHeight.C b/src/functionObjects/field/interfaceHeight/interfaceHeight.C index dec19de61aaa14d85bf69f3664503c327a7a8de8..b08671a5199eb46a663e6fdf591a252374dd97c2 100644 --- a/src/functionObjects/field/interfaceHeight/interfaceHeight.C +++ b/src/functionObjects/field/interfaceHeight/interfaceHeight.C @@ -230,11 +230,11 @@ Foam::functionObjects::interfaceHeight::interfaceHeight : fvMeshFunctionObject(name, runTime, dict), logFiles(obr_, name), - alphaName_("alpha"), liquid_(true), - locations_(), + alphaName_("alpha"), interpolationScheme_("cellPoint"), - direction_(vector::zero) + direction_(vector::zero), + locations_() { read(dict); resetNames({"height", "position"}); @@ -244,12 +244,6 @@ Foam::functionObjects::interfaceHeight::interfaceHeight } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::interfaceHeight::~interfaceHeight() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::interfaceHeight::read(const dictionary& dict) diff --git a/src/functionObjects/field/interfaceHeight/interfaceHeight.H b/src/functionObjects/field/interfaceHeight/interfaceHeight.H index 3b37ca68fada2f3d05de92c6a9bef881c1b7a55f..8cb5357ab0ba2be824dac77dfd17ff4d4cebe079 100644 --- a/src/functionObjects/field/interfaceHeight/interfaceHeight.H +++ b/src/functionObjects/field/interfaceHeight/interfaceHeight.H @@ -29,33 +29,71 @@ Class Description This function object reports the height of the interface above a set of - locations. For each location, it writes the vertical distance of the + locations. + + For each location, it writes the vertical distance of the interface above both the location and the lowest boundary. It also writes the point on the interface from which these heights are computed. It uses an integral approach, so if there are multiple interfaces above or below a location then this method will generate average values. - Example of function object specification: + Operands: + \table + Operand | Type | Location + input | - | - + output file 1 | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/height + output file 2 | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/position + output field | - | - + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: \verbatim interfaceHeight1 { - type interfaceHeight; - libs (fieldFunctionObjects); - alpha alpha.water; - locations ((0 0 0) (10 0 0) (20 0 0)); + // Mandatory entries (unmodifiable) + type interfaceHeight; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + locations ((0 0 0) (10 0 0) (20 0 0)); + + // Optional entries (runtime modifiable) + alpha alpha.water; + liquid true; + direction (1 0 0); + interpolationScheme cellPoint; + + // Optional (inherited) entries + ... } \endverbatim -Usage + where the entries mean: \table - Property | Description | Required | Default value - type | type name | yes | - alpha | name of the alpha field | no | alpha - locations | list of locations to report the height at | yes | - liquid | is the alpha field that of the liquid | no | true - direction | direction of interface | no | g + Property | Description | Type | Req'd | Dflt + type | Type name: interfaceHeight | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + locations | Locations to report the height at | vectorList | yes | - + alpha | Name of alpha field | word | no | alpha + liquid | Flag if the alpha field that of the liquid | bool | no | true + direction | Direction of interface | vector | no | g + interpolationScheme | Interpolation scheme | word | no | cellPoint \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. + +See also + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - Foam::functionObjects::logFile + - ExtendedCodeGuide::functionObjects::field::interfaceHeight + SourceFiles interfaceHeight.C @@ -86,14 +124,11 @@ class interfaceHeight { // Private Data - //- Name of the alpha field - word alphaName_; - //- Is the alpha field that of the liquid under the wave? bool liquid_; - //- List of locations to report the height at - List<point> locations_; + //- Name of the alpha field + word alphaName_; //- Interpolation scheme word interpolationScheme_; @@ -101,6 +136,9 @@ class interfaceHeight //- Direction of interface motion vector direction_; + //- List of locations to report the height at + List<point> locations_; + // Private Member Functions @@ -148,9 +186,15 @@ public: const dictionary& dict ); + //- No copy construct + interfaceHeight(const interfaceHeight&) = delete; + + //- No copy assignment + void operator=(const interfaceHeight&) = delete; + //- Destructor - virtual ~interfaceHeight(); + virtual ~interfaceHeight() = default; // Member Functions diff --git a/src/functionObjects/field/limitFields/limitFields.H b/src/functionObjects/field/limitFields/limitFields.H index 25d73bb49f31cbafe28c2960d227c9d3d4f4c8e7..3d57788bac993fde7de492d887be231ff3ab727d 100644 --- a/src/functionObjects/field/limitFields/limitFields.H +++ b/src/functionObjects/field/limitFields/limitFields.H @@ -30,44 +30,68 @@ Group grpFieldFunctionObjects Description - Limits fields to user-specified min and max bounds + Limits input fields to user-specified min and max bounds. + + Operands: + \table + Operand | Type | Location + input | vol<Type>Field | $FOAM_CASE/<time>/<inpField> + output file | - | - + output field | vol<Type>Field | $FOAM_CASE/<time>/<outField> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. Note - For non-scalar field types, the user limit is used to create a + For non-scalar types of input field, the user limit is used to create a scaling factor using the field magnitudes. Usage - Example of function object specification: - + Minimal example by using \c system/controlDict.functions: \verbatim limitFields1 { - type limitFields; - libs (fieldFunctionObjects); + // Mandatory entries (unmodifiable) + type limitFields; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + fields (U); + limit max; + max 100; + + // Optional (inherited) entries ... - fields (U); - limit max; - max 100; } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default - type | type name: limitFields | yes | - fields | list of fields to process | yes | - limit | bound to limit - see below | yes | - min | min limit value | partly | - max | max limit value | partly | + Property | Description | Type | Req'd | Dflt + type | Type name: limitFields | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | List of fields to process | wordList | yes | - + limit | Bound to limit - see below | word | yes | - + min | Min limit value | scalar | conditional | - + max | Max limit value | scalar | conditional | - \endtable - The \c limit entry can take the value: - - \c min : specify a minimum value - - \c max : specify a maximum value - - \c both : specify a minimum value and a maximum value + Options for the \c limit entry: + \verbatim + min : specify a minimum value + max : specify a maximum value + both : specify a minimum value and a maximum value + \endverbatim + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::limitFields SourceFiles limitFields.C @@ -141,13 +165,6 @@ protected: bool limitField(const word& fieldName); - //- No copy construct - limitFields(const limitFields&) = delete; - - //- No copy assignment - void operator=(const limitFields&) = delete; - - public: //- Runtime type information @@ -164,6 +181,12 @@ public: const dictionary& dict ); + //- No copy construct + limitFields(const limitFields&) = delete; + + //- No copy assignment + void operator=(const limitFields&) = delete; + //- Destructor virtual ~limitFields() = default; diff --git a/src/functionObjects/field/mag/mag.H b/src/functionObjects/field/mag/mag.H index d4031195657234250c8a6c3d32e7fd70626a030a..daba5f2c0aa17e4aacc79f347fb0106a280bdbed 100644 --- a/src/functionObjects/field/mag/mag.H +++ b/src/functionObjects/field/mag/mag.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,18 +31,64 @@ Group grpFieldFunctionObjects Description - Calculates the magnitude of a field. - - The operation can be applied to any volume or surface fields generating a - volume or surface scalar field. - With the %subRegion option, also supports fields on functionObject - surface output (eg, sampledSurfaces). + Computes the magnitude of an input field. + + Operands: + \table + Operand | Type | Location + input | {vol,surface}\<Type\>Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | {vol,surface}ScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. + + With the \c subRegion option, also supports fields on function object + surface output (e.g. sampledSurfaces). + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + mag1 + { + // Mandatory entries (unmodifiable) + type mag; + libs (fieldFunctionObjects); + + // Mandatory (inherited) entries (runtime modifiable) + field <field>; + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: mag | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + field | Name of the operand field | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func "mag(<field>)" + \endverbatim See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::mag SourceFiles mag.C + magTemplates.C \*---------------------------------------------------------------------------*/ @@ -92,6 +138,12 @@ public: const dictionary& dict ); + //- No copy construct + mag(const mag&) = delete; + + //- No copy assignment + void operator=(const mag&) = delete; + //- Destructor virtual ~mag() = default; diff --git a/src/functionObjects/field/magSqr/magSqr.H b/src/functionObjects/field/magSqr/magSqr.H index 164898c1cece0f731e75842f17fc5a71e626efaf..ebacb11f64f739781c165574e4e8c12f7156c263 100644 --- a/src/functionObjects/field/magSqr/magSqr.H +++ b/src/functionObjects/field/magSqr/magSqr.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,18 +31,64 @@ Group grpFieldFunctionObjects Description - Calculates the magnitude of the sqr of a field. - - The operation can be applied to any volume or surface field generating a - volume or surface scalar field. - With the %subRegion option, also supports fields on functionObject - surface output (eg, sampledSurfaces). + Computes the magnitude of the square of an input field. + + Operands: + \table + Operand | Type | Location + input | {vol,surface}\<Type\>Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | {vol,surface}ScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. + + With the \c subRegion option, also supports fields on functionObject + surface output (e.g. sampledSurfaces). + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + magSqr1 + { + // Mandatory entries (unmodifiable) + type magSqr; + libs (fieldFunctionObjects); + + // Mandatory (inherited) entries (runtime modifiable) + field <field>; + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: magSqr | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + field | Name of the operand field | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func "magSqr(<field>)" + \endverbatim See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::magSqr SourceFiles magSqr.C + magSqrTemplates.C \*---------------------------------------------------------------------------*/ @@ -69,12 +115,12 @@ class magSqr // Private Member Functions //- Calculate the magnitude of the sqr of the field - // and register the result + //- and register the result template<class Type> bool calcMagSqr(); //- Calculate the magnitude of the sqr of the field - // and return true if successful + //- and return true if successful virtual bool calc(); @@ -94,6 +140,12 @@ public: const dictionary& dict ); + //- No copy construct + magSqr(const magSqr&) = delete; + + //- No copy assignment + void operator=(const magSqr&) = delete; + //- Destructor virtual ~magSqr() = default; diff --git a/src/functionObjects/field/mapFields/mapFields.C b/src/functionObjects/field/mapFields/mapFields.C index c7045cab293aeeeb9ea9a9ef3ea91a6aa4a12782..66fa2370379f46ab1f23db806b93330c2ed7f876 100644 --- a/src/functionObjects/field/mapFields/mapFields.C +++ b/src/functionObjects/field/mapFields/mapFields.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,13 +36,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(mapFields, 0); - - addToRunTimeSelectionTable - ( - functionObject, - mapFields, - dictionary - ); + addToRunTimeSelectionTable(functionObject, mapFields, dictionary); } } diff --git a/src/functionObjects/field/mapFields/mapFields.H b/src/functionObjects/field/mapFields/mapFields.H index d233071619287921416ef8335aa1117dd660aa74..a29e61e4ccace03ee71660bb7bb42aa8598a4dbd 100644 --- a/src/functionObjects/field/mapFields/mapFields.H +++ b/src/functionObjects/field/mapFields/mapFields.H @@ -30,40 +30,91 @@ Group grpFieldFunctionObjects Description - Map fields from local mesh to secondary mesh at run-time. + Maps input fields from local mesh to secondary mesh at runtime. + + Operands: + \table + Operand | Type | Location + input | {vol,surface}\<Type\>Field <!-- + --> | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | {vol,surface}\<Type\>Field <!-- + --> | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. Usage - Example of function object specification to map fields: + Minimal example by using \c system/controlDict.functions: \verbatim mapFields1 { + // Mandatory entries (unmodifiable) type mapFields; libs (fieldFunctionObjects); - ... + // Mandatory (inherited) entries (runtime modifiable) + fields (<field1> <field2> ... <fieldN>); mapRegion coarseMesh; mapMethod cellVolumeWeight; - consistent yes; + consistent true; + + // Optional entries (runtime modifiable) + // patchMapMethod direct; // AMI-related entry + // enabled if consistent=false + // patchMap (<patchSrc> <patchTgt>); + // cuttingPatches (<patchTgt1> <patchTgt2> ... <patchTgtN>); - fields ("U.*" p); + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: mapFields | yes | - mapRegion | Name of region to map to | yes | - mapMethod | Mapping method | yes | - patchMapMethod | Patch mapping method | no | \<auto\> - consistent | Mapping meshes have consistent boundaries | yes | - fields | List of field names to map | yes | - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: mapFields | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of operand fields | wordList | yes | - + mapRegion | Name of region to map to | word | yes | - + mapMethod | Mapping method | word | yes | - + consistent | Mapping meshes have consistent boundaries | bool | yes | - + patchMapMethod | Patch mapping method for AMI cases | word | no | - + patchMap | Coincident source/target patches in two cases <!-- + --> | wordHashTable | no | - + cuttingPatches | Target patches cutting the source domain <!-- + --> | wordList | no | - \endtable + Options for the \c mapMethod entry: + \verbatim + direct + mapNearest + cellVolumeWeight + correctedCellVolumeWeight + \endverbatim + + Options for the \c patchMapMethod entry: + \verbatim + directAMI + mapNearestAMI + faceAreaWeightAMI + partialFaceAreaWeightAMI + \endverbatim + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. + +See also + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::mapFields SourceFiles mapFields.C + mapFieldsTemplates.C \*---------------------------------------------------------------------------*/ @@ -91,7 +142,7 @@ class mapFields : public fvMeshFunctionObject { - // Private data + // Private Data //- Locally cached map region mesh (map to this mesh) autoPtr<fvMesh> mapRegionPtr_; @@ -105,12 +156,6 @@ class mapFields // Private Member Functions - //- No copy construct - mapFields(const mapFields&) = delete; - - //- No copy assignment - void operator=(const mapFields&) = delete; - //- Helper function to create the mesh-to-mesh interpolation void createInterpolation(const dictionary& dict); @@ -146,6 +191,12 @@ public: const dictionary& dict ); + //- No copy construct + mapFields(const mapFields&) = delete; + + //- No copy assignment + void operator=(const mapFields&) = delete; + //- Destructor virtual ~mapFields() = default; diff --git a/src/functionObjects/field/momentum/momentum.C b/src/functionObjects/field/momentum/momentum.C index 2223f9ca4cdda8057da300ff141fb6d2dde99790..e6d0b76efab90840350702c9225be12a9f3ecf11 100644 --- a/src/functionObjects/field/momentum/momentum.C +++ b/src/functionObjects/field/momentum/momentum.C @@ -430,7 +430,7 @@ bool Foam::functionObjects::momentum::read(const dictionary& dict) UName_ = dict.getOrDefault<word>("U", "U"); pName_ = dict.getOrDefault<word>("p", "p"); rhoName_ = dict.getOrDefault<word>("rho", "rho"); - rhoRef_ = dict.getOrDefault<scalar>("rhoRef", 1); + rhoRef_ = dict.getOrDefault<scalar>("rhoRef", 1.0); hasCsys_ = dict.getOrDefault("cylindrical", false); if (hasCsys_) diff --git a/src/functionObjects/field/momentum/momentum.H b/src/functionObjects/field/momentum/momentum.H index 2a8e0b00b803148f255bba4aeaacc7522114f71e..d0e963e83e5158e1f31d84d568823ee9ff528a77 100644 --- a/src/functionObjects/field/momentum/momentum.H +++ b/src/functionObjects/field/momentum/momentum.H @@ -30,53 +30,70 @@ Group grpFieldFunctionObjects Description - Calculates linear/angular momentum, reporting integral values + Computes linear/angular momentum, reporting integral values and optionally writing the fields. - Data is written into momentum.dat in the - postProcessing/\<functionObjectName\> directory. + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | - | - + \endtable Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim momentum1 { - type momentum; - libs (fieldFunctionObjects); - ... - log yes; + // Mandatory entries (unmodifiable) + type momentum; + libs (fieldFunctionObjects); + // Optional entries (runtime modifiable) regionType all; writeMomentum yes; writePosition yes; writeVelocity yes; + p p; + U U; + rho rho; + rhoRef 1.0; cylindrical true; + origin (0 0 0); + e1 (1 0 0); + e3 (0 0 1); - origin (0 0 0); - e1 (1 0 0); - e3 (0 0 1); + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default - type | Type name: momentum | yes | - log | Log information to standard output | no | no - writeMomentum | Write (linear, angular) momentum fields | no | no - writePosition | Write angular position component fields | no | no - writeVelocity | Write angular velocity fields | no | no - p | Pressure field name | no | p - U | Velocity field name | no | U - rho | Density field name | no | rho - rhoRef | Reference density (incompressible) | no | 1.0 - cylindrical | Use cylindrical coordinates | no | false - origin | Origin for cylindrical coordinates | no | - regionType | Selection type: all/cellSet/cellZone | no | all - name | Name of cellSet/cellZone if required | no | + Property | Description | Type | Req'd | Dflt + type | Type name: momentum | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + regionType | Selection type: all/cellSet/cellZone | word | no | all + writeMomentum | Write (linear, angular) momentum fields | bool | no | no + writePosition | Write angular position component fields | bool | no | no + writeVelocity | Write angular velocity fields | bool | no | no + p | Pressure field name | word | no | p + U | Velocity field name | word | no | U + rho | Density field name | word | no | rho + rhoRef | Reference density (incompressible) | scalar | no | 1.0 + cylindrical | Use cylindrical coordinates | bool | no | no + origin | Origin for cylindrical coordinates | vector | conditional | - + name | Name of cellSet/cellZone if required | word | conditional | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. + Note - For incompressible cases, the value of \c rhoRef is used. - When specifying the cylindrical coordinate system, the rotation @@ -93,11 +110,11 @@ Note \endverbatim See also - Foam::functionObject - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::volRegion - Foam::functionObjects::writeFile - Foam::functionObjects::timeControl + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::volRegion + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::momentum SourceFiles momentum.C @@ -154,7 +171,7 @@ class momentum protected: - // Protected data + // Protected Data //- Integral (linear) momentum vector sumMomentum_; @@ -208,12 +225,6 @@ protected: //- Write momentum data void writeValues(Ostream& os); - //- No copy construct - momentum(const momentum&) = delete; - - //- No copy assignment - void operator=(const momentum&) = delete; - public: @@ -241,6 +252,12 @@ public: const bool readFields = true ); + //- No copy construct + momentum(const momentum&) = delete; + + //- No copy assignment + void operator=(const momentum&) = delete; + //- Destructor virtual ~momentum() = default; diff --git a/src/functionObjects/field/momentumError/momentumError.C b/src/functionObjects/field/momentumError/momentumError.C index 866a8fe18b7c0f518b317e5950f51e6ae3df80c0..00920f545c0a4c462ad0bf10ca328cf54b4fc6b6 100644 --- a/src/functionObjects/field/momentumError/momentumError.C +++ b/src/functionObjects/field/momentumError/momentumError.C @@ -25,19 +25,15 @@ License \*---------------------------------------------------------------------------*/ - #include "momentumError.H" - #include "fvcDiv.H" #include "fvcGrad.H" #include "fvcLaplacian.H" - #include "turbulenceModel.H" #include "turbulentTransportModel.H" #include "turbulentFluidThermoModel.H" #include "addToRunTimeSelectionTable.H" - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -213,4 +209,5 @@ bool Foam::functionObjects::momentumError::write() return true; } + // ************************************************************************* // diff --git a/src/functionObjects/field/momentumError/momentumError.H b/src/functionObjects/field/momentumError/momentumError.H index 98c78dad7c667a7c810448a8a113f0af71ce84ef..63746c52dd05bc70dbad047bc7bb20bc95bf5b07 100644 --- a/src/functionObjects/field/momentumError/momentumError.H +++ b/src/functionObjects/field/momentumError/momentumError.H @@ -30,28 +30,54 @@ Group grpForcesFunctionObjects Description - Produces a balance terms result for the steady momentum equation + Computes balance terms for the steady momentum equation. + + Operands: + \table + Operand | Type | Location + input | - | - + output file | - | - + output field | volVectorField | $FOAM_CASE/\<time\>/\<file\> + \endtable Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim - momErr + momentumError1 { + // Mandatory entries (unmodifiable) type momentumError; + libs (fieldFunctionObjects); + + // Optional entries (runtime modifiable) + p <pName>; + U <UName>; + phi <phiName>; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: momentumError| yes | - p | Pressure field name | no | p - U | Velocity field name | no | U - phi | Flux field name | no | phi + Property | Description | Type | Req'd | Dflt + type | Type name: momentumError | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + p | Name of pressure field | word | no | p + U | Name of velocity field | word | no | U + phi | Name of flux field | word | no | phi \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. + See also - Foam::functionObject - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::momentumError SourceFiles momentumError.C @@ -79,10 +105,9 @@ class momentumError : public fvMeshFunctionObject { - protected: - // Protected data + // Protected Data // Read from dictionary @@ -92,7 +117,7 @@ protected: //- Name of velocity field word UName_; - //- Flux + //- Name of flux field word phiName_; @@ -101,12 +126,6 @@ protected: //- Return the effective viscous stress (laminar + turbulent). tmp<volVectorField> divDevRhoReff(); - //- No copy construct - momentumError(const momentumError&) = delete; - - //- No copy assignment - void operator=(const momentumError&) = delete; - public: @@ -124,9 +143,17 @@ public: const dictionary& dict ); + //- No copy construct + momentumError(const momentumError&) = delete; + + //- No copy assignment + void operator=(const momentumError&) = delete; + + //- Destructor virtual ~momentumError() = default; + // Member Functions //- Read the forces data diff --git a/src/functionObjects/field/nearWallFields/nearWallFields.H b/src/functionObjects/field/nearWallFields/nearWallFields.H index 4ea4b8c636ac82ac57b23f36bf75d4d7b5a35682..298867247774685368e8ee87c16f1b02c1d2838e 100644 --- a/src/functionObjects/field/nearWallFields/nearWallFields.H +++ b/src/functionObjects/field/nearWallFields/nearWallFields.H @@ -31,53 +31,62 @@ Group grpFieldFunctionObjects Description - Samples near-patch volume fields. + Samples near-patch volume fields within an input distance range. - Fields are stored - - every time step the field is updated with new values - - at output it writes the fields + Operands: + \table + Operand | Type | Location + input | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<outField\> + \endtable - This functionObject can either be used - - to calculate a new field as a post-processing step or - - since the fields are registered, used in another functionObject + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim nearWallFields1 { - type nearWallFields; - libs (fieldFunctionObjects); - - writeControl writeTime; - + // Mandatory entries (unmodifiable) + type nearWallFields; + libs (fieldFunctionObjects); fields ( - (p pNear) - (U UNear) + (<field1> <outField1>) + (<field2> <outField2>) ); + patches (<patch1> <patch2> ... <patchN>); + distance 0.01; - patches (movingWall); - - distance 0.13; + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: nearWallFields | yes | - fields | list of fields with corresponding output field names | yes | - patches | list of patches to sample | yes | - distance | distance from patch to sample | yes | - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: nearWallFields | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of input-output fields | wordHashTable | yes | - + patches | Names of patches to sample | wordList | yes | - + distance | Wall-normal distance from patch to sample | scalar | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. + See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::nearWallFields SourceFiles nearWallFields.C + nearWallFieldsTemplates.C \*---------------------------------------------------------------------------*/ @@ -106,16 +115,13 @@ class nearWallFields { protected: - // Protected Member Data + // Protected Data // Read from dictionary //- Fields to process (input-name output-name) List<Tuple2<word, word>> fieldSet_; - //- Switch to send output to Info as well as to file - Switch log_; - //- Patches to sample labelHashSet patchSet_; @@ -176,12 +182,6 @@ protected: ) const; - //- No copy construct - nearWallFields(const nearWallFields&) = delete; - - //- No copy assignment - void operator=(const nearWallFields&) = delete; - public: //- Runtime type information @@ -199,6 +199,12 @@ public: const dictionary& dict ); + //- No copy construct + nearWallFields(const nearWallFields&) = delete; + + //- No copy assignment + void operator=(const nearWallFields&) = delete; + //- Destructor virtual ~nearWallFields() = default; diff --git a/src/functionObjects/field/particleDistribution/particleDistribution.C b/src/functionObjects/field/particleDistribution/particleDistribution.C index bfe6acbac424dc88b1120beb6ec26007097f892a..491c1f20a078c3b3a39dde2ec1a3514bcf67c5f5 100644 --- a/src/functionObjects/field/particleDistribution/particleDistribution.C +++ b/src/functionObjects/field/particleDistribution/particleDistribution.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,7 +38,6 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(particleDistribution, 0); - addToRunTimeSelectionTable ( functionObject, @@ -61,21 +60,15 @@ Foam::functionObjects::particleDistribution::particleDistribution fvMeshFunctionObject(name, runTime, dict), writeFile(runTime, name), cloudName_("unknown-cloudName"), - nameVsBinWidth_(), tagFieldName_("none"), rndGen_(), + nameVsBinWidth_(), writerPtr_(nullptr) { read(dict); } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::particleDistribution::~particleDistribution() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::particleDistribution::read(const dictionary& dict) @@ -83,8 +76,8 @@ bool Foam::functionObjects::particleDistribution::read(const dictionary& dict) if (fvMeshFunctionObject::read(dict) && writeFile::read(dict)) { dict.readEntry("cloud", cloudName_); - dict.readEntry("nameVsBinWidth", nameVsBinWidth_); dict.readIfPresent("tagField", tagFieldName_); + dict.readEntry("nameVsBinWidth", nameVsBinWidth_); const word format(dict.get<word>("setFormat")); writerPtr_ = writer<scalar>::New(format); diff --git a/src/functionObjects/field/particleDistribution/particleDistribution.H b/src/functionObjects/field/particleDistribution/particleDistribution.H index 36b5debc882c45ab66d0f03575e17cbd5c6e326f..28f0b363d07d3944bfafb338d70c220b4e947bf3 100644 --- a/src/functionObjects/field/particleDistribution/particleDistribution.H +++ b/src/functionObjects/field/particleDistribution/particleDistribution.H @@ -32,40 +32,66 @@ Group Description Generates a particle distribution for lagrangian data at a given time. + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | - | - + \endtable + Usage + Minimal example by using \c system/controlDict.functions: \verbatim particleDistribution1 { + // Mandatory entries (unmodifiable) type particleDistribution; libs (fieldFunctionObjects); - ... - cloud "myCloud"; + + // Mandatory entries (runtime modifiable) + cloud <cloudName>; nameVsBinWidth ( (d 0.1) (U 10) ); setFormat raw; + + // Optional entries (runtime modifiable) + tagField none; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: particleDistribution | yes | - cloud | Name of cloud to process | Yes | - nameVsBinWidth | List of cloud field vs bin width | Yes | - tagField | Name of cloud field to use to group particles | no | none - setFormat | Output format | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: particleDistribution | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + cloud | Name of cloud to process | word | yes | - + nameVsBinWidth | List of cloud field-bin width | wordHashTable | yes | - + setFormat | Output format | word | yes | - + tagField | Name of cloud field to use group particles | word | no | none \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. + See also - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile - Foam::functionObjects::timeControl + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::particleDistribution SourceFiles particleDistribution.C + particleDistributionTemplates.C \*---------------------------------------------------------------------------*/ @@ -97,20 +123,20 @@ class particleDistribution { protected: - // Protected data + // Protected Data //- Cloud name word cloudName_; - //- List of field name vs. bin width - List<Tuple2<word, scalar>> nameVsBinWidth_; - //- Tag field name - used to filter the particles into groups word tagFieldName_; //- Random number generator - used by distribution models Random rndGen_; + //- List of field name vs. bin width + List<Tuple2<word, scalar>> nameVsBinWidth_; + //- Writer autoPtr<writer<scalar>> writerPtr_; @@ -135,12 +161,6 @@ protected: const List<DynamicList<label>>& addr ); - //- No copy construct - particleDistribution(const particleDistribution&) = delete; - - //- No copy assignment - void operator=(const particleDistribution&) = delete; - public: @@ -158,9 +178,15 @@ public: const dictionary& dict ); + //- No copy construct + particleDistribution(const particleDistribution&) = delete; + + //- No copy assignment + void operator=(const particleDistribution&) = delete; + //- Destructor - virtual ~particleDistribution(); + virtual ~particleDistribution() = default; // Member Functions diff --git a/src/functionObjects/field/pressure/pressure.C b/src/functionObjects/field/pressure/pressure.C index 60dad199d3d24f44e571a8eaa0ce84917789a25e..f4bd0ba3e9115bfc83f4b33044137cf8f604fa89 100644 --- a/src/functionObjects/field/pressure/pressure.C +++ b/src/functionObjects/field/pressure/pressure.C @@ -43,6 +43,7 @@ namespace functionObjects } } + const Foam::Enum < Foam::functionObjects::pressure::mode @@ -56,6 +57,7 @@ Foam::functionObjects::pressure::modeNames { TOTAL_COEFF, "totalCoeff" }, }); + const Foam::Enum < Foam::functionObjects::pressure::hydrostaticMode @@ -67,6 +69,7 @@ Foam::functionObjects::pressure::hydrostaticModeNames { SUBTRACT, "subtract" }, }); + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // Foam::word Foam::functionObjects::pressure::resultName() const @@ -284,7 +287,6 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::calcPressure return tresult; } - return tresult; } @@ -439,14 +441,13 @@ bool Foam::functionObjects::pressure::read(const dictionary& dict) } - if (mode_ & COEFF) { dict.readEntry("pInf", pInf_); dict.readEntry("UInf", UInf_); dict.readEntry("rhoInf", rhoInf_); - scalar zeroCheck = 0.5*rhoInf_*magSqr(UInf_) + pInf_; + const scalar zeroCheck = 0.5*rhoInf_*magSqr(UInf_) + pInf_; if (mag(zeroCheck) < ROOTVSMALL) { diff --git a/src/functionObjects/field/pressure/pressure.H b/src/functionObjects/field/pressure/pressure.H index be01ff916ac7e55ae2d3645f315e01cc228ef49d..b4823458deec4f61f02292feb08afa1bb67e9573 100644 --- a/src/functionObjects/field/pressure/pressure.H +++ b/src/functionObjects/field/pressure/pressure.H @@ -31,93 +31,122 @@ Group grpFieldFunctionObjects Description - Includes tools to manipulate the pressure into different forms. + Provides several methods to convert an input pressure + field into derived forms, including: - These currently include: - static pressure \f[ p_s = p_{ref} + \rho p_k \f] - total pressure \f[ - p_0 = p_{ref} + p + 0.5 \rho |U|^2 + p_0 = p_{ref} + p + 0.5 \rho |\vec U|^2 \f] - isentropic pressure \f[ - p_i = p*(1 + ((gamma-1)*M^2)/2)^(gamma/(gamma - 1)) + p_i = p*(1 + ((\gamma-1)*M^2)/2)^{(\gamma/(\gamma - 1))} \f] - static pressure coefficient \f[ - Cp = \frac{p_s - p_{\inf}}{0.5 \rho_{\inf} |U_{\inf}|^2} + Cp = \frac{p_s - p_{\inf}}{0.5 \rho_{\inf} |\vec U_{\inf}|^2} \f] - total pressure coefficient \f[ - Cp_0 = \frac{p_0 - p_{\inf}}{0.5 \rho_{\inf} |U_{\inf}|^2} + Cp_0 = \frac{p_0 - p_{\inf}}{0.5 \rho_{\inf} |\vec U_{\inf}|^2} \f] where \vartable - \rho | Density [kg/m3] - U | Velocity [m/s] - \rho_{\inf} | Freestream density [kg/m3] - p_{\inf} | Freestream pressure [Pa] - U_{\inf} | Freestream velocity [m/s] - p_k | Kinematic pressure (p/rho)[m2/s2] - p_s | Statoc pressure [Pa] - p_0 | Total pressure [Pa] - p_{ref} | Reference pressure level [Pa] - p_i | Total isentropic pressure - Cp | Pressure coefficient - Cp_0 | Total pressure coefficient + \rho | Density [kg/m3] + \vec U | Velocity [m/s] + \rho_{\inf} | Freestream density [kg/m3] + p_{\inf} | Freestream pressure [Pa] + U_{\inf} | Freestream velocity [m/s] + p_k | Kinematic pressure (p/rho)[m2/s2] + p_s | Static pressure [Pa] + p_0 | Total pressure [Pa] + p_{ref} | Reference pressure level [Pa] + p_i | Total isentropic pressure + Cp | Pressure coefficient + Cp_0 | Total pressure coefficient + \gamma | Specific heat ratio \endvartable The function object will operate on both kinematic (\f$ p_k \f$) and static - pressure (\f$ p \f$) fields, and the result is written as a - volScalarField. + pressure (\f$ p \f$) fields. + + Operands: + \table + Operand | Type | Location + input | volScalarField | $FOAM_CASE/<time>/<inpField> + output file | - | - + output field | volScalarField | $FOAM_CASE/<time>/<outField> + \endtable Usage - Example of function object specification to calculate pressure coefficient: + Minimal example by using \c system/controlDict.functions: \verbatim pressure1 { - type pressure; - libs (fieldFunctionObjects); + // Mandatory entries (unmodifiable) + type pressure; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + mode <option>; + + // Optional entries (runtime modifiable) + p <pName>; + U <UName>; + rho <rhoName>; + rhoInf 1.0; // enabled if rho=rhoInf + pRef 0.0; + hydroStaticMode none; + g (0 -9.81 0); // enabled if hydroStaticMode != none + hRef 0.0; // enabled if hydroStaticMode != none + pInf 0.0; + UInf (1 0 0); + + // Optional (inherited) entries ... - mode staticCoeff; } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: pressure | yes | - field | Name of the pressure field | no | p - U | Name of the velocity field | no | U - rho | Name of the density field | no | rho - result | Name of the resulting field | no | derived from p - mode | Calculation mode (see below) | yes | - pRef | Reference pressure for total pressure | no | 0 - pInf | Freestream pressure for coefficient calculation | no | - UInf | Freestream velocity for coefficient calculation | no | - rhoInf | Freestream density for coefficient calculation | no | - hydrostaticMode | Hydrostatic contributions (see below) | no | none - g | Gravity vector (see below) | no | - hRef | Reference height (see below) | no | + Property | Description | Type | Req'd | Dflt + type | Type name: pressure | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + mode | Calculation mode (see below) | word | yes | - + p | Name of the pressure field | word | no | p + U | Name of the velocity field | word | no | U + rho | Name of the density field | word | no | rho + rhoInf | Freestream density for coefficient calculation | scalar <!-- + --> | conditional| - + pRef | Reference pressure for total pressure | scalar | no | 0 + hydrostaticMode | Hydrostatic contributions (see below) | word | no | none + g | Gravity vector (see below) | vector | no | - + hRef | Reference height (see below) | scalar | no | - + pInf | Freestream pressure for coefficient calculation | scalar | no | - + UInf | Freestream velocity for coefficient calculation | vector | no | - \endtable - The \c mode entry is used to select the type of pressure that is calculated. - Selections include: - - static - - total - - isentropic - - staticCoeff - - totalCoeff + Options for the \c mode entry: + \verbatim + static | static pressure + total | total pressure + isentropic | isentropic pressure + staticCoeff | static pressure coefficient + totalCoeff | total pressure coefficient + \endverbatim The optional \c hydrostaticMode entry provides handling for the term \f$ \rho (\vec{g} \dot \vec{h})\f$ where options include - - \c none : not included - - \c add : add the term, e.g. to convert from p_rgh to p - - \c subtract : subtract the term, e.g. to convert from p to p_rgh + \verbatim + none | not included + add | add the term, e.g. to convert from p_rgh to p + subtract | subtract the term, e.g. to convert from p to p_rgh + \endverbatim If the \c hydrostaticMode is active, values are also required for gravity, \c g, and reference height, \c hRef. By default these will be @@ -128,10 +157,17 @@ Usage hRef 0; \endverbatim + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fieldExpression + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::pressure SourceFiles pressure.C @@ -191,7 +227,7 @@ public: private: - // Private data + // Private Data //- Calculation mode mode mode_; @@ -199,10 +235,10 @@ private: //- Hydrostatic constribution mode hydrostaticMode hydrostaticMode_; - //- Name of velocity field, default is "U" + //- Name of velocity field word UName_; - //- Name of density field, default is "rho" + //- Name of density field word rhoName_; @@ -294,6 +330,12 @@ public: const dictionary& ); + //- No copy construct + pressure(const pressure&) = delete; + + //- No copy assignment + void operator=(const pressure&) = delete; + //- Destructor virtual ~pressure() = default; diff --git a/src/functionObjects/field/processorField/processorField.C b/src/functionObjects/field/processorField/processorField.C index 95bb2e0b2b6e8d548f02a8cf53f49dc7f9ed0e6e..f1388c08708551f9ac3efa621f137deca5e1b04d 100644 --- a/src/functionObjects/field/processorField/processorField.C +++ b/src/functionObjects/field/processorField/processorField.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -75,12 +76,6 @@ Foam::functionObjects::processorField::processorField } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::processorField::~processorField() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::processorField::read(const dictionary& dict) diff --git a/src/functionObjects/field/processorField/processorField.H b/src/functionObjects/field/processorField/processorField.H index 662362baf6aeeae40200ceb54cc758bd67cae0b1..d4f04e88c967fb6d6c9adafa52896246b32d94ed 100644 --- a/src/functionObjects/field/processorField/processorField.H +++ b/src/functionObjects/field/processorField/processorField.H @@ -32,28 +32,49 @@ Group Description Writes a scalar field whose value is the local processor ID. The output - field name is 'processorID'. + field name is \c processorID. + + Operands: + \table + Operand | Type | Location + input | volScalarField | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim processorField1 { + // Mandatory entries (unmodifiable) type processorField; libs (fieldFunctionObjects); + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: processorField | yes | - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: processorField | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func processorField + \endverbatim + See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::processorField SourceFiles processorField.C @@ -80,21 +101,6 @@ class processorField : public fvMeshFunctionObject { - - //- Result name - word resultName_; - - //- Switch to send output to Info as well as to file - Switch log_; - // Private member functions - - //- No copy construct - processorField(const processorField&) = delete; - - //- No copy assignment - void operator=(const processorField&) = delete; - - public: //- Runtime type information @@ -111,9 +117,15 @@ public: const dictionary& dict ); + //- No copy construct + processorField(const processorField&) = delete; + + //- No copy assignment + void operator=(const processorField&) = delete; + //- Destructor - virtual ~processorField(); + virtual ~processorField() = default; // Member Functions diff --git a/src/functionObjects/field/proudmanAcousticPower/proudmanAcousticPower.C b/src/functionObjects/field/proudmanAcousticPower/proudmanAcousticPower.C index 4077b78801aa6cd2843a3132b178f8f49aef1d02..563268fa9d7068059093004a7b0a2025a1f289ab 100644 --- a/src/functionObjects/field/proudmanAcousticPower/proudmanAcousticPower.C +++ b/src/functionObjects/field/proudmanAcousticPower/proudmanAcousticPower.C @@ -115,9 +115,9 @@ Foam::functionObjects::proudmanAcousticPower::proudmanAcousticPower ) : fvMeshFunctionObject(name, runTime, dict), + alphaEps_(0.1), rhoInf_("0", dimDensity, -1), - aRef_(dimVelocity, Zero), - alphaEps_(0.1) + aRef_(dimVelocity, Zero) { read(dict); @@ -167,9 +167,9 @@ bool Foam::functionObjects::proudmanAcousticPower::read(const dictionary& dict) { if (fvMeshFunctionObject::read(dict)) { + dict.readIfPresent("alphaEps", alphaEps_); rhoInf_.readIfPresent("rhoInf", dict); aRef_.readIfPresent("aRef", dict); - dict.readIfPresent("alphaEps", alphaEps_); return true; } diff --git a/src/functionObjects/field/proudmanAcousticPower/proudmanAcousticPower.H b/src/functionObjects/field/proudmanAcousticPower/proudmanAcousticPower.H index d934b0ecfc97831717e15f64d4f2866cffbc5fde..d2c4299607cae6234523cb097c05310fc5a6d6e4 100644 --- a/src/functionObjects/field/proudmanAcousticPower/proudmanAcousticPower.H +++ b/src/functionObjects/field/proudmanAcousticPower/proudmanAcousticPower.H @@ -30,17 +30,18 @@ Group grpFieldFunctionObjects Description - Calculates the acoustic power due to the volume of isotropic turbulence - using Proudman's formula + Computes the acoustic power due to the volume of isotropic turbulence + using Proudman's formula. - The acoustic power \f$ P_A \f$ [W/m3] in terms of turbulence \f$ k \f$ - and \f$ \epsilon \f$ is given as: + The acoustic power, i.e. \f$ P_A \f$ [\f$W/m^3\f$], in terms of turbulent + kinetic energy, i.e. \f$ k \f$, and turbulent kinetic energy dissipation + rate, i.e. \f$ \epsilon \f$, is given as: \f[ - P_A = alpha_\epsilon \rho \epsilon M_t^5 + P_A = \alpha_\epsilon \rho \epsilon M_t^5 \f] - where \f$ alpha_\epsilon \f$ is a constant (0.1) and + where \f$ \alpha_\epsilon = 0.1 \f$ is a constant and \f[ M_t = \frac{\sqrt{2 k}}{a_0} @@ -50,43 +51,65 @@ Description dB using: \f[ - L_P = 10 \log \frac{P_A}{P_ref} + L_P = 10 \log \frac{P_A}{P_{ref}} \f] - where \f$ P_ref \f$ is a constant (1e-12 W/m3) + where \f$ P_{ref} = 1e^{-12} \f$ [\f$W/m^3\f$] is a constant. + + Operands: + \table + Operand | Type | Location + input | volScalarField | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable Usage - Example of function object specification to calculate the Proudman acoustic - power: + Minimal example by using \c system/controlDict.functions: \verbatim proudmanAcousticPower1 { + // Mandatory entries (unmodifiable) type proudmanAcousticPower; libs (fieldFunctionObjects); - ... - // Required additional entries for incompressible calculations + // Optional entries (runtime modifiable) + alphaEps 0.1; + // For incompressible flow simulations rhoInf 1.225; aRef 340; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default - type | type name: proudmanAcousticPower | yes | - rhoInf | Freestream density (for incompressible) | no | - aRef | Reference speed of sound (for incompressible) | no | - alphaEps | Model coefficient | no | 0.1 + Property | Description | Type | Req'd | Dflt + type | Type name: proudmanAcousticPower | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + rhoInf | Freestream density (for incompressible) | scalar <!-- + --> | conditional | - + aRef | Speed of sound (incompressible) | scalar <!-- + --> | conditional | - + alphaEps | Empirical model coefficient | scalar | no | 0.1 \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. + Note The freestream density and reference speed of sound are only necessary when a thermodynamics package is unavailable, typically for incompressible cases. See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::proudmanAcousticPower SourceFiles proudmanAcousticPower.C @@ -114,19 +137,17 @@ class proudmanAcousticPower : public fvMeshFunctionObject { -private: - // Private Data + //- Empirical model coefficient + scalar alphaEps_; + //- Freestream density (incompressible calcs only) dimensionedScalar rhoInf_; //- Reference speed of sound (incompressible calcs only) dimensionedScalar aRef_; - //- Model coefficient; default = 0.1 - scalar alphaEps_; - // Private Member Functions @@ -153,6 +174,12 @@ public: const dictionary& ); + //- No copy construct + proudmanAcousticPower(const proudmanAcousticPower&) = delete; + + //- No copy assignment + void operator=(const proudmanAcousticPower&) = delete; + //- Destructor virtual ~proudmanAcousticPower() = default; diff --git a/src/functionObjects/field/randomise/randomise.C b/src/functionObjects/field/randomise/randomise.C index a9df1671bdb51c93ba07d18551789dd435425411..219d1a7a48f4d12a34a5e1f8c414991f8e7cfe82 100644 --- a/src/functionObjects/field/randomise/randomise.C +++ b/src/functionObjects/field/randomise/randomise.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -71,12 +72,6 @@ Foam::functionObjects::randomise::randomise } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::randomise::~randomise() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::randomise::read(const dictionary& dict) diff --git a/src/functionObjects/field/randomise/randomise.H b/src/functionObjects/field/randomise/randomise.H index 01232d373f5fc6f5e5b98f3c2e46446fd61ec3ed..5ee9330d2b153970fd43592f8863ebb86136dec0 100644 --- a/src/functionObjects/field/randomise/randomise.H +++ b/src/functionObjects/field/randomise/randomise.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,15 +31,66 @@ Group grpFieldFunctionObjects Description - Adds a random component to a field, with a specified perturbation magnitude. - - The operation can be applied to any volume field. + Adds a random component to an input field, + with a specified perturbation magnitude. + + Operands: + \table + Operand | Type | Location + input | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + randomise1 + { + // Mandatory entries (unmodifiable) + type randomise; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + magPerturbation 0.1; + + // Mandatory (inherited) entries (runtime modifiable) + field <field>; + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: randomise | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + magPerturbation | The magnitude of the perturbation | scalar | yes | - + field | Name of the operand field | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func "randomise(<field>)" + \endverbatim See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fieldExpression + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::randomise SourceFiles randomise.C + randomiseTemplates.C \*---------------------------------------------------------------------------*/ @@ -62,7 +114,7 @@ class randomise : public fieldExpression { - // Private member data + // Private Data //- The magnitude of the perturbation scalar magPerturbation_; @@ -94,9 +146,15 @@ public: const dictionary& dict ); + //- No copy construct + randomise(const randomise&) = delete; + + //- No copy assignment + void operator=(const randomise&) = delete; + //- Destructor - virtual ~randomise(); + virtual ~randomise() = default; // Member Functions diff --git a/src/functionObjects/field/reactionSensitivityAnalysis/reactionsSensitivityAnalysis.C b/src/functionObjects/field/reactionSensitivityAnalysis/reactionsSensitivityAnalysis.C index 47470859e0e4e9344d90edf60c5fd0dc619f0c91..878ed42ea43eb9e7fc924f4d4338acff43f58ff6 100644 --- a/src/functionObjects/field/reactionSensitivityAnalysis/reactionsSensitivityAnalysis.C +++ b/src/functionObjects/field/reactionSensitivityAnalysis/reactionsSensitivityAnalysis.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -182,14 +182,14 @@ reactionsSensitivityAnalysis : fvMeshFunctionObject(name, runTime, dict), writeFile(mesh_, name), + nReactions_(0), + startTime_(0), + endTime_(0), production_(0), consumption_(0), productionInt_(0), consumptionInt_(0), - startTime_(0), - endTime_(0), speciesNames_(), - nReactions_(0), prodFilePtr_(), consFilePtr_(), prodIntFilePtr_(), @@ -249,14 +249,6 @@ reactionsSensitivityAnalysis } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class chemistryType> -Foam::functionObjects::reactionsSensitivityAnalysis<chemistryType>:: -~reactionsSensitivityAnalysis() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class chemistryType> @@ -267,6 +259,7 @@ bool Foam::functionObjects::reactionsSensitivityAnalysis<chemistryType>::read { fvMeshFunctionObject::read(dict); writeFile::read(dict); + return true; } diff --git a/src/functionObjects/field/reactionSensitivityAnalysis/reactionsSensitivityAnalysis.H b/src/functionObjects/field/reactionSensitivityAnalysis/reactionsSensitivityAnalysis.H index 424da7ba82f6531157c09bc72beb17bde80805f4..3bf944407f6528ee5369fcb8c5e2a6b35769d9c5 100644 --- a/src/functionObjects/field/reactionSensitivityAnalysis/reactionsSensitivityAnalysis.H +++ b/src/functionObjects/field/reactionSensitivityAnalysis/reactionsSensitivityAnalysis.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,19 +30,64 @@ Group grpFieldFunctionObjects grpThermophysicalFunctionObjects Description - This function object creates four data files named: - - - "consumption" : consumption rate - - "production" : destruction rate - - "productionInt" : integral between dumps of the production rate - - "consumptionInt" : integral between dumps of the consumption rate - - The function object indicates reaction rates of creation or destruction + Computes indicators for reaction rates of creation or destruction of species in each reaction. + This function object creates four data files named: + + - \c consumption : consumption rate + - \c production : destruction rate + - \c productionInt : integral between dumps of the production rate + - \c consumptionInt : integral between dumps of the consumption rate + + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | - | - + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + reactionSensitivityAnalysis1 + { + // Mandatory entries (unmodifiable) + type reactionSensitivityAnalysis; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: reactionSensitivityAnalysis | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. + +Note + - Function object only applicable to single cell cases. + - Needs a \c chemistryModel chosen. + +See also + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::reactionsSensitivityAnalysis SourceFiles reactionsSensitivityAnalysis.C + reactionsSensitivityAnalysisObjects.C \*---------------------------------------------------------------------------*/ @@ -72,9 +117,17 @@ class reactionsSensitivityAnalysis : public fvMeshFunctionObject, public writeFile - { - // Private data + // Private Data + + //- Number of reactions + label nReactions_; + + //- Start time of integration + scalar startTime_; + + //- End time of integration + scalar endTime_; //- List list for species production scalarListList production_; @@ -88,19 +141,9 @@ class reactionsSensitivityAnalysis //- List list for species consumption integral scalarListList consumptionInt_; - //- Start time of integration - scalar startTime_; - - //- End time of integration - scalar endTime_; - //- Word list of species wordList speciesNames_; - //-Number of reactions - label nReactions_; - - // File streams //- Integrated coefficients @@ -116,10 +159,8 @@ class reactionsSensitivityAnalysis autoPtr<OFstream> consIntFilePtr_; - // Private Member Functions - //- Create file names for forces and bins void createFileNames(); @@ -133,16 +174,6 @@ class reactionsSensitivityAnalysis void writeSpeciesRR(); - //- No copy construct - reactionsSensitivityAnalysis - ( - const reactionsSensitivityAnalysis& - ) = delete; - - //- No copy assignment - void operator=(const reactionsSensitivityAnalysis&) = delete; - - public: //- Runtime type information @@ -159,9 +190,18 @@ public: const dictionary& dict ); + //- No copy construct + reactionsSensitivityAnalysis + ( + const reactionsSensitivityAnalysis& + ) = delete; + + //- No copy assignment + void operator=(const reactionsSensitivityAnalysis&) = delete; + //- Destructor - virtual ~reactionsSensitivityAnalysis(); + virtual ~reactionsSensitivityAnalysis() = default; // Member Functions diff --git a/src/functionObjects/field/readFields/readFields.C b/src/functionObjects/field/readFields/readFields.C index 188d0eec301bc5cd813fdf454c8cc1b87c3ad916..888d45221a39c4713be720de73db26c75b71a0ec 100644 --- a/src/functionObjects/field/readFields/readFields.C +++ b/src/functionObjects/field/readFields/readFields.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -53,8 +53,8 @@ Foam::functionObjects::readFields::readFields ) : fvMeshFunctionObject(name, runTime, dict), - fieldSet_(), - readOnStart_(true) + readOnStart_(true), + fieldSet_() { read(dict); @@ -65,20 +65,14 @@ Foam::functionObjects::readFields::readFields } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::readFields::~readFields() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::readFields::read(const dictionary& dict) { fvMeshFunctionObject::read(dict); - dict.readEntry("fields", fieldSet_); dict.readIfPresent("readOnStart", readOnStart_); + dict.readEntry("fields", fieldSet_); return true; } diff --git a/src/functionObjects/field/readFields/readFields.H b/src/functionObjects/field/readFields/readFields.H index f53fff37f926f953a187d8931a4079b1e709c3e1..feb521a75ca55dc19d48fd4026d21d6b909f6940 100644 --- a/src/functionObjects/field/readFields/readFields.H +++ b/src/functionObjects/field/readFields/readFields.H @@ -12,7 +12,7 @@ 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 + under the terms of the GNU General Public L2020icense as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -34,32 +34,58 @@ Description Reads fields from the time directories and adds them to the mesh database for further post-processing. + Operands: + \table + Operand | Type | Location + input | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | vol\<Type\>Field | Mesh database + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. + Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim readFields1 { + // Mandatory entries (unmodifiable) type readFields; libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + fields (<field1> <field2> ... <fieldN>); + + // Optional entries (runtime modifiable) + readOnStart true; + + // Optional (inherited) entries ... - fields (U p); } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: readFields | yes | - fields | list of fields to read | no | - readOnStart | flag to start reading on start-up | no | yes - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: readFields | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of the operand fields | wordList | yes | - + readOnStart | Flag to start reading on start-up | bool | no | true \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. + See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::readFields SourceFiles readFields.C + readFieldsTemplates.C \*---------------------------------------------------------------------------*/ @@ -87,32 +113,22 @@ class readFields { protected: - // Protected data - - //- Fields to load - wordList fieldSet_; + // Protected Data //- Flag to read on construction bool readOnStart_; + //- Fields to load + wordList fieldSet_; + // Protected Member Functions + //- Load field template<class Type> bool loadField(const word&); -private: - - // Private member functions - - //- No copy construct - readFields(const readFields&) = delete; - - //- No copy assignment - void operator=(const readFields&) = delete; - - public: //- Runtime type information @@ -130,9 +146,15 @@ public: const dictionary& dict ); + //- No copy construct + readFields(const readFields&) = delete; + + //- No copy assignment + void operator=(const readFields&) = delete; + //- Destructor - virtual ~readFields(); + virtual ~readFields() = default; // Member Functions diff --git a/src/functionObjects/field/reference/reference.C b/src/functionObjects/field/reference/reference.C index d1c54e288b911f185e002ba1b154fb8329172ef0..d9177443de5987606a787b08a9ec5542dcabeda9 100644 --- a/src/functionObjects/field/reference/reference.C +++ b/src/functionObjects/field/reference/reference.C @@ -35,13 +35,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(reference, 0); - - addToRunTimeSelectionTable - ( - functionObject, - reference, - dictionary - ); + addToRunTimeSelectionTable(functionObject, reference, dictionary); } } @@ -60,7 +54,6 @@ bool Foam::functionObjects::reference::calc() Log << endl; - return returnReduce(processed, orOp<bool>()); } @@ -75,12 +68,12 @@ Foam::functionObjects::reference::reference ) : fieldExpression(name, runTime, dict), - localDict_(dict), - position_(Zero), positionIsSet_(false), celli_(-1), interpolationScheme_("cell"), - scale_(1) + scale_(1), + localDict_(dict), + position_(Zero) { read(dict); @@ -89,11 +82,7 @@ Foam::functionObjects::reference::reference } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::reference::~reference() -{} - +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::reference::read(const dictionary& dict) { diff --git a/src/functionObjects/field/reference/reference.H b/src/functionObjects/field/reference/reference.H index eb7cc258ea26ec8d075475a136dce2c2528893fe..1c35615bffc48b7033b568942e5dc79c4d3c816e 100644 --- a/src/functionObjects/field/reference/reference.H +++ b/src/functionObjects/field/reference/reference.H @@ -30,59 +30,85 @@ Group grpFieldFunctionObjects Description - Calculates and outputs a field whose values are offset to a reference + Computes a field whose values are offset to a reference value obtained by sampling the field at a user-specified location. The field values are calculated using: \f[ - ref_c = s(f_{c}(t) - f_p + f_{off}) + r_c = s(f_{c}(t) - f_p + f_{off}) \f] where \vartable - ref_c | field values at cell - s | optional scale factor (default = 1) - f_{c}(t) | current field values at cell at this time - f_p | field value at position - f_{off} | offset field value (default = 0) + r_c | field values at cell + s | optional scale factor (default = 1) + f_{c}(t) | current field values at cell at this time + f_p | field value at position + f_{off} | offset field value (default = 0) \endvartable + Operands: + \table + Operand | Type | Location + input | {vol,surface}\<Type\>Field <!-- + --> | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | {vol,surface}\<Type\>Field <!-- + --> | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. + Usage - Example of function object specification to calculate the reference field: + Minimal example by using \c system/controlDict.functions: \verbatim - pRef + reference1 { + // Mandatory entries (unmodifiable) type reference; libs (fieldFunctionObjects); - ... - field p; - result pRef; + + // Mandatory (inherited) entry (runtime modifiable) + field <field>; + + // Optional entries (runtime modifiable) position (0 0 0); - scale 1.2; - offset 100000; + scale 1.0; + offset 0.0; + interpolationScheme cell; + + // Optional (inherited) entries + ... } \endverbatim Where the entries comprise: \table - Property | Description | Required | Default value - type | Type name: reference | yes | - field | Name of field | yes | - result | Name of result field | no | reference(\<field\>) - position | Position to sample | no | \<not used\> - scale | Scale value | no | 1 - offset | Offset value | no | zero - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: reference | word | yes | - + field | Name of the operand field | word | yes | - + position | Position to sample | vector | no | \<not used\> + scale | Scale value | scalar | no | 1.0 + offset | Offset value | scalar | no | 0.0 + interpolationScheme | Sampling scheme | word | no | cell \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::reference SourceFiles reference.C + referenceTemplates.C \*---------------------------------------------------------------------------*/ @@ -107,13 +133,7 @@ class reference : public fieldExpression { - // Private data - - //- Local copy of dictionary used for construction - dictionary localDict_; - - //- Sample location - point position_; + // Private Data //- Flag to indicate that the position is set bool positionIsSet_; @@ -127,6 +147,12 @@ class reference //- Scale factor scalar scale_; + //- Local copy of dictionary used for construction + dictionary localDict_; + + //- Sample location + point position_; + // Private Member Functions @@ -154,9 +180,15 @@ public: const dictionary& dict ); + //- No copy construct + reference(const reference&) = delete; + + //- No copy assignment + void operator=(const reference&) = delete; + //- Destructor - virtual ~reference(); + virtual ~reference() = default; // Public Member Functions diff --git a/src/functionObjects/field/reference/referenceTemplates.C b/src/functionObjects/field/reference/referenceTemplates.C index 011381e2fd8ec6520f25135bf5c875c3bb66859c..cda6bc56d08c976e3f48dc89b2a4f4be46054a76 100644 --- a/src/functionObjects/field/reference/referenceTemplates.C +++ b/src/functionObjects/field/reference/referenceTemplates.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,6 +27,8 @@ License #include "interpolation.H" +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + template<class Type> bool Foam::functionObjects::reference::calcType() { diff --git a/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C b/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C index bb14c5e4eb9fd7794110241aea210d70873373e1..6375a4ca73a0f539518b3dae01684a69ef3df50a 100644 --- a/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C +++ b/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C @@ -37,7 +37,6 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(regionSizeDistribution, 0); - addToRunTimeSelectionTable ( functionObject, @@ -81,7 +80,7 @@ void Foam::functionObjects::regionSizeDistribution::writeAlphaFields const volScalarField& alpha ) const { - const scalar maxDropletVol = 1.0/6.0*pow(maxDiam_, 3); + const scalar maxDropletVol = 1.0/6.0*pow3(maxDiam_); // Split alpha field // ~~~~~~~~~~~~~~~~~ @@ -328,12 +327,6 @@ Foam::functionObjects::regionSizeDistribution::regionSizeDistribution } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::regionSizeDistribution::~regionSizeDistribution() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::regionSizeDistribution::read(const dictionary& dict) @@ -341,13 +334,13 @@ bool Foam::functionObjects::regionSizeDistribution::read(const dictionary& dict) fvMeshFunctionObject::read(dict); writeFile::read(dict); + dict.readEntry("nBins", nBins_); dict.readEntry("field", alphaName_); - dict.readEntry("patches", patchNames_); dict.readEntry("threshold", threshold_); dict.readEntry("maxDiameter", maxDiam_); minDiam_ = 0.0; dict.readIfPresent("minDiameter", minDiam_); - dict.readEntry("nBins", nBins_); + dict.readEntry("patches", patchNames_); dict.readEntry("fields", fields_); const word format(dict.get<word>("setFormat")); @@ -372,7 +365,7 @@ bool Foam::functionObjects::regionSizeDistribution::read(const dictionary& dict) { dict.readEntry("origin", origin_); dict.readEntry("direction", direction_); - dict.readEntry("maxDiameter", maxDiameter_); + dict.readEntry("maxD", maxDiameter_); dict.readEntry("nDownstreamBins", nDownstreamBins_); dict.readEntry("maxDownstream", maxDownstream_); direction_.normalise(); diff --git a/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H b/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H index 3d94650950636aeb1d306b925fbf902f0785a887..0e10b1633e159134e8cf976aa527aa9eca3afe60 100644 --- a/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H +++ b/src/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H @@ -31,8 +31,8 @@ Group grpFieldFunctionObjects Description - Creates a size distribution via interrogating a continuous phase fraction - field. + Creates a droplet size distribution via interrogating a continuous phase + fraction field. Looks up a phase-fraction (alpha) field and splits the mesh into regions based on where the field is below the threshold value. These @@ -50,7 +50,7 @@ Description - alpha_liquidCore : alpha with outside liquid core set to 0 - alpha_background : alpha with outside background set to 0. - %Histogram: + Histogram: - determine histogram of diameter (given minDiameter, maxDiameter, nBins) - write graph of number of droplets per bin - write graph of sum, average and deviation of droplet volume per bin @@ -60,40 +60,57 @@ Description downstream of the injector determined by origin, direction and maxDiameter up to maxDownstream + Operands: + \table + Operand | Type | Location + input | - | - + output file | - <!-- + --> | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<files\> + output field | - | - + \endtable + Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim regionSizeDistribution1 { + // Mandatory entries (unmodifiable) type regionSizeDistribution; libs (fieldFunctionObjects); - ... + + // Mandatory entries (runtime modifiable) field alpha; patches (inlet); - threshold 0.4; fields (p U); + threshold 0.4; + maxDiameter 5e-5; nBins 100; - maxDiameter 0.5e-4; - minDiameter 0; setFormat gnuplot; - origin (0 0 0); - coordinateRoation + + // Optional entries (runtime modifiable) + minDiameter 0.0; + coordinateSystem { - type cartesian; - e3 (0 1 1); - e1 (1 0 0); + origin (0 0 0); + rotation + { + type axes; + e3 (0 0 1); + e1 (1 0 0); + } } - // Optional downstream iso-plane bins. + // Optional downstream iso-plane bins isoPlanes true; + // Mandatory entries if isoPlanes=true (runtime modifiable) // Plane normal and point definition - direction (1 0 1); origin (1e-4 0 5e-4); + direction (1 0 1); // Maximum diameter of the cylinder formed by the origin point // and direction - maxDiameter 3e-4; + maxD 3e-4; // Maximum downstream distance maxDownstream 6e-4; @@ -101,41 +118,54 @@ Usage // Number of iso-plane bins nDownstreamBins 20; + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: regionSizeDistribution |yes| - field | phase field to interrogate | yes | - patches | patches from which the liquid core is identified | yes| - threshold | phase fraction applied to delimit regions | yes | - fields | fields to sample | yes | - nBins | number of bins for histogram | yes | - maxDiameter | maximum region equivalent diameter | yes | - minDiameter | minimum region equivalent diameter | no | 0 - setFormat | writing format | yes | - origin | origin of local coordinate system | yes | - coordinateRoation | orientation of local coordinate system | no - log | Log to standard output | no | yes - isoPlanes | switch for isoPlanes | no | false - origin | origin of the plane when isoPlanes is used | no | none - direction | direction of the plane when isoPlanes is used | no | none - maxDiameter | maximum diameter of the sampling cylinder when - isoPlanes is used | no | none - nDownstreamBins | number of bins when isoPlanes is used | no | none - maxDownstream | maximum distance from origin when isoPlanes is used - | no | none + Property | Description | Type | Req'd | Dflt + type | Type name: regionSizeDistribution | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + field | Phase field to interrogate | word | yes | - + patches | Patches wherefrom the liquid core is identified <!-- + --> | wordList | yes | - + fields | Fields to sample | wordList | yes | - + threshold | Phase fraction applied to delimit regions | scalar | yes | - + maxDiameter | Maximum droplet diameter | scalar | yes | - + minDiameter | Minimum droplet diameter | scalar | no | 0.0 + nBins | Number of bins for histogram | label | yes | - + setFormat | Output format | word | yes | - + isoPlanes | Flag for isoPlanes | bool | no | false + origin | Origin of the plane when isoPlanes is used <!-- + --> | vector | yes | - + direction <!-- + --> | Direction of the plane when isoPlanes is used | vector | yes | - + maxD | Maximum diameter of the sampling <!-- + --> cylinder when isoPlanes is used | vector | yes | - + nDownstreamBins <!-- + --> | Number of bins when isoPlanes is used | label | yes | - + maxDownstream <!-- + --> | Maximum distance from origin when isoPlanes is used <!-- + --> | scalar | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. + See also - Foam::functionObject - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::regionSizeDistribution SourceFiles regionSizeDistribution.C + regionSizeDistributionTemplates.C \*---------------------------------------------------------------------------*/ @@ -156,7 +186,6 @@ SourceFiles namespace Foam { -// Forward declaration of classes class regionSplit; namespace functionObjects @@ -171,17 +200,14 @@ class regionSizeDistribution public fvMeshFunctionObject, public writeFile { - // Private data + // Private Data + + //- Number of bins + label nBins_; //- Name of field word alphaName_; - //- Patches to walk from - wordRes patchNames_; - - //- Switch to send output to Info as well as to file - Switch log_; - //- Clip value scalar threshold_; @@ -191,8 +217,8 @@ class regionSizeDistribution //- Minimum droplet diameter scalar minDiam_; - //- Number of bins - label nBins_; + //- Patches to walk from + wordRes patchNames_; //- Names of fields to sample on regions wordRes fields_; @@ -206,9 +232,6 @@ class regionSizeDistribution // Optional extra definition of bins on planes downstream to the origin // point and maximum diameter - //- Switch to enable iso-planes sampling - bool isoPlanes_; - //- Optional origin point vector origin_; @@ -224,6 +247,9 @@ class regionSizeDistribution //- Optional maximum downstream coordinate from origin scalar maxDownstream_; + //- Switch to enable iso-planes sampling + bool isoPlanes_; + // Private Member Functions @@ -242,7 +268,7 @@ class regionSizeDistribution ) const; //- Write volfields with the parts of alpha which are not - // droplets (liquidCore, backGround) + //- droplets (liquidCore, backGround) void writeAlphaFields ( const regionSplit& regions, @@ -272,22 +298,14 @@ class regionSizeDistribution ( const word& fieldName, // name of field const scalarField& cellField, // per cell field data - const regionSplit& regions, // per cell the region(=droplet) const labelList& sortedRegions, // valid regions in sorted order const scalarField& sortedNormalisation, - const labelList& indices, // index of bin for each region const scalarField& binCount, // per bin number of regions const coordSet& coords // graph data for bins ) const; - //- No copy construct - regionSizeDistribution(const regionSizeDistribution&) = delete; - - //- No copy assignment - void operator=(const regionSizeDistribution&) = delete; - public: @@ -306,10 +324,15 @@ public: const dictionary& ); + //- No copy construct + regionSizeDistribution(const regionSizeDistribution&) = delete; - // Destructor + //- No copy assignment + void operator=(const regionSizeDistribution&) = delete; - virtual ~regionSizeDistribution(); + + // Destructor + virtual ~regionSizeDistribution() = default; // Member Functions diff --git a/src/functionObjects/field/setFlow/setFlow.C b/src/functionObjects/field/setFlow/setFlow.C index 4bd08a05bbdd667409870710a7b4222d6312f7ce..ede4083de6003ef980ddb976d850ef8b5fec939a 100644 --- a/src/functionObjects/field/setFlow/setFlow.C +++ b/src/functionObjects/field/setFlow/setFlow.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,13 +39,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(setFlow, 0); - - addToRunTimeSelectionTable - ( - functionObject, - setFlow, - dictionary - ); + addToRunTimeSelectionTable(functionObject, setFlow, dictionary); } } @@ -111,10 +105,10 @@ Foam::functionObjects::setFlow::setFlow ) : fvMeshFunctionObject(name, runTime, dict), + mode_(modeType::FUNCTION), UName_("U"), rhoName_("none"), phiName_("phi"), - mode_(modeType::FUNCTION), reverseTime_(VGREAT), scalePtr_(nullptr), origin_(Zero), @@ -126,12 +120,6 @@ Foam::functionObjects::setFlow::setFlow } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::setFlow::~setFlow() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::setFlow::read(const dictionary& dict) diff --git a/src/functionObjects/field/setFlow/setFlow.H b/src/functionObjects/field/setFlow/setFlow.H index 658ed9181548134e8a6a23ebae389f63b26f1025..16bba138f0a4e70111f2c16e0fe36e6d7bb520bd 100644 --- a/src/functionObjects/field/setFlow/setFlow.H +++ b/src/functionObjects/field/setFlow/setFlow.H @@ -30,50 +30,104 @@ Group grpFieldFunctionObjects Description - Provides options to set the velocity and flux fields as a function of time + Provides options to set the velocity and flux fields as a function of time. Useful for testing advection behaviour of numerical schemes by e.g. imposing solid body rotation, vortex flows. All types include a scaling - Foam::Function1 type enabling the strength of the transformation to vary as - a function of time. + \c Function1 type enabling the strength of the transformation to vary + as a function of time. + + Operands: + \table + Operand | Type | Location + input | {vol,surface}\<Type\>Field <!-- + --> | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | {vol,surface}\<Type\>Field <!-- + --> | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim setFlow1 { - type setFlow; - libs (fieldFunctionObjects); + // Mandatory entries (unmodifiable) + type setFlow; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + mode rotation; + scale 1; + + // Optional entries (runtime modifiable) + U U; + rho none; + phi phi; + reverseTime 1; + + // When mode=function + velocity (1 0 0); + + // When mode=rotation + omega 6.28318530718; + origin (0.5 0 0.5); + refDir (1 0 0); + axis (0 1 0); + + // When mode=(vortex2D|vortex3D) + origin (0.5 0 0.5); + refDir (1 0 0); + axis (0 1 0); + + // Optional (inherited) entries ... - mode rotation; - scale 1; - reverseTime 1; - omega 6.28318530718; - origin (0.5 0 0.5); - refDir (1 0 0); - axis (0 1 0); } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: setFlow | yes | - U | Name of velocity field | no | U - rho | Name of density field | no | none - phi | Name of flux field | no | phi - mode | operating mode - see below | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: readFields | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + mode | Operating mode - see below | word | yes | - + scale | Scaling function | Function1<scalar> | yes | - + U | Name of velocity field | word | no | U + rho | Name of density field | word | no | none + phi | Name of flux field | word | no | phi + reverseTime <!-- + --> | Specified time to reverse flow direction | scalar | no | VGREAT + velocity <!-- + --> | Velocity function | Function1<vector> | conditional | - + omega <!-- + --> | Rotational speed function | Function1<scalar> | conditional | - + origin <!-- + --> | Rotation vector origin | vector | conditional | - + refDir <!-- + --> | Rotation vector reference direction | vector | conditional | - + axis <!-- + --> | Rotation vector axis | vector | conditional | - \endtable - Available \c mode types include: - - function - - rortation - - vortex2D - - vortex3D + Options for the \c mode entry: + \verbatim + function + rotation + vortex2D + vortex3D + \endverbatim + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::setFlow SourceFiles setFlow.C @@ -104,31 +158,35 @@ class setFlow : public fvMeshFunctionObject { - enum class modeType - { - FUNCTION, - ROTATION, - VORTEX2D, - VORTEX3D - }; + // Private Enumerations + + //- Options for the operating mode + enum class modeType + { + FUNCTION, + ROTATION, + VORTEX2D, + VORTEX3D + }; - static const Enum<modeType> modeTypeNames; + //- Names for modeType + static const Enum<modeType> modeTypeNames; // Private Data - //- Name of velocity field, default = "U" + //- Operating mode + modeType mode_; + + //- Name of velocity field word UName_; - //- Name of density field, default = "none" + //- Name of density field word rhoName_; - //- Name of flux field, default = "phi" + //- Name of flux field word phiName_; - //- Operating mode - modeType mode_; - //- Reverse time scalar reverseTime_; @@ -176,16 +234,27 @@ public: const dictionary& dict ); + //- No copy construct + setFlow(const setFlow&) = delete; + + //- No copy assignment + void operator=(const setFlow&) = delete; + //- Destructor - virtual ~setFlow(); + virtual ~setFlow() = default; + + // Member Functions - virtual bool read(const dictionary& dict); + //- Read the setFlow data + virtual bool read(const dictionary& dict); - virtual bool execute(); + //- Do nothing + virtual bool execute(); - virtual bool write(); + //- Calculate the setFlow and write + virtual bool write(); }; diff --git a/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C b/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C index 0a0d5321f38b2e8cfeb23a34342b6c1fcdd463aa..67a49ebf5708b5acbb0811375d7fbd7d07fefa45 100644 --- a/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C +++ b/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C @@ -454,21 +454,21 @@ Foam::functionObjects::stabilityBlendingFactor::stabilityBlendingFactor maxNonOrthogonality_ ( - dict.getOrDefault<scalar>("maxNonOrthogonality", 20) + dict.getOrDefault<scalar>("maxNonOrthogonality", 20.0) ), minNonOrthogonality_ ( - dict.getOrDefault<scalar>("minNonOrthogonality", 60) + dict.getOrDefault<scalar>("minNonOrthogonality", 60.0) ), - maxGradCc_(dict.getOrDefault<scalar>("maxGradCc", 3)), - minGradCc_(dict.getOrDefault<scalar>("minGradCc", 4)), - maxResidual_(dict.getOrDefault<scalar>("maxResidual", 10)), + maxGradCc_(dict.getOrDefault<scalar>("maxGradCc", 3.0)), + minGradCc_(dict.getOrDefault<scalar>("minGradCc", 4.0)), + maxResidual_(dict.getOrDefault<scalar>("maxResidual", 10.0)), minFaceWeight_(dict.getOrDefault<scalar>("minFaceWeight", 0.3)), maxFaceWeight_(dict.getOrDefault<scalar>("maxFaceWeight", 0.2)), - maxSkewness_(dict.getOrDefault<scalar>("maxSkewness", 2)), - minSkewness_(dict.getOrDefault<scalar>("minSkewness", 3)), - Co1_(dict.getOrDefault<scalar>("Co1", 1)), - Co2_(dict.getOrDefault<scalar>("Co2", 10)), + maxSkewness_(dict.getOrDefault<scalar>("maxSkewness", 2.0)), + minSkewness_(dict.getOrDefault<scalar>("minSkewness", 3.0)), + Co1_(dict.getOrDefault<scalar>("Co1", 1.0)), + Co2_(dict.getOrDefault<scalar>("Co2", 10.0)), nonOrthogonalityName_ ( @@ -497,7 +497,7 @@ Foam::functionObjects::stabilityBlendingFactor::stabilityBlendingFactor oldError_(mesh_.nCells(), Zero), oldErrorIntegral_(mesh_.nCells(), Zero), P_(dict.getOrDefault<scalar>("P", 3)), - I_(dict.getOrDefault<scalar>("I", 0)), + I_(dict.getOrDefault<scalar>("I", 0.0)), D_(dict.getOrDefault<scalar>("D", 0.25)) { read(dict); @@ -627,12 +627,6 @@ Foam::functionObjects::stabilityBlendingFactor::stabilityBlendingFactor } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::stabilityBlendingFactor::~stabilityBlendingFactor() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::stabilityBlendingFactor::read diff --git a/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.H b/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.H index 01366b72513963775c3d1600ad9f8835a70ed61f..579ad13c0ba388ab54356f9fb3219fc6f95f344c 100644 --- a/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.H +++ b/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.H @@ -30,126 +30,132 @@ Group grpFieldFunctionObjects Description - Calculates and outputs the stabilityBlendingFactor to be used by the + Computes the \c stabilityBlendingFactor to be used by the local blended convection scheme. The output is a surface field weight - between 0-1 + between 0-1. - The weight of a blended scheme is given by a function of the blending - factor, f: + The weight of a blended scheme, i.e. \c w, is given by a function of + the blending factor, \c f: \f[ - weight = f scheme1 + (1 - f) scheme2 + w = f_{scheme_1} + (1 - f_{scheme_2}) \f] The factor is calculated based on six criteria: - - 1) mesh non-orthogonality field - 2) magnitude of cell centres gradient - 3) convergence rate of residuals - 4) faceWeight - 5) skewness - 6) Co number + \verbatim + 1. mesh non-orthogonality field + 2. magnitude of cell centres gradient + 3. convergence rate of residuals + 4. faceWeight + 5. skewness + 6. Courant number + \endverbatim The user can enable them individually. - For option 1, the following relation is used: - \f[ - fNon = - min - ( - max - ( - 0.0, - (nonOrthogonality - maxNonOrthogonality) - /(minNonOrthogonality - maxNonOrthogonality) - ), - 1.0 - ) - \f] - - For option 2, the following relation is used: - \f[ - fMagGradCc = - min - ( - max - ( - 0.0, - (magGradCC - maxGradCc) - / (minGradCc - maxGradCc) - ), - 1.0 - ) - \f] - Note that magGradCC is equal to 3 for ortoghonal meshes - - For option 3 a PID control is used in order to control residual - unbouded fluctuations for individual cells. - - \f[ - factor = - P*residual - + I*residualIntegral - + D*residualDifferential - \f] - - where P, I and D are user inputs - - The following relation is used: + For option 1, the following relation is used, where \f$\phi_1\f$ is + the non-orthogonality: \f[ - fRes = (factor - meanRes)/(maxRes*meanRes); - \f] - - where: - meanRes = average(residual) - maxRes is an user input - - - fRes will blend more towards one as the cell residual is larger then - the domain mean residuals. - - - For option 4 , the following relation is used: - - \f[ - ffaceWeight = min + fNon = + min ( max ( 0.0, - (minFaceWeight - faceWeights) - / (minFaceWeight - maxFaceWeight) + (\phi_1 - max(\phi_1)) + /(min(\phi_1) - max(\phi_1)) ), 1.0 ) - \f] - Note that faceWeights for a orthogonal mesh is 0.5. - + \f] - For option 5 , the following relation is used: + For option 2, the following relation is used, where \f$\phi_2\f$ is + the magnitude of cell centres gradient (Note that \f$\phi_2 = 3\f$ + for orthogonal meshes): - \f[ - fskewness = + \f[ + fMagGradCc = min ( max ( 0.0, - (skewness - maxSkewness) - / (minSkewness - maxSkewness) + (\phi_2 - max(\phi_2)) + / (min(\phi_2) - max(\phi_2)) ), 1.0 ) - \f] + \f] + + For option 3, a PID control is used in order to control residual + unbounded fluctuations for individual cells. + \f[ + factor = + P*residual + + I*residualIntegral + + D*residualDifferential + \f] - For option 6 , the following relation is used: + where \c P, \c I and \c D are user inputs. + The following relation is used: \f[ - fCoWeight = min(max((Co - Co1)/(Co2 - Co1), 0), 1) + fRes = (factor - meanRes)/(maxRes*meanRes); \f] + where + \vartable + meanRes | Average(residual) + maxRes | User input + \endvartable + + Note that \f$f_{Res}\f$ will blend more towards one as + the cell residual is larger then the domain mean residuals. + + + For option 4, the following relation is used, where \f$\phi_4\f$ is + the face weight (Note that \f$\phi_4 = 0.5\f$ for orthogonal meshes): + + \f[ + ffaceWeight = min + ( + max + ( + 0.0, + (min(\phi_4) - \phi_4) + / (min(\phi_4) - max(\phi_4)) + ), + 1.0 + ) + \f] + + + For option 5, the following relation is used, where \f$\phi_5\f$ is + the cell skewness: + + \f[ + fskewness = + min + ( + max + ( + 0.0, + (\phi_5 - max(\phi_5)) + / (min(\phi_5) - max(\phi_5)) + ), + 1.0 + ) + \f] + + + For option 6, the following relation is used: + \f[ + fCoWeight = min(max((Co - Co1)/(Co2 - Co1), 0), 1) + \f] + + where \vartable Co1 | Courant number below which scheme2 is used Co2 | Courant number above which scheme1 is used @@ -161,136 +167,148 @@ Description f = max(fNon, fMagGradCc, fRes, ffaceWeight, fskewness, fCoWeight) \f] - An indicator (volume) field, named blendedIndicator is generated if the log - flag is on: + An indicator (volume) field, named \c blendedIndicator + is generated if the log flag is on: - 1 represent scheme1 as active, - 0 represent scheme2 as active. Additional reporting is written to the standard output, providing statistics as to the number of cells used by each scheme. + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable + Usage - Example of function object specification to calculate the blending factor: + Minimal example by using \c system/controlDict.functions: \verbatim stabilityBlendingFactor1 { + // Mandatory entries (unmodifiable) type stabilityBlendingFactor; libs (fieldFunctionObjects); - log true; - writeToFile false; + // Mandatory entries (unmodifiable) + field <field>; // U; + result <outField>; // UBlendingFactor; + + // Optional entries (runtime modifiable) + tolerance 0.001; - switchNonOrtho yes; - switchGradCc no; - switchResiduals yes; - switchFaceWeight no; - switchSkewness no; - switchCo no; + // Any of the options can be chosen in combinations + // Option-1 + switchNonOrtho true; + nonOrthogonality nonOrthoAngle; maxNonOrthogonality 20; minNonOrthogonality 60; + // Option-2 + switchGradCc true; maxGradCc 3; minGradCc 4; - maxFaceWeight 0.3; - minFaceWeight 0.2; - - maxSkewness 2; - minSkewness 3; - + // Option-3 + switchResiduals true; maxResidual 10; - - result UBlendingFactor; residual initialResidual:p; P 1.5; I 0; D 0.5; + // Option-4 + switchFaceWeight true; + maxFaceWeight 0.3; + minFaceWeight 0.2; + + // Option-5 + switchSkewness true; + maxSkewness 2; + minSkewness 3; + + // Option-6 + switchCo true; + U U; Co1 1; Co2 10; + + // Optional (inherited) entries ... - ... - field U; } + \endverbatim - Example of function object specification to calculate the residuals used - by stabilityBlendingFactor. The following writes 'initialResidual:p' + Example of function object specification to calculate the \c residuals used + by \c stabilityBlendingFactor. The following writes 'initialResidual:p' field - - residuals - { - type residuals; - libs (utilityFunctionObjects); - writeFields true; - writeControl outputTime; - fields (p); - } - + \verbatim + residuals + { + type residuals; + libs (utilityFunctionObjects); + writeFields true; + writeControl writeTime; + fields (p); + } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: stabilityBlendingFactor | yes | - - log | Log to standard output | no | yes - writeToFile | Log to file | no | yes - - switchNonOrtho | non-orthogonal method | no | false - switchGradCc | cell centre gradient method | no | false - switchResiduals | residual evolution method | no | false - switchFaceWeight | face weight method | no | false - switchSkewness | skewness method | no | false - switchCo | Co blended | no | false - - maxNonOrthogonality| maximum non-orthogonal for scheme2 | no | 20 - minNonOrthogonality| minimum non-orthogonal for scheme1 | no | 60 - - maxGradCc| maximum gradient for scheme2 | no | 2 - minGradCc| minimum gradient for scheme1 | no | 4 - - maxResidual| maximum residual-mean ratio for scheme1 | no | 10 - P | proportional factor for PID | no | 3 - I | integral factor for PID | no | 0 - D | differential factor for PID | no | 0.25 - - maxFaceWeight | maximum face weight for scheme1 | no | 0.2 - minFaceWeight | minimum face weight for scheme2 | no | 0.3 - - maxSkewness | maximum skewness for scheme2 | no | 2 - minSkewness | minimum skewness for scheme1 | no | 3 - - - faceWeight | Name of the faceWeight field | no | faceWeight - skewness | Name of the skewness field | no | skewness - nonOrthogonality | Name of the non-orthogonal field | no | - nonOrthoAngle - residual | Name of the residual field | no | initialResidual:p - U | Name of the flux field for Co blended | no | U - - - Co1 | Courant number below which scheme2 is used | no | 1 - Co2 | Courant number above which scheme1 is used | no | 10 - - - tolerance | Tolerance for number of blended cells | no | 0.001 - field | Name of field to evaluate | yes | - result | Name of surface field to be used in the localBlended scheme - | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: stabilityBlendingFactor | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + field | Name of operand field | word | yes | - + result | Name of surface field to be used in the localBlended scheme <!-- + --> | word | yes + switchNonOrtho | Select non-orthogonal method | bool | no | false + nonOrthogonality | Name of the non-orthogonal field <!-- + --> | word | no | nonOrthoAngle + maxNonOrthogonality| Maximum non-orthogonal for scheme2 | scalar | no | 20 + minNonOrthogonality| Minimum non-orthogonal for scheme1 | scalar | no | 60 + switchGradCc | Select cell centre gradient method | bool | no | false + maxGradCc| Maximum gradient for scheme2 | scalar | no | 2 + minGradCc| Minimum gradient for scheme1 | scalar | no | 4 + switchResiduals | Select residual evolution method | bool | no | false + residual | Name of the residual field | word | no | initialResidual:p + maxResidual| Maximum residual-mean ratio for scheme1 | scalar | no | 10 + P | Proportional factor for PID | scalar | no | 3 + I | Integral factor for PID | scalar | no | 0 + D | Differential factor for PID | scalar | no | 0.25 + switchFaceWeight | Select face weight method | bool | no | false + faceWeight | Name of the faceWeight field | word | no | faceWeight + maxFaceWeight | Maximum face weight for scheme1 | scalar | no | 0.2 + minFaceWeight | Minimum face weight for scheme2 | scalar | no | 0.3 + switchSkewness | Select skewness method | bool | no | false + skewness | Name of the skewness field | word | no | skewness + maxSkewness | Maximum skewness for scheme2 | scalar | no | 2 + minSkewness | Minimum skewness for scheme1 | scalar | no | 3 + switchCo | Select Co blended method | bool | no | false + U | Name of the flux field for Co blended | word | no | U + Co1 | Courant number below which scheme2 is used | scalar | no | 1 + Co2 | Courant number above which scheme1 is used | scalar | no | 10 + tolerance | Tolerance for number of blended cells | scalar | no | 0.001 \endtable - The 'log' flag true write the number of cells on each scheme, plus it - writes the field name "blendedIndicator". + The \c result entry is the field which is read by the \c localBlended scheme + specified in \c fvSchemes. This name is determined by the \c localBlended + class. - The 'result' entry is the field which is read by the localBlended scheme - specified in fvSchemes. This name is determined by the localBlended class. + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + - \link writeFile.H \endlink + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile + - Foam::functionObject + - Foam::functionObjects::fieldExpression + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::stabilityBlendingFactor SourceFiles stabilityBlendingFactor.C @@ -320,7 +338,7 @@ class stabilityBlendingFactor public fieldExpression, public writeFile { - // Private member data + // Private Member Data //- Cell based blended indicator volScalarField indicator_; @@ -384,7 +402,7 @@ class stabilityBlendingFactor // File names - //- Name of the non-orthogonalit field + //- Name of the non-orthogonality field word nonOrthogonalityName_; //- Name of the face weight field @@ -456,9 +474,15 @@ public: const dictionary& dict ); + //- No copy construct + stabilityBlendingFactor(const stabilityBlendingFactor&) = delete; + + //- No copy assignment + void operator=(const stabilityBlendingFactor&) = delete; + //- Destructor - virtual ~stabilityBlendingFactor(); + virtual ~stabilityBlendingFactor() = default; // Member Functions diff --git a/src/functionObjects/field/streamFunction/streamFunction.C b/src/functionObjects/field/streamFunction/streamFunction.C index 9294ec17c3e86fc1245cd070fd0e57ce2d0b6eb1..9bcd7a68eabec43adb9fdeb413ca1dea7a9526f6 100644 --- a/src/functionObjects/field/streamFunction/streamFunction.C +++ b/src/functionObjects/field/streamFunction/streamFunction.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,13 +42,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(streamFunction, 0); - - addToRunTimeSelectionTable - ( - functionObject, - streamFunction, - dictionary - ); + addToRunTimeSelectionTable(functionObject, streamFunction, dictionary); } } @@ -435,7 +429,7 @@ Foam::functionObjects::streamFunction::streamFunction { setResultName(typeName, "phi"); - label nD = mesh_.nGeometricD(); + const label nD = mesh_.nGeometricD(); if (nD != 2) { @@ -446,10 +440,4 @@ Foam::functionObjects::streamFunction::streamFunction } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::streamFunction::~streamFunction() -{} - - // ************************************************************************* // diff --git a/src/functionObjects/field/streamFunction/streamFunction.H b/src/functionObjects/field/streamFunction/streamFunction.H index 25e501856c10745654aee0f04fd82d29ed4a935a..5dfd007fface29bb837f51fc24447e04a1fd3e5c 100644 --- a/src/functionObjects/field/streamFunction/streamFunction.H +++ b/src/functionObjects/field/streamFunction/streamFunction.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,12 +31,51 @@ Group grpFieldFunctionObjects Description - This function object calculates and outputs the stream-function as a - pointScalarField. + Computes the stream function (i.e. https://w.wiki/Ncm). + + Operands: + \table + Operand | Type | Location + input | surfaceScalarField | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | pointScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable + +Usage + Minimal example by using \c system/controlDict.functions: + \verbatim + streamFunction1 + { + // Mandatory entries (unmodifiable) + type streamFunction; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + ... + } + \endverbatim + + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: streamFunction | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func streamFunction + \endverbatim See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fieldExpression + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::streamFunction SourceFiles streamFunction.C @@ -66,7 +106,8 @@ class streamFunction { // Private Member Functions - tmp<pointScalarField> calc(const surfaceScalarField& phi) const; + //- Return the stream function field + tmp<pointScalarField> calc(const surfaceScalarField& phi) const; //- Calculate the stream-function and return true if successful virtual bool calc(); @@ -89,9 +130,15 @@ public: const dictionary& dict ); + //- No copy construct + streamFunction(const streamFunction&) = delete; + + //- No copy assignment + void operator=(const streamFunction&) = delete; + //- Destructor - virtual ~streamFunction(); + virtual ~streamFunction() = default; }; diff --git a/src/functionObjects/field/streamLine/streamLine.C b/src/functionObjects/field/streamLine/streamLine.C index f19aea2ec4b9b90ec9d364152f17aa13f276f591..8cc0b59f609940ec3bd9df9022580f5000378058 100644 --- a/src/functionObjects/field/streamLine/streamLine.C +++ b/src/functionObjects/field/streamLine/streamLine.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2015-2016 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -150,12 +150,6 @@ Foam::functionObjects::streamLine::streamLine } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::streamLine::~streamLine() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::streamLine::read(const dictionary& dict) diff --git a/src/functionObjects/field/streamLine/streamLine.H b/src/functionObjects/field/streamLine/streamLine.H index fed75b085c047c7455563ac5c4fe5dacf1449093..73f2b19b610a4fa1a504e02eea697f860b5cc962 100644 --- a/src/functionObjects/field/streamLine/streamLine.H +++ b/src/functionObjects/field/streamLine/streamLine.H @@ -34,77 +34,114 @@ Description Generates streamline data by sampling a set of user-specified fields along a particle track, transported by a user-specified velocity field. + Operands: + \table + Operand | Type | Location + input | - | - + output file | - <!-- + --> | $FOAM_CASE/postProcessing/sets/\<FO\>/\<time\>/\<file\> + output field | - | - + \endtable + Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim streamLine1 { + // Mandatory entries (unmodifiable) type streamLine; libs (fieldFunctionObjects); - writeControl writeTime; - + // Mandatory entries (runtime modifiable) + U <fieldTrack>; + fields (<fieldTrack> <field1> ... <fieldN>); setFormat vtk; - U U; - //Deprecated: trackForward yes; - direction bidirectional; // or forward/backward - - fields - ( - U - p - ); - + direction bidirectional; lifeTime 10000; - trackLength 1e-3; - nSubCycle 5; - bounds (0.2 -10 -10)(0.22 10 10); cloud particleTracks; - seedSampleSet { type uniform; - axis x; //distance; + axis x; start (-0.0205 0.0001 0.00001); end (-0.0205 0.0005 0.00001); nPoints 100; } + + // Optional entries (runtime modifiable) + bounds (0.2 -10 -10)(0.22 10 10); + trackLength 1e-3; + nSubCycle 1; + interpolationScheme cellPoint; + + // Deprecated + // trackForward true; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: streamLine | yes | - setFormat | Output data type | yes | - U | Tracking velocity field name | no | U - fields | Fields to sample | yes | - direction | Direction to track | yes | - lifetime | Maximum number of particle tracking steps | yes | - trackLength | Tracking segment length | no | - nSubCycle | Number of tracking steps per cell | no| - cloud | Cloud name to use | yes | - bounds | Bounding box to trim tracks | no | invertedBox - seedSampleSet| Seeding method (see below)| yes | + Property | Description | Type | Req'd | Dflt + type | Type name: streamLine | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + U | Name of tracking velocity field | word | yes | - + fields | Names of operand fields to sample | wordList | yes | - + setFormat | Type of output data | word | yes | - + direction | Direction to track | vector | yes | - + lifetime | Maximum number of particle tracking steps | label | yes | - + cloud | Name of cloud | word | yes | - + seedSampleSet| Name of seeding method (see below) | word | yes | - + bounds | Bounding box to trim tracks | vector | no | invertedBox + trackLength | Tracking segment length | scalar | no | VGREAT + nSubCycle | Number of tracking steps per cell | label | no | 1 + interpolationScheme | Interp. scheme for sample | word | no | cellPoint \endtable - Where \c seedSampleSet \c type is typically one of - \plaintable + Options for the \c seedSampleSet entry: + \verbatim uniform | uniform particle seeding cloud | cloud of points triSurfaceMeshPointSet | points according to a tri-surface mesh - \endplaintable + \endverbatim + + Options for the \c setFormat entry: + \verbatim + csv + ensight + gnuplot + jplot + nastran + raw + vtk + xmgr + \endverbatim + + Options for the \c direction entry: + \verbatim + bidirectional + forward + backward + \endverbatim + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. Note - When specifying the track resolution, the \c trackLength OR \c nSubCycle - option should be used + When specifying the track resolution, the \c trackLength or \c nSubCycle + option should be used. See also - Foam::functionObject - Foam::functionObjects::timeControl - Foam::sampledSet - Foam::wallBoundedStreamLine - Foam::streamLineBase + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::sampledSet + - Foam::wallBoundedStreamLine + - Foam::streamLineBase + - ExtendedCodeGuide::functionObjects::field::streamLine SourceFiles streamLine.C @@ -135,21 +172,12 @@ class streamLine : public streamLineBase { - // Private data + // Private Data //- Number of subcycling steps label nSubCycle_; - // Private Member Functions - - //- No copy construct - streamLine(const streamLine&) = delete; - - //- No copy assignment - void operator=(const streamLine&) = delete; - - public: //- Runtime type information @@ -166,9 +194,15 @@ public: const dictionary& dict ); + //- No copy construct + streamLine(const streamLine&) = delete; + + //- No copy assignment + void operator=(const streamLine&) = delete; + //- Destructor - virtual ~streamLine(); + virtual ~streamLine() = default; // Member Functions diff --git a/src/functionObjects/field/subtract/subtract.C b/src/functionObjects/field/subtract/subtract.C index 4e08d3fe99bc38a8c427358f0b770f1b5ef1a242..cec785d8d3258ed0c1424dce98e751024e93b81b 100644 --- a/src/functionObjects/field/subtract/subtract.C +++ b/src/functionObjects/field/subtract/subtract.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -63,10 +64,4 @@ Foam::functionObjects::subtract::subtract } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::subtract::~subtract() -{} - - // ************************************************************************* // diff --git a/src/functionObjects/field/subtract/subtract.H b/src/functionObjects/field/subtract/subtract.H index 1d4a4c5d7ee45885331291c70caa82b0ed5c946e..9e7e93fa67d54fec66a077decd1c1b8e44c57dfe 100644 --- a/src/functionObjects/field/subtract/subtract.H +++ b/src/functionObjects/field/subtract/subtract.H @@ -31,30 +31,69 @@ Group grpFieldFunctionObjects Description - From the first field subtract the remaining fields in the list. + Subtracts a given list of (at least one or more) fields from a field and + produces a new field, where the fields possess the same sizes and + dimensions. - The operation can be applied to any volume or surface fields generating a - volume or surface scalar field. + \verbatim + fieldResult = field1 - field2 - ... - fieldN + \endverbatim + + Operands: + \table + Operand | Type | Location + input | {vol,surface}\<Type\>Field(s) <!-- + --> | $FOAM_CASE/\<time\>/\<inpField\>s + output file | - | - + output field | {vol,surface}\<Type\>Field <!-- + --> | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. - Example of function object specification: +Usage + Minimal example by using \c system/controlDict.functions: \verbatim - Tdiff + subtract1 { + // Mandatory entries (unmodifiable) type subtract; libs (fieldFunctionObjects); - fields (T Tmean); - result Tdiff; - executeControl writeTime; - writeControl writeTime; + + // Mandatory (inherited) entry (runtime modifiable) + fields (<field1> <field2> ... <fieldN>); + + // Optional (inherited) entries + ... } \endverbatim + where the entries mean: + \table + Property | Description | Type | Req'd | Dflt + type | Type name: subtract | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of the operand fields | wordList | yes | - + \endtable + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldsExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func "subtract(<field1>, <field2>, ..., <fieldN>)" + \endverbatim + See also - Foam::functionObjects::fieldsExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fieldsExpression + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::subtract SourceFiles subtract.C + subtractTemplates.C \*---------------------------------------------------------------------------*/ @@ -81,7 +120,7 @@ class subtract // Private Member Functions //- Subtract the list of fields of the specified type - // and return the result + //- and return the result template<class GeoFieldType> tmp<GeoFieldType> calcFieldType() const; @@ -108,9 +147,15 @@ public: const dictionary& dict ); + //- No copy construct + subtract(const subtract&) = delete; + + //- No copy assignment + void operator=(const subtract&) = delete; + //- Destructor - virtual ~subtract(); + virtual ~subtract() = default; }; diff --git a/src/functionObjects/field/subtract/subtractTemplates.C b/src/functionObjects/field/subtract/subtractTemplates.C index 7c8b6d281a6cf2e1251c821f72c3b8908ec3916d..42b5d565860f776674c943c641a69b23c01b778f 100644 --- a/src/functionObjects/field/subtract/subtractTemplates.C +++ b/src/functionObjects/field/subtract/subtractTemplates.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,7 +38,7 @@ Foam::functionObjects::subtract::calcFieldType() const - lookupObject<GeoFieldType>(fieldNames_[1]) ); - for (label i=2; i<fieldNames_.size(); i++) + for (label i = 2; i < fieldNames_.size(); ++i) { tresult.ref() -= lookupObject<GeoFieldType>(fieldNames_[i]); } diff --git a/src/functionObjects/field/surfaceDistance/surfaceDistance.C b/src/functionObjects/field/surfaceDistance/surfaceDistance.C index 4fbd2dec3994cc17d278ad2228f3ad6fbe55ed94..6f08a77b5e4d6318a67092b5a5bac13855f3ce10 100644 --- a/src/functionObjects/field/surfaceDistance/surfaceDistance.C +++ b/src/functionObjects/field/surfaceDistance/surfaceDistance.C @@ -35,13 +35,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(surfaceDistance, 0); - - addToRunTimeSelectionTable - ( - functionObject, - surfaceDistance, - dictionary - ); + addToRunTimeSelectionTable(functionObject, surfaceDistance, dictionary); } } @@ -80,12 +74,6 @@ Foam::functionObjects::surfaceDistance::surfaceDistance } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::surfaceDistance::~surfaceDistance() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::surfaceDistance::read @@ -104,9 +92,9 @@ bool Foam::functionObjects::surfaceDistance::read ( IOobject ( - "abc", // dummy name + "abc", // dummy name mesh_.time().constant(), // directory - "triSurface", // instance + "triSurface", // instance mesh_.time(), // registry IOobject::MUST_READ, IOobject::NO_WRITE diff --git a/src/functionObjects/field/surfaceDistance/surfaceDistance.H b/src/functionObjects/field/surfaceDistance/surfaceDistance.H index 2c0f7960a744cd87fa456c721221b39cdbae74ae..7126fc60039177ac2e4bf2adf433be61af4234c2 100644 --- a/src/functionObjects/field/surfaceDistance/surfaceDistance.H +++ b/src/functionObjects/field/surfaceDistance/surfaceDistance.H @@ -30,17 +30,26 @@ Group grpFieldFunctionObjects Description - Writes a scalar field whose value is the distance to the nearest surface. - The output field name is 'surfaceDistance'. + Computes the distance to the nearest surface from a given geometry. + + Operands: + \table + Operand | Type | Location + input | - | - + output file | - | - + output field | volScalarField | $FOAM_CASE/\<time\>/surfaceDistance + \endtable Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim - surfaceDistance + surfaceDistance1 { + // Mandatory entries (unmodifiable) type surfaceDistance; libs (fieldFunctionObjects); + // Mandatory entries (runtime modifiable) geometry { motorBike.obj @@ -49,25 +58,33 @@ Usage name motorBike; } } + + // Optional entries (runtime modifiable) + calculateCells true; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default - type | Type name: surfaceDistance | yes | - geometry | Surfaces | yes | no - doCells | Calculate distance from cell | no | true + Property | Description | Type | Req'd | Dflt + type | Type name: surfaceDistance | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + geometry | Surface details | dict | yes | - + calculateCells | Calculate distance from cell | bool | no | true \endtable - Run with e.g. - - postProcess -func surfaceDistance + The inherited entries are elaborated in: + - \link functionObject.H \endlink + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::timeControl + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::surfaceDistance SourceFiles surfaceDistance.C @@ -104,7 +121,7 @@ class surfaceDistance { protected: - // Protected data + // Protected Data //- Switch to calculate distance-to-cells Switch doCells_; @@ -113,17 +130,6 @@ protected: autoPtr<searchableSurfaces> geomPtr_; -private: - - // Private member functions - - //- No copy construct - surfaceDistance(const surfaceDistance&) = delete; - - //- No copy assignment - void operator=(const surfaceDistance&) = delete; - - public: //- Runtime type information @@ -141,9 +147,15 @@ public: const dictionary& dict ); + //- No copy construct + surfaceDistance(const surfaceDistance&) = delete; + + //- No copy assignment + void operator=(const surfaceDistance&) = delete; + //- Destructor - virtual ~surfaceDistance(); + virtual ~surfaceDistance() = default; // Member Functions diff --git a/src/functionObjects/field/surfaceInterpolate/surfaceInterpolate.C b/src/functionObjects/field/surfaceInterpolate/surfaceInterpolate.C index 891b065a3070bc5887cb924bab62a5243d66d8d6..0e3511b09595846fea4745fe4b1912ab22fe640f 100644 --- a/src/functionObjects/field/surfaceInterpolate/surfaceInterpolate.C +++ b/src/functionObjects/field/surfaceInterpolate/surfaceInterpolate.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,13 +37,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(surfaceInterpolate, 0); - - addToRunTimeSelectionTable - ( - functionObject, - surfaceInterpolate, - dictionary - ); + addToRunTimeSelectionTable(functionObject, surfaceInterpolate, dictionary); } } @@ -64,12 +58,6 @@ Foam::functionObjects::surfaceInterpolate::surfaceInterpolate } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::surfaceInterpolate::~surfaceInterpolate() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::surfaceInterpolate::read @@ -95,7 +83,7 @@ bool Foam::functionObjects::surfaceInterpolate::execute() interpolateFields<symmTensor>(); interpolateFields<tensor>(); - Info<< endl; + Log << endl; return true; } diff --git a/src/functionObjects/field/surfaceInterpolate/surfaceInterpolate.H b/src/functionObjects/field/surfaceInterpolate/surfaceInterpolate.H index bff41b2aa65be5658495760ac01f1f4325d84541..c7ade799cbb5f448b08e646a990158058825e687 100644 --- a/src/functionObjects/field/surfaceInterpolate/surfaceInterpolate.H +++ b/src/functionObjects/field/surfaceInterpolate/surfaceInterpolate.H @@ -33,41 +33,54 @@ Group Description Linearly interpolates volume fields to generate surface fields. - Fields are stored - - every time step the field is updated with new values - - at output it writes the fields + Operands: + \table + Operand | Type | Location + input | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | surface\<Type\>Field | $FOAM_CASE/\<time\>/\<outField\> + \endtable - This functionObject can either be used - - to calculate a new field as a post-processing step or - - since the fields are registered, used in another functionObject + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim surfaceInterpolate1 { + // Mandatory entries (unmodifiable) type surfaceInterpolate; libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + fields ((<inpField1> <outField1>) ... (<inpFieldN> <outFieldN>)); + + // Optional (inherited) entries ... - fields ((p pNear)(U UNear)); } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: nearWallFields | yes | - fields | list of fields with corresponding output field names | yes | - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: surfaceInterpolate | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of operand and output fields | wordList | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. See also - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::timeControl + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::surfaceInterpolate SourceFiles surfaceInterpolate.C + surfaceInterpolateTemplates.C \*---------------------------------------------------------------------------*/ @@ -92,7 +105,7 @@ namespace functionObjects { /*---------------------------------------------------------------------------*\ - Class surfaceInterpolate Declaration + Class surfaceInterpolate Declaration \*---------------------------------------------------------------------------*/ class surfaceInterpolate @@ -101,32 +114,19 @@ class surfaceInterpolate { protected: - // Protected data + // Protected Data //- Fields to process List<Tuple2<word, word>> fieldSet_; - //- Switch to send output to Info as well as to file - Switch log_; - // Protected Member Functions + //- Linearly interpolate volume fields to generate surface fields template<class Type> void interpolateFields(); -private: - - // Private member functions - - //- No copy construct - surfaceInterpolate(const surfaceInterpolate&) = delete; - - //- No copy assignment - void operator=(const surfaceInterpolate&) = delete; - - public: //- Runtime type information @@ -144,9 +144,15 @@ public: const dictionary& dict ); + //- No copy construct + surfaceInterpolate(const surfaceInterpolate&) = delete; + + //- No copy assignment + void operator=(const surfaceInterpolate&) = delete; + //- Destructor - virtual ~surfaceInterpolate(); + virtual ~surfaceInterpolate() = default; // Member Functions diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFields.C b/src/functionObjects/field/turbulenceFields/turbulenceFields.C index f1590e2a88dda44ca1f33ae249c7fc0db7888cfa..986ad7a958cc4556583a33be4822711ac8109b3f 100644 --- a/src/functionObjects/field/turbulenceFields/turbulenceFields.C +++ b/src/functionObjects/field/turbulenceFields/turbulenceFields.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2015-2018 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,13 +38,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(turbulenceFields, 0); - - addToRunTimeSelectionTable - ( - functionObject, - turbulenceFields, - dictionary - ); + addToRunTimeSelectionTable(functionObject, turbulenceFields, dictionary); } } @@ -88,7 +82,7 @@ Foam::functionObjects::turbulenceFields::incompressibleFieldNames_ }); -const Foam::word Foam::functionObjects::turbulenceFields::modelName +const Foam::word Foam::functionObjects::turbulenceFields::modelName_ ( Foam::turbulenceModel::propertiesName ); @@ -98,11 +92,11 @@ const Foam::word Foam::functionObjects::turbulenceFields::modelName bool Foam::functionObjects::turbulenceFields::compressible() { - if (obr_.foundObject<compressible::turbulenceModel>(modelName)) + if (obr_.foundObject<compressible::turbulenceModel>(modelName_)) { return true; } - else if (obr_.foundObject<incompressible::turbulenceModel>(modelName)) + else if (obr_.foundObject<incompressible::turbulenceModel>(modelName_)) { return false; } @@ -131,12 +125,6 @@ Foam::functionObjects::turbulenceFields::turbulenceFields } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::turbulenceFields::~turbulenceFields() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::turbulenceFields::read(const dictionary& dict) @@ -158,7 +146,7 @@ bool Foam::functionObjects::turbulenceFields::read(const dictionary& dict) Info<< "storing fields:" << nl; for (const word& f : fieldSet_) { - Info<< " " << modelName << ':' << f << nl; + Info<< " " << modelName_ << ':' << f << nl; } Info<< endl; } @@ -178,7 +166,7 @@ bool Foam::functionObjects::turbulenceFields::execute() if (comp) { const compressible::turbulenceModel& model = - obr_.lookupObject<compressible::turbulenceModel>(modelName); + obr_.lookupObject<compressible::turbulenceModel>(modelName_); for (const word& f : fieldSet_) { @@ -255,7 +243,7 @@ bool Foam::functionObjects::turbulenceFields::execute() else { const incompressible::turbulenceModel& model = - obr_.lookupObject<incompressible::turbulenceModel>(modelName); + obr_.lookupObject<incompressible::turbulenceModel>(modelName_); for (const word& f : fieldSet_) { @@ -328,7 +316,7 @@ bool Foam::functionObjects::turbulenceFields::write() { for (const word& f : fieldSet_) { - const word fieldName = modelName + ':' + f; + const word fieldName = modelName_ + ':' + f; writeObject(fieldName); } diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFields.H b/src/functionObjects/field/turbulenceFields/turbulenceFields.H index 1c290e4ba7f2002240efc9fe4d1096e57198fd05..773a93bbee0beddbfd91c7bef9e912cde85e3161 100644 --- a/src/functionObjects/field/turbulenceFields/turbulenceFields.H +++ b/src/functionObjects/field/turbulenceFields/turbulenceFields.H @@ -31,63 +31,90 @@ Group grpFieldFunctionObjects Description - Stores turbulence fields on the mesh database for further manipulation. + Computes various turbulence-related quantities that are not typically + output during calculations, and stores/writes them on the mesh database + for further manipulation. Fields are stored as copies of the original, with the prefix - "tubulenceModel:", e.g.: + "turbulenceModel:", e.g.: \verbatim - turbulenceModel:R + turbulenceModel:R \endverbatim + Operands: + \table + Operand | Type | Location + input | - | - + output file | - | - + output field | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/SymmTensor. + Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim turbulenceFields1 { + // Mandatory entries (unmodifiable) type turbulenceFields; libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + // Either field or fields entries + fields (R devRhoReff); + field R; + + // Optional (inherited) entries ... - fields - ( - R - devRhoReff - ); } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: turbulenceFields | yes | - fields | fields to store (see below) | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: turbulenceFields | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Names of fields to store (see below) | wordList | yes | - + field | Name of a field to store (see below) | word | yes | - \endtable - Where \c fields can include: - \plaintable - k | turbulence kinetic energy - epsilon | turbulence kinetic energy dissipation rate - omega | turbulence specific dissipation rate - nuTilda | turbulence modified viscosity - nut | turbulence viscosity (incompressible) - nuEff | effective turbulence viscosity (incompressible) - mut | turbulence viscosity (compressible) - muEff | effective turbulence viscosity (compressible) - alphat | turbulence thermal diffusivity (compressible) - alphaEff | effective turbulence thermal diffusivity (compressible) - R | Reynolds stress tensor - devReff | Deviatoric part of the effective Reynolds stress - devRhoReff | Divergence of the Reynolds stress - L | turbulence length scale - I | turbulence intensity - \endplaintable + where \c fields can include: + \verbatim + k | turbulent kinetic energy + epsilon | turbulent kinetic energy dissipation rate + omega | specific dissipation rate + nuTilda | modified turbulent viscosity + nut | turbulent viscosity (incompressible) + nuEff | effective turbulent viscosity (incompressible) + mut | turbulent viscosity (compressible) + muEff | effective turbulent viscosity (compressible) + alphat | turbulence thermal diffusivity (compressible) + alphaEff | effective turbulence thermal diffusivity (compressible) + R | Reynolds stress tensor + devReff | deviatoric part of the effective Reynolds stress + devRhoReff | divergence of the Reynolds stress + L | integral-length scale / mixing-length scale + I | turbulence intensity + \endverbatim + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + <solver> -postProcess -func turbulenceFields + \endverbatim See also - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::timeControl + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::turbulenceFields SourceFiles turbulenceFields.C + turbulenceFieldsTemplates.C \*---------------------------------------------------------------------------*/ @@ -117,44 +144,52 @@ class turbulenceFields { public: - enum compressibleField - { - cfK, - cfEpsilon, - cfOmega, - cfNuTilda, - cfMut, - cfMuEff, - cfAlphat, - cfAlphaEff, - cfR, - cfDevRhoReff, - cfL, - cfI - }; - static const Enum<compressibleField> compressibleFieldNames_; - - enum incompressibleField - { - ifK, - ifEpsilon, - ifOmega, - ifNuTilda, - ifNut, - ifNuEff, - ifR, - ifDevReff, - ifL, - ifI - }; - static const Enum<incompressibleField> incompressibleFieldNames_; - - static const word modelName; - + // Public Enumerations + + //- Options for the turbulence fields (compressible) + enum compressibleField + { + cfK, //!< "Turbulent kinetic energy" + cfEpsilon, //!< "Turbulent kinetic energy dissipation rate" + cfOmega, //!< "Specific dissipation rate" + cfNuTilda, //!< "Modified turbulent viscosity" + cfMut, //!< "Turbulent viscosity" + cfMuEff, //!< "Effective turbulent viscosity" + cfAlphat, //!< "Turbulence thermal diffusivity" + cfAlphaEff, //!< "Effective turbulence thermal diffusivity" + cfR, //!< "Reynolds stress tensor" + cfDevRhoReff, //!< "Divergence of the Reynolds stress" + cfL, //!< "Integral-length/Mixing-length scale" + cfI //!< "Turbulence intensity" + }; + + //- Names for compressibleField turbulence fields + static const Enum<compressibleField> compressibleFieldNames_; + + //- Options for the turbulence fields (incompressible) + enum incompressibleField + { + ifK, //!< "Turbulent kinetic energy" + ifEpsilon, //!< "Turbulent kinetic energy dissipation rate" + ifOmega, //!< "Specific dissipation rate" + ifNuTilda, //!< "Modified turbulent viscosity" + ifNut, //!< "Turbulent viscosity" + ifNuEff, //!< "Effective turbulent viscosity" + ifR, //!< "Reynolds stress tensor" + ifDevReff, //!< "Deviatoric part of the effective Reynolds stress" + ifL, //!< "Integral-length/Mixing-length scale" + ifI //!< "Turbulence intensity" + }; + + //- Names for incompressibleField turbulence fields + static const Enum<incompressibleField> incompressibleFieldNames_; + + //- Turbulence closure model name + static const word modelName_; protected: - // Protected data + // Protected Data //- Fields to load wordHashSet fieldSet_; @@ -181,26 +216,15 @@ protected: template<class Model> tmp<volScalarField> nuTilda(const Model& model) const; - //- Return L calculated from k and epsilon + //- Return integral length scale, L, calculated from k and epsilon template<class Model> tmp<volScalarField> L(const Model& model) const; - //- Return I calculated from k and U + //- Return turbulence intensity, I, calculated from k and U template<class Model> tmp<volScalarField> I(const Model& model) const; -private: - - // Private member functions - - //- No copy construct - turbulenceFields(const turbulenceFields&) = delete; - - //- No copy assignment - void operator=(const turbulenceFields&) = delete; - - public: //- Runtime type information @@ -217,9 +241,15 @@ public: const dictionary& dict ); + //- No copy construct + turbulenceFields(const turbulenceFields&) = delete; + + //- No copy assignment + void operator=(const turbulenceFields&) = delete; + //- Destructor - virtual ~turbulenceFields(); + virtual ~turbulenceFields() = default; // Member Functions diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C b/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C index d5e55d03ba6ab1ecd08d7dcece9fa27b3f49e322..5506a0b9fddb2a30620b1b1c411b36cbc4915354 100644 --- a/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C +++ b/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2016 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,7 +39,7 @@ void Foam::functionObjects::turbulenceFields::processField { typedef GeometricField<Type, fvPatchField, volMesh> FieldType; - const word scopedName = modelName + ':' + fieldName; + const word scopedName = modelName_ + ':' + fieldName; FieldType* fldPtr = obr_.getObjectPtr<FieldType>(scopedName); @@ -157,4 +157,5 @@ Foam::functionObjects::turbulenceFields::I ); } + // ************************************************************************* // diff --git a/src/functionObjects/field/valueAverage/valueAverage.C b/src/functionObjects/field/valueAverage/valueAverage.C index 2a23e9d90538030adb35db4a797eab2404b6dfa7..750b053dc794015efa3af1c5bee17afc181dd399 100644 --- a/src/functionObjects/field/valueAverage/valueAverage.C +++ b/src/functionObjects/field/valueAverage/valueAverage.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015 OpenFOAM Foundation - Copyright (C) 2015-2017 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,13 +37,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(valueAverage, 0); - - addToRunTimeSelectionTable - ( - functionObject, - valueAverage, - dictionary - ); + addToRunTimeSelectionTable(functionObject, valueAverage, dictionary); } } @@ -99,12 +93,6 @@ Foam::functionObjects::valueAverage::valueAverage } -// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // - -Foam::functionObjects::valueAverage::~valueAverage() -{} - - // * * * * * * * * * * * * * * Public Member Functions * * * * * * * * * * * // bool Foam::functionObjects::valueAverage::read(const dictionary& dict) diff --git a/src/functionObjects/field/valueAverage/valueAverage.H b/src/functionObjects/field/valueAverage/valueAverage.H index f72cb86daa524fdb5a67c399c8217c9c63969022..1b639a8d086c0a2c95d912780fa1c3f0c7990c6c 100644 --- a/src/functionObjects/field/valueAverage/valueAverage.H +++ b/src/functionObjects/field/valueAverage/valueAverage.H @@ -31,42 +31,63 @@ Group grpFieldFunctionObjects Description - This function object calculates the average value from the output of - function objects that generate singular values. + Computes the ensemble- or time-based singular-value average values, + with optional windowing, from the output of function objects + that generate non-field type values (e.g. \c Cd of \c forceCoeffs or + \c momentum_x in \c momentum function objects). + + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | - | - + \endtable Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim valueAverage1 { - type valueAverage; - libs (fieldFunctionObjects); + // Mandatory entries (unmodifiable) + type valueAverage; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + functionObject <FO>; // forceCoeffs1; + fields (<field1> ... <fieldN>); // (Cm Cd Cl); + + // Optional entries (runtime modifiable) + resetOnRestart false; + window 0.5; + + // Optional (inherited) entries ... - writeToFile yes; - log yes; - functionObject forceCoeffs1; - fields (Cm Cd Cl); - window 0.5; } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: valueAverage | yes | - writeToFile | write average data to file | no | yes - log | write average data to standard output | no | yes - fields | list of fields to process | yes | - functionObject | Name of function object to retrieve data from | yes | - resetOnRestart | Reset the averaging on restart | no | no | + Property | Description | Type | Req'd | Dflt + type | Type name: valueAverage | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + functionObject | Name of function object to retrieve data | word | yes | - + fields | Names of operand fields | wordList | yes | - + resetOnRestart | Reset the averaging on restart | bool | no | false + window | Averaging window | scalar | no | VGREAT \endtable - Output data is written to the file \<timeDir\>/valueAverage.dat + The inherited entries are elaborated in: + - \link regionFunctionObject.H \endlink + - \link writeFile.H \endlink + + Usage by the \c postProcess utility is not available. See also - Foam::functionObject - Foam::functionObjects::stateFunctionObject - Foam::functionObjects::writeFile + - Foam::functionObject + - Foam::functionObjects::stateFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::valueAverage SourceFiles valueAverage.C @@ -98,7 +119,7 @@ class valueAverage { protected: - // Protected data + // Protected Data //- Name of function object to retrieve data from word functionObjectName_; @@ -132,28 +153,32 @@ protected: //- Output file header information virtual void writeFileHeader(Ostream& os) const; - //- No copy construct - valueAverage(const valueAverage&) = delete; - - //- No copy assignment - void operator=(const valueAverage&) = delete; - public: //- Runtime type information TypeName("valueAverage"); - //- Constructor - valueAverage - ( - const word& name, - const Time& runTime, - const dictionary& dict - ); + + // Constructors + + //- Construct from Time and dictionary + valueAverage + ( + const word& name, + const Time& runTime, + const dictionary& dict + ); + + //- No copy construct + valueAverage(const valueAverage&) = delete; + + //- No copy assignment + void operator=(const valueAverage&) = delete; + //- Destructor - virtual ~valueAverage(); + virtual ~valueAverage() = default; // Public Member Functions diff --git a/src/functionObjects/field/vorticity/vorticity.C b/src/functionObjects/field/vorticity/vorticity.C index 2ddb157a0ff2a393e091e87fc7af99f420ffab43..7329e2efcb225846dab339432dda2f8c9addcf24 100644 --- a/src/functionObjects/field/vorticity/vorticity.C +++ b/src/functionObjects/field/vorticity/vorticity.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,13 +37,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(vorticity, 0); - - addToRunTimeSelectionTable - ( - functionObject, - vorticity, - dictionary - ); + addToRunTimeSelectionTable(functionObject, vorticity, dictionary); } } @@ -79,10 +74,4 @@ Foam::functionObjects::vorticity::vorticity } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::vorticity::~vorticity() -{} - - // ************************************************************************* // diff --git a/src/functionObjects/field/vorticity/vorticity.H b/src/functionObjects/field/vorticity/vorticity.H index 51ef99c1c9030d52918f88c658411923a1e5c6d7..fc38fe517a5770472a558eba2ef713315a62e040 100644 --- a/src/functionObjects/field/vorticity/vorticity.H +++ b/src/functionObjects/field/vorticity/vorticity.H @@ -31,33 +31,61 @@ Group grpFieldFunctionObjects Description - Calculates the vorticity, the curl of the velocity. + Computes the vorticity, the curl of the velocity. - The field is stored on the mesh database so that it can be retrieved - and used for other applications. + \f[ + \vec \omega = \nabla \times \vec U + \f] + + where + \vartable + \vec \omega | Vorticity vector [1/s] + \vec U | Velocity vector [m/s] + \endvartable + + Operands: + \table + Operand | Type | Location + input | volVectorField | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | volVectorField | $FOAM_CASE/\<time\>/\<outField\> + \endtable Usage + Minimal example by using \c system/controlDict.functions: \verbatim vorticity1 { + // Mandatory entries (unmodifiable) type vorticity; libs (fieldFunctionObjects); + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: vorticity | yes | - U | Name of velocity field | no | U - result | Name of Courant number field | no | \<function name\> - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: vorticity | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link fieldExpression.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func vorticity + \endverbatim + See also - Foam::functionObjects::fieldExpression - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::fieldExpression + - ExtendedCodeGuide::functionObjects::field::vorticity SourceFiles vorticity.C @@ -106,9 +134,15 @@ public: const dictionary& dict ); + //- No copy construct + vorticity(const vorticity&) = delete; + + //- No copy assignment + void operator=(const vorticity&) = delete; + //- Destructor - virtual ~vorticity(); + virtual ~vorticity() = default; }; diff --git a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C index 338d9fcaf5c960dfdfd2710243f803e9b39252b6..0b1796c47144a565a2088465153132e1925f8163 100644 --- a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C +++ b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,7 +39,6 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(wallBoundedStreamLine, 0); - addToRunTimeSelectionTable ( functionObject, @@ -126,7 +125,7 @@ Foam::point Foam::functionObjects::wallBoundedStreamLine::pushIn // << " seed:" << pt << exit(FatalError); //} - return (1.0-ROOTSMALL)*pt+ROOTSMALL*tri.centre(); + return (1.0 - ROOTSMALL)*pt + ROOTSMALL*tri.centre(); } @@ -305,12 +304,6 @@ Foam::functionObjects::wallBoundedStreamLine::wallBoundedStreamLine } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::wallBoundedStreamLine::~wallBoundedStreamLine() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::wallBoundedStreamLine::read(const dictionary& dict) diff --git a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H index 6423f0e5620317ed444c7189edfd3f2034b61a7d..7c66ba0b1865f5737b71e8e6739157337db950d2 100644 --- a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H +++ b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H @@ -35,32 +35,30 @@ Description particle track, transported by a user-specified velocity field, constrained to a patch. + Operands: + \table + Operand | Type | Location + input | - | - + output file | - | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | - | - + \endtable + Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim wallBoundedStreamLine1 { + // Mandatory entries (unmodifiable) type wallBoundedStreamLine; libs (fieldFunctionObjects); - writeControl writeTime; - + // Mandatory entries (runtime modifiable) + U <fieldTrack>; + fields (<fieldTrack> <field1> ... <fieldN>); setFormat vtk; - U UNear; - //Deprecated: trackForward yes; - direction bidirectional; // or forward/backward - - fields - ( - UNear - p - ); - + direction bidirectional; lifeTime 10000; - trackLength 1e-3; - bounds (0.2 -10 -10)(0.22 10 10); cloud particleTracks; - seedSampleSet { type patchSeed; @@ -68,39 +66,79 @@ Usage axis x; maxPoints 20000; } + + // Optional entries (runtime modifiable) + bounds (0.2 -10 -10)(0.22 10 10); + trackLength 1e-3; + nSubCycle 1; + interpolationScheme cellPoint; + + // Deprecated + // trackForward true; + + // Optional (inherited) entries + ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: wallBoundedStreamLine| yes | - setFormat | Output data type | yes | - U | Tracking velocity field name | yes | - fields | Fields to sample | yes | - direction | Direction to track | yes | - lifetime | Maximum number of particle tracking steps | yes | - trackLength | Tracking segment length | no | - nSubCycle | Number of tracking steps per cell | no| - cloud | Cloud name to use | yes | - bounds | Bounding box to trim tracks | no | invertedBox - seedSampleSet| Seeding method (see below)| yes | + Property | Description | Type | Req'd | Dflt + type | Type name: wallBoundedStreamLine | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + U | Name of tracking velocity field | word | yes | - + fields | Names of operand fields to sample | wordList | yes | - + setFormat | Type of output data | word | yes | - + direction | Direction to track | vector | yes | - + lifetime | Maximum number of particle tracking steps | label | yes | - + cloud | Name of cloud | word | yes | - + seedSampleSet| Name of seeding method (see below) | word | yes | - + bounds | Bounding box to trim tracks | vector | no | invertedBox + trackLength | Tracking segment length | scalar | no | VGREAT + nSubCycle | Number of tracking steps per cell | label | no | 1 + interpolationScheme | Interp. scheme for sample | word | no | cellPoint \endtable - Where \c seedSampleSet \c type is typically one of - \plaintable - uniform | uniform particle seeding - cloud | cloud of points - patchSeed | seeding via patch faces - triSurfaceMeshPointSet | points according to a tri-surface mesh - \endplaintable + Options for the \c seedSampleSet entry: + \verbatim + uniform | uniform particle seeding + cloud | cloud of points + patchSeed | seeding via patch faces + triSurfaceMeshPointSet | points according to a tri-surface mesh + \endverbatim + + Options for the \c setFormat entry: + \verbatim + csv + ensight + gnuplot + jplot + nastran + raw + vtk + xmgr + \endverbatim + + Options for the \c direction entry: + \verbatim + bidirectional + forward + backward + \endverbatim + + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. Note When specifying the track resolution, the \c trackLength OR \c nSubCycle - option should be used + option should be used. See also - Foam::functionObjects::streamLineBase + - Foam::functionObject + - Foam::functionObjects::streamLineBase + - ExtendedCodeGuide::functionObjects::field::wallBoundedStreamLine SourceFiles wallBoundedStreamLine.C @@ -128,15 +166,6 @@ class wallBoundedStreamLine : public streamLineBase { - // Private Member Functions - - //- No copy construct - wallBoundedStreamLine(const wallBoundedStreamLine&) = delete; - - //- No copy assignment - void operator=(const wallBoundedStreamLine&) = delete; - - protected: // Protected Member Functions @@ -150,7 +179,7 @@ protected: ) const; //- Push a point a tiny bit towards the centre of the triangle it is in - // to avoid tracking problems + //- to avoid tracking problems point pushIn ( const triPointRef& tri, @@ -183,9 +212,15 @@ public: const wordList& fieldNames ); + //- No copy construct + wallBoundedStreamLine(const wallBoundedStreamLine&) = delete; + + //- No copy assignment + void operator=(const wallBoundedStreamLine&) = delete; + //- Destructor - virtual ~wallBoundedStreamLine(); + virtual ~wallBoundedStreamLine() = default; // Member Functions diff --git a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C index 9e1e361a1ad63139909e5d74eb67f252e5115653..dc4b82ca70c8fafc93b68cc6aeff212c9cede615 100644 --- a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C +++ b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C @@ -51,7 +51,6 @@ namespace functionObjects void Foam::functionObjects::wallHeatFlux::writeFileHeader(Ostream& os) const { - // Add headers to output data writeHeader(os, "Wall heat-flux"); writeCommented(os, "Time"); writeTabbed(os, "patch"); diff --git a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H index f4b49a1fcca7d3b5ffbbc1e7ddf906a875fc46d8..b4f8e12a37a7d8e04715434ce8adbb114588327b 100644 --- a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H +++ b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.H @@ -31,39 +31,58 @@ Group grpForcesFunctionObjects Description - Calculates and write the heat-flux at wall patches as the - volScalarField field 'wallHeatFlux'. + Computes the wall-heat flux at selected wall patches. - All wall patches are included by default; to restrict the calculation to - certain patches, use the optional 'patches' entry. + \table + Operand | Type | Location + input | - | - + output file | dat <!-- + --> | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<field\> + output field | volScalarField (only boundaryField) <!-- + --> | $FOAM_CASE/\<time\>/\<outField\> + \endtable Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim wallHeatFlux1 { + // Mandatory entries (unmodifiable) type wallHeatFlux; libs (fieldFunctionObjects); + + // Optional entries (runtime modifiable) + patches (<patch1> ... <patchN>); // (wall1 "(wall2|wall3)"); + qr qr; + + // Optional (inherited) entries ... - region fluid; - patches (".*Wall"); } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default - type | type name: wallHeatFlux | yes | - patches | list of patches to process | no | all wall patches - qr | name of radiative heat flux field | no | qr - region | region to be evaluated | no | default region + Property | Description | Type | Req'd | Dflt + type | Type name: wallHeatFlux | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + patches | Names of operand patches | wordList | no | all wall patches + qr | Name of radiative heat flux field | word | no | qr \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + <solver> -postProcess -func wallHeatFlux + \endverbatim + See also - Foam::functionObject - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile - Foam::functionObjects::timeControl + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::wallHeatFlux SourceFiles wallHeatFlux.C @@ -101,7 +120,7 @@ protected: //- Optional list of wall patches to process labelHashSet patchSet_; - //- Name of radiative heat flux name, default = qr + //- Name of radiative heat flux name word qrName_; @@ -119,15 +138,6 @@ protected: ); - // Protected Member Functions - - //- No copy construct - wallHeatFlux(const wallHeatFlux&) = delete; - - //- No copy assignment - void operator=(const wallHeatFlux&) = delete; - - public: //- Runtime type information @@ -144,6 +154,12 @@ public: const dictionary& ); + //- No copy construct + wallHeatFlux(const wallHeatFlux&) = delete; + + //- No copy assignment + void operator=(const wallHeatFlux&) = delete; + //- Destructor virtual ~wallHeatFlux() = default; diff --git a/src/functionObjects/field/wallShearStress/wallShearStress.C b/src/functionObjects/field/wallShearStress/wallShearStress.C index 7859eb8a81049bc51940e5b8cd418633ee4c239b..f88cd7494561b15a38d6b56a8bc6f7a96c125ebb 100644 --- a/src/functionObjects/field/wallShearStress/wallShearStress.C +++ b/src/functionObjects/field/wallShearStress/wallShearStress.C @@ -50,13 +50,12 @@ namespace functionObjects void Foam::functionObjects::wallShearStress::writeFileHeader(Ostream& os) const { - // Add headers to output data writeHeader(os, "Wall shear stress"); writeCommented(os, "Time"); writeTabbed(os, "patch"); writeTabbed(os, "min"); writeTabbed(os, "max"); - os << endl; + os << endl; } diff --git a/src/functionObjects/field/wallShearStress/wallShearStress.H b/src/functionObjects/field/wallShearStress/wallShearStress.H index 0ffc6252ab27215cf159ab894ce76381d24ecb68..f0c119a8b8d1ba7987552c7d3c4ab08b2a2cd1d4 100644 --- a/src/functionObjects/field/wallShearStress/wallShearStress.H +++ b/src/functionObjects/field/wallShearStress/wallShearStress.H @@ -31,49 +31,67 @@ Group grpForcesFunctionObjects Description - Calculates and write the shear-stress at wall patches as - the volVectorField field 'wallShearStress'. + Computes the wall-shear stress at selected wall patches. - \f[ - Stress = R \dot n - \f] + \f[ + \vec \tau = \vec R \cdot \vec n + \f] where \vartable - R | stress tensor - n | patch normal vector (into the domain) + \vec \tau | Wall shear stress vector [m^2/s^2] + \vec R | Shear-stress symmetric tensor (retrieved from turbulence model) + \vec n | Patch normal vector (into the domain) \endvartable - The shear-stress symmetric tensor field is retrieved from the turbulence - model. All wall patches are included by default; to restrict the - calculation to certain patches, use the optional 'patches' entry. + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<field\> + output field | volVectorField (only boundaryField) <!-- + --> | $FOAM_CASE/\<time\>/\<outField\> + \endtable Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim wallShearStress1 { + // Mandatory entries (unmodifiable) type wallShearStress; libs (fieldFunctionObjects); + + // Optional entries (runtime modifiable) + patches (<patch1> ... <patchN>); // (wall1 "(wall2|wall3)"); + + // Optional (inherited) entries ... - patches (".*Wall"); } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: wallShearStress | yes | - resultName | Name of wall shear stress field | no | \<function name\> - patches | list of patches to process | no | all wall patches - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: wallShearStress | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + patches | Names of operand patches | wordList | no | all wall patches \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + <solver> -postProcess -func wallShearStress + \endverbatim + See also - Foam::functionObject - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile - Foam::functionObjects::timeControl + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::wallShearStress SourceFiles wallShearStress.C @@ -104,7 +122,6 @@ class wallShearStress public fvMeshFunctionObject, public writeFile { - protected: // Protected Data @@ -125,12 +142,6 @@ protected: volVectorField& shearStress ); - //- No copy construct - wallShearStress(const wallShearStress&) = delete; - - //- No copy assignment - void operator=(const wallShearStress&) = delete; - public: @@ -148,6 +159,12 @@ public: const dictionary& ); + //- No copy construct + wallShearStress(const wallShearStress&) = delete; + + //- No copy assignment + void operator=(const wallShearStress&) = delete; + //- Destructor virtual ~wallShearStress() = default; diff --git a/src/functionObjects/field/writeCellCentres/writeCellCentres.C b/src/functionObjects/field/writeCellCentres/writeCellCentres.C index 92b47b1a027f6e9e03ab363aff58c5e91965526a..313a92d2cd66445a8ce9adce86840df3fc6c8fdd 100644 --- a/src/functionObjects/field/writeCellCentres/writeCellCentres.C +++ b/src/functionObjects/field/writeCellCentres/writeCellCentres.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -57,12 +57,6 @@ Foam::functionObjects::writeCellCentres::writeCellCentres } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::writeCellCentres::~writeCellCentres() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::writeCellCentres::read(const dictionary& dict) @@ -79,7 +73,7 @@ bool Foam::functionObjects::writeCellCentres::execute() bool Foam::functionObjects::writeCellCentres::write() { - volVectorField C + const volVectorField C ( IOobject ( @@ -94,14 +88,15 @@ bool Foam::functionObjects::writeCellCentres::write() calculatedFvPatchScalarField::typeName ); - Log << " Writing cell-centre field " << C.name() + Log << type() << " " << name() << " write:" << nl + << " writing cell-volumes field " << C.name() << " to " << time_.timeName() << endl; C.write(); - for (direction i=0; i<vector::nComponents; i++) + for (direction i = 0; i < vector::nComponents; ++i) { - volScalarField Ci + const volScalarField Ci ( IOobject ( diff --git a/src/functionObjects/field/writeCellCentres/writeCellCentres.H b/src/functionObjects/field/writeCellCentres/writeCellCentres.H index b1baa6459527e467ba5102ec0194af6786c7f041..cd9a7b5ba732f937aa9bd404dc13ecb144928444 100644 --- a/src/functionObjects/field/writeCellCentres/writeCellCentres.H +++ b/src/functionObjects/field/writeCellCentres/writeCellCentres.H @@ -32,27 +32,50 @@ Group Description Writes the cell-centres volVectorField and the three component fields as - volScalarFields. + \c volScalarFields. + + Operands: + \table + Operand | Type | Location + input | - | - + output file | - | - + output field 1 | volVectorField | $FOAM_CASE/\<time\>/C + output field 2 | volScalarField | $FOAM_CASE/\<time\>/{Cx,Cy,Cz} + \endtable Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim writeCellCentres { + // Mandatory entries (unmodifiable) type writeCellCentres; libs (fieldFunctionObjects); + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: writeCellCentres | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: writeCellCentres | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func writeCellCentres + \endverbatim + See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::writeCellCentres SourceFiles writeCellCentres.C @@ -79,15 +102,6 @@ class writeCellCentres : public fvMeshFunctionObject { - // Private member functions - - //- No copy construct - writeCellCentres(const writeCellCentres&) = delete; - - //- No copy assignment - void operator=(const writeCellCentres&) = delete; - - public: //- Runtime type information @@ -104,9 +118,15 @@ public: const dictionary& dict ); + //- No copy construct + writeCellCentres(const writeCellCentres&) = delete; + + //- No copy assignment + void operator=(const writeCellCentres&) = delete; + //- Destructor - virtual ~writeCellCentres(); + virtual ~writeCellCentres() = default; // Member Functions diff --git a/src/functionObjects/field/writeCellVolumes/writeCellVolumes.C b/src/functionObjects/field/writeCellVolumes/writeCellVolumes.C index be1ff1a96bf67d94cd52d7cc725f03dc6a3a79c5..f4e5301ffa28b575c93e8d14256dbd5c7951dc1e 100644 --- a/src/functionObjects/field/writeCellVolumes/writeCellVolumes.C +++ b/src/functionObjects/field/writeCellVolumes/writeCellVolumes.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -57,12 +57,6 @@ Foam::functionObjects::writeCellVolumes::writeCellVolumes } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::writeCellVolumes::~writeCellVolumes() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::writeCellVolumes::read(const dictionary& dict) @@ -97,7 +91,8 @@ bool Foam::functionObjects::writeCellVolumes::write() V.ref() = mesh_.V(); - Log << " Writing cell-volumes field " << V.name() + Log << type() << " " << name() << " write:" << nl + << " writing cell-volumes field " << V.name() << " to " << time_.timeName() << endl; V.write(); diff --git a/src/functionObjects/field/writeCellVolumes/writeCellVolumes.H b/src/functionObjects/field/writeCellVolumes/writeCellVolumes.H index dcbd14deff6e414fcd0d20672222a78c5cbce108..a3e999791540219161c8c2ea2a00eceb72d1003f 100644 --- a/src/functionObjects/field/writeCellVolumes/writeCellVolumes.H +++ b/src/functionObjects/field/writeCellVolumes/writeCellVolumes.H @@ -31,27 +31,49 @@ Group grpFieldFunctionObjects Description - Writes the cell-volumes volScalarField. + Writes the cell-volumes \c volScalarField. + + Operands: + \table + Operand | Type | Location + input | - | - + output file | - | - + output field | volScalarField | $FOAM_CASE/\<time\>/V + \endtable Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim writeCellVolumes { + // Mandatory entries (unmodifiable) type writeCellVolumes; libs (fieldFunctionObjects); + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: writeCellVolumes | yes | + Property | Description | Type | Req'd | Dflt + type | Type name: writeCellVolumes | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + postProcess -func writeCellVolumes + \endverbatim + See also - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::writeCellVolumes SourceFiles writeCellVolumes.C @@ -78,15 +100,6 @@ class writeCellVolumes : public fvMeshFunctionObject { - // Private member functions - - //- No copy construct - writeCellVolumes(const writeCellVolumes&) = delete; - - //- No copy assignment - void operator=(const writeCellVolumes&) = delete; - - public: //- Runtime type information @@ -103,9 +116,15 @@ public: const dictionary& dict ); + //- No copy construct + writeCellVolumes(const writeCellVolumes&) = delete; + + //- No copy assignment + void operator=(const writeCellVolumes&) = delete; + //- Destructor - virtual ~writeCellVolumes(); + virtual ~writeCellVolumes() = default; // Member Functions diff --git a/src/functionObjects/field/yPlus/yPlus.C b/src/functionObjects/field/yPlus/yPlus.C index 324a0fe969db01e3b2cef744bb81989f32ab53cd..8fc394738e729afe08a3e00706121e00f3a12b40 100644 --- a/src/functionObjects/field/yPlus/yPlus.C +++ b/src/functionObjects/field/yPlus/yPlus.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,13 +40,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(yPlus, 0); - - addToRunTimeSelectionTable - ( - functionObject, - yPlus, - dictionary - ); + addToRunTimeSelectionTable(functionObject, yPlus, dictionary); } } @@ -62,7 +56,7 @@ void Foam::functionObjects::yPlus::writeFileHeader(Ostream& os) const writeTabbed(os, "min"); writeTabbed(os, "max"); writeTabbed(os, "average"); - os << endl; + os << endl; } @@ -103,12 +97,6 @@ Foam::functionObjects::yPlus::yPlus } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::yPlus::~yPlus() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::functionObjects::yPlus::read(const dictionary& dict) diff --git a/src/functionObjects/field/yPlus/yPlus.H b/src/functionObjects/field/yPlus/yPlus.H index 65cedb3d739bd60d929fd5f4fb3b2a8569c9a4a8..6614ef33ff20097366a8b2e7bc5d8b95218de2e1 100644 --- a/src/functionObjects/field/yPlus/yPlus.H +++ b/src/functionObjects/field/yPlus/yPlus.H @@ -31,36 +31,51 @@ Group grpFieldFunctionObjects Description - Evaluates and outputs turbulence y+ for turbulence models. + Computes the near wall \f$y_1^+\f$ for turbulence models. - The field is stored on the mesh database so that it can be - retrieved and used for other applications. + Operands: + \table + Operand | Type | Location + input | - | - + output file | dat | $FOAM_CASE/postProcessing/\<FO\>/\<time\>/\<file\> + output field | volScalarField | $FOAM_CASE/\<time\>/\<outField\> + \endtable Usage - Example of function object specification to calculate the y+ (LES): + Minimal example by using \c system/controlDict.functions: \verbatim yPlus1 { + // Mandatory entries (unmodifiable) type yPlus; libs (fieldFunctionObjects); + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | Type name: yPlus | yes | - result | Name of y+ field | no | \<function name\> - log | Log to standard output | no | yes + Property | Description | Type | Req'd | Dflt + type | Type name: yPlus | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - \endtable + The inherited entries are elaborated in: + - \link functionObject.H \endlink + - \link writeFile.H \endlink + + Minimal example by using the \c postProcess utility: + \verbatim + <solver> -postProcess -func yPlus + \endverbatim See also - Foam::functionObject - Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::writeFile - Foam::functionObjects::timeControl + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - Foam::functionObjects::writeFile + - ExtendedCodeGuide::functionObjects::field::yPlus SourceFiles yPlus.C @@ -96,12 +111,6 @@ class yPlus //- File header information virtual void writeFileHeader(Ostream& os) const; - //- No copy construct - yPlus(const yPlus&) = delete; - - //- No copy assignment - void operator=(const yPlus&) = delete; - public: @@ -119,9 +128,15 @@ public: const dictionary& dict ); + //- No copy construct + yPlus(const yPlus&) = delete; + + //- No copy assignment + void operator=(const yPlus&) = delete; + //- Destructor - virtual ~yPlus(); + virtual ~yPlus() = default; // Member Functions diff --git a/src/functionObjects/field/zeroGradient/zeroGradient.C b/src/functionObjects/field/zeroGradient/zeroGradient.C index 21bc3d18a2af05503035d5b424418ce5b842b639..766f1283fe0a2e4742435f966ee5eb3ad2912c77 100644 --- a/src/functionObjects/field/zeroGradient/zeroGradient.C +++ b/src/functionObjects/field/zeroGradient/zeroGradient.C @@ -39,13 +39,7 @@ namespace Foam namespace functionObjects { defineTypeNameAndDebug(zeroGradient, 0); - - addToRunTimeSelectionTable - ( - functionObject, - zeroGradient, - dictionary - ); + addToRunTimeSelectionTable(functionObject, zeroGradient, dictionary); } } diff --git a/src/functionObjects/field/zeroGradient/zeroGradient.H b/src/functionObjects/field/zeroGradient/zeroGradient.H index fffb8a354fd4527250c2a31e5d9af59234b63ab4..236cb61b3bed54a803d11d3c05f95f5fe067829c 100644 --- a/src/functionObjects/field/zeroGradient/zeroGradient.H +++ b/src/functionObjects/field/zeroGradient/zeroGradient.H @@ -30,43 +30,70 @@ Group grpFieldFunctionObjects Description - This function object creates a volume field with zero-gradient + Creates a volume field with zero-gradient boundary conditions from another volume field. The result can be used, for example, to post-process near-wall field values. + Operands: + \table + Operand | Type | Location + input | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<inpField\> + output file | - | - + output field | vol\<Type\>Field | $FOAM_CASE/\<time\>/\<outField\> + \endtable + + where \c \<Type\>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor. + Usage - Example of function object specification: + Minimal example by using \c system/controlDict.functions: \verbatim - zeroGrad + zeroGradient1 { + // Mandatory entries (unmodifiable) type zeroGradient; libs (fieldFunctionObjects); - fields (U "(T|k|epsilon|omega)"); - result @@nearWall; + + // Mandatory entries (runtime modifiable) + fields (<field1> ... <fieldN>); \\(U "(T|k|epsilon|omega)"); + + // Optional entries (runtime modifiable) + result @@<name>; + + // Optional (inherited) entries ... } \endverbatim - Where the entries comprise: + where the entries mean: \table - Property | Description | Required | Default value - type | type name: zeroGradient | yes | - fields | Name of fields to process | yes | - result | Name of results | no | zeroGradient(@@) - log | Log to standard output | no | no + Property | Description | Type | Req'd | Dflt + type | Type name: zeroGradient | word | yes | - + libs | Library name: fieldFunctionObjects | word | yes | - + fields | Name of the operand fields | wordList | yes | - + result | Name of the output field | word | no | zeroGradient(@@) \endtable - A list of fields can contain exact names or regular expressions. + The inherited entries are elaborated in: + - \link functionObject.H \endlink + + Usage by the \c postProcess utility is not available. + +Note + - A list of fields can contain exact names or regular expressions. The token '\@\@' in the result name is replaced by the name of the source field. In the special case of a single source field (specified as a non-regex), the '\@\@' token checking is suppressed. - - The function object will skip over fields that would not benefit - - ie, only processor, empty, zeroGradient, symmetry patches. + - The function object will skip over fields that would not benefit + i.e., only processor, empty, zeroGradient, symmetry patches. This check should also prevent processing fields multiple times. +See also + - Foam::functionObject + - Foam::functionObjects::fvMeshFunctionObject + - ExtendedCodeGuide::functionObjects::field::zeroGradient + SourceFiles zeroGradient.C zeroGradientTemplates.C @@ -96,26 +123,26 @@ class zeroGradient : public fvMeshFunctionObject { - // Private data + // Private Data - //- Name of fields to process. + //- Name of fields to process wordRes selectFields_; - //- Formatting for the result fields. + //- Formatting for the result fields word resultName_; - //- Hashed names of result fields, and their type. + //- Hashed names of result fields, and their type HashTable<word> results_; // Private Member Functions - //- Check that string contains the appropriate substitution token(s). + //- Check that string contains the appropriate substitution token(s) static bool checkFormatName(const std::string& str); //- Accept unless field only has constraint patches - // (ie, empty/zero-gradient/processor). + // (ie, empty/zero-gradient/processor) // This should also avoid fields that were already processed by // zeroGradient. template<class Type> @@ -125,17 +152,10 @@ class zeroGradient template<class Type> int apply(const word& inputName, int& state); - //- Process by trying to apply for various volume field types. + //- Process by trying to apply for various volume field types int process(const word& inputName); - //- No copy construct - zeroGradient(const zeroGradient&) = delete; - - //- No copy assignment - void operator=(const zeroGradient&) = delete; - - public: //- Runtime type information @@ -152,6 +172,12 @@ public: const dictionary& dict ); + //- No copy construct + zeroGradient(const zeroGradient&) = delete; + + //- No copy assignment + void operator=(const zeroGradient&) = delete; + //- Destructor virtual ~zeroGradient() = default; diff --git a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/FOXiReactionRate b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/FOXiReactionRate new file mode 100644 index 0000000000000000000000000000000000000000..5a3c2d1a1533e8972184094cc801c153e183527d --- /dev/null +++ b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/FOXiReactionRate @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +XiReactionRate1 +{ + // Mandatory entries + type XiReactionRate; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/controlDict b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/controlDict index ebdf3f898d6795ce96c55293238c28a7056f8686..66418a7a629ea1998d29721b5901de174bee174a 100644 --- a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/controlDict +++ b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/controlDict @@ -50,4 +50,10 @@ adjustTimeStep yes; maxCo 0.2; +functions +{ + #include "FOXiReactionRate" +} + + // ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/controlDict b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/controlDict index bd63c907e7d2fe821b70fffd60d78e5915125225..e8e0dd59999946a818a45c6db138a30d1f7f320b 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/controlDict +++ b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/controlDict @@ -46,7 +46,7 @@ runTimeModifiable true; functions { - #includeFunc MachNo + #include "FOMachNo" #includeFunc solverInfo } diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/system/externalCoupled b/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/system/externalCoupled index 4146ab2908adc9af69988a4a881a0537e044203e..49a8551b0e2c3e710e892ce41e87651198191136 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/system/externalCoupled +++ b/tutorials/compressible/rhoPimpleFoam/RAS/externalCoupledSquareBendLiq/system/externalCoupled @@ -1,13 +1,17 @@ -// -*- C++ -*- +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ // Control for external coupled simulation externalCoupled { - type externalCoupled; - libs (fieldFunctionObjects); - log true; - - executeControl timeStep; + // Mandatory entries + type externalCoupled; + libs (fieldFunctionObjects); // Directory to use for communication commsDir "<case>/comms"; @@ -34,6 +38,24 @@ externalCoupled // Enabled or not? #sinclude "<case>/externalCoupled.control" + + // Optional entries + waitInterval 1; + // timeOut 100; + statusDone done; // Any arbitrary status=... value + calcFrequency 1; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + executeControl timeStep; + /*timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl timeStep; + writeInterval 1;*/ } diff --git a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/derivedFields b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/derivedFields index f9702554514e77ea5bf5596cf7919833103fd81f..14f0e53b047a6851a9435aac26f2f55ccf278474 100644 --- a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/derivedFields +++ b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/derivedFields @@ -1,19 +1,30 @@ -// -*- C++ -*- - -// ************************************************************************* // +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ // Create additional volume fields (for sampling) derivedFields { - type derivedFields; - libs (fieldFunctionObjects); - log true; + // Mandatory entries + type derivedFields; + libs (fieldFunctionObjects); + derived (rhoU pTotal); - writeControl none; + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 10000; executeControl timeStep; executeInterval 1; - - derived (rhoU pTotal); + writeControl none; + writeInterval -1; } + // ************************************************************************* // diff --git a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/fluxSummary b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/fluxSummary index 352fc229404f07cf7d6915ff7a63cb8d9652f769..2ca102dbf56a914a959825dfc35610fb8f40e26b 100644 --- a/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/fluxSummary +++ b/tutorials/compressible/rhoSimpleFoam/gasMixing/injectorPipe/system/fluxSummary @@ -1,28 +1,43 @@ -// -*- C++ -*- -// -// Summary of fluxes +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ flux { + // Mandatory entries type fluxSummary; libs (fieldFunctionObjects); - log on; - enabled true; - - executeControl none; - writeControl timeStep; - writeInterval 4; - mode functionObjectSurface; - - phi rhoU; - surfaces ( sampled.plane-0.25 sampled.plane-0.45 sampled.plane-0.55 ); + + // Optional entries + phi rhoU; + scaleFactor 1.0; + tolerance 0.8; + + // Optional (inherited) entries + writePrecision 10; + writeToFile true; + useUserTime false; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000000; + executeControl none; + executeInterval -1; + writeControl timeStep; + writeInterval 4; } diff --git a/tutorials/compressible/rhoSimpleFoam/squareBend/system/controlDict b/tutorials/compressible/rhoSimpleFoam/squareBend/system/controlDict index d995b036957df10cedc3e1eafa1c1ddb73ba08ea..6d6572480a04d2fbf91b135fabd0b884d4b26f89 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBend/system/controlDict +++ b/tutorials/compressible/rhoSimpleFoam/squareBend/system/controlDict @@ -47,13 +47,15 @@ graphFormat raw; runTimeModifiable true; + functions { #include "derivedFields" #include "sampling" // #include "samplingDebug" // #include "sampleCellCentres" - #include "isentropicTotalPressure" + #include "isentropicTotalPressure" + #include "wallHeatFlux" } diff --git a/tutorials/compressible/rhoSimpleFoam/squareBend/system/derivedFields b/tutorials/compressible/rhoSimpleFoam/squareBend/system/derivedFields index 5e0d3b203bbc71a2b545c58911b083543988cff9..e45c06077632033f650c667f05a055aca99bdd4a 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBend/system/derivedFields +++ b/tutorials/compressible/rhoSimpleFoam/squareBend/system/derivedFields @@ -1,21 +1,33 @@ -// -*- C++ -*- - -// ************************************************************************* // +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ // Create additional volume fields (for sampling) derivedFields { - type derivedFields; - libs (fieldFunctionObjects); - log true; + // Mandatory entries + type derivedFields; + libs (fieldFunctionObjects); + derived (rhoU pTotal); - writeControl none; + // Optional entries + rhoRef 1.25; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 10000; executeControl timeStep; executeInterval 1; - - derived (rhoU pTotal); - - rhoRef 1.25; + writeControl none; + writeInterval -1; } + // ************************************************************************* // diff --git a/tutorials/compressible/rhoSimpleFoam/squareBend/system/wallHeatFlux b/tutorials/compressible/rhoSimpleFoam/squareBend/system/wallHeatFlux new file mode 100644 index 0000000000000000000000000000000000000000..fb9af541024a579b71c5cb43c78fa0322458882f --- /dev/null +++ b/tutorials/compressible/rhoSimpleFoam/squareBend/system/wallHeatFlux @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +wallHeatFlux1 +{ + // Mandatory entries + type wallHeatFlux; + libs (fieldFunctionObjects); + + // Optional entries + patches (walls); + qr qr; + + // Optional (inherited) entries + writePrecision 10; + writeToFile true; + useUserTime true; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/system/externalCoupled b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/system/externalCoupled index 7d7c0a491a0e764f2dda7cd968d15325b49ff4a6..33c80e03969bc4a30c4d712c46ab4d346d92366c 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/system/externalCoupled +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledHeater/system/externalCoupled @@ -1,11 +1,17 @@ -// -*- C++ -*- +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ // Control for external coupled simulation externalCoupled { - type externalCoupled; - libs (fieldFunctionObjects); - log true; + // Mandatory entries + type externalCoupled; + libs (fieldFunctionObjects); // Directory to use for communication commsDir "<case>/comms"; @@ -30,6 +36,23 @@ externalCoupled } } } + + // Optional entries + waitInterval 1; + // timeOut 100; + statusDone done; // Any arbitrary status=... value + calcFrequency 1; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + /*timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl timeStep; + writeInterval 1;*/ } diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/externalCoupled b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/externalCoupled index 284b0b7de63905c18e25ca773f4c1bb5f25eecd5..1feb88ef088a40b6dfd160e522fadcaf9caed24e 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/externalCoupled +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/externalCoupledHeater/system/externalCoupled @@ -1,11 +1,17 @@ -// -*- C++ -*- +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ // Control for external coupled simulation externalCoupled { - type externalCoupled; - libs (fieldFunctionObjects); - log true; + // Mandatory entries + type externalCoupled; + libs (fieldFunctionObjects); // Directory to use for communication commsDir "<case>/comms"; @@ -13,9 +19,6 @@ externalCoupled // Does external process start first initByExternal true; - // Frequency of coupling - calcFrequency 4; - regions { // Region name (wildcards allowed) @@ -33,6 +36,23 @@ externalCoupled } } } + + // Optional entries + waitInterval 1; + // timeOut 100; + statusDone done; // Any arbitrary status=... value + calcFrequency 4; // Frequency of coupling + + // Optional (inherited) entries + region region0; + enabled true; + log true; + /*timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl timeStep; + writeInterval 1;*/ } diff --git a/tutorials/incompressible/icoFoam/cavityMappingTest/system/controlDict b/tutorials/incompressible/icoFoam/cavityMappingTest/system/controlDict index 5566513ca9129b4388e5d17e09044b6ad92867f3..d61a4bcd867c06daa661c4f167e03419f6aaaff1 100644 --- a/tutorials/incompressible/icoFoam/cavityMappingTest/system/controlDict +++ b/tutorials/incompressible/icoFoam/cavityMappingTest/system/controlDict @@ -17,19 +17,19 @@ FoamFile application icoFoam; -startFrom latestTime; +startFrom latestTime; startTime 0; -stopAt nextWrite; +stopAt nextWrite; endTime 0.5; deltaT 0.005; -writeControl timeStep; +writeControl timeStep; -writeInterval 1; +writeInterval 1; purgeWrite 0; @@ -45,20 +45,34 @@ timePrecision 6; runTimeModifiable true; + functions { meshInterp1 { + // Mandatory entries type mapFields; libs (fieldFunctionObjects); - writeControl timeStep; - writeInterval 1; - mapRegion coarseMesh; mapMethod cellVolumeWeight; consistent yes; - fields (U); // ("U.*" "p.*"); + + // Optional entries + // patchMapMethod directAMI; // AMI-related entry + // patchMap (<patchSrc> <patchTgt>); // if consistent=false + // cuttingPatches (<patchTgt1> ... <patchTgtN>); // if consisten=false + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl timeStep; + writeInterval 1; } } diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/system/postProcessingDict b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/system/postProcessingDict index 4e4c694311caf28a520302db00ad35acd783b91d..77bd98baae18fad89d67536c8d5cbf6e5d44facd 100644 --- a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/system/postProcessingDict +++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/system/postProcessingDict @@ -18,18 +18,23 @@ functions { processorField1 { - // Type of functionObject + // Mandatory entries type processorField; - - // Where to load it from (if not already in solver) libs (fieldFunctionObjects); - // Function object enabled flag + // Optional (inherited) entries + result procField; + region region0; enabled true; - - // When to output the average fields + log true; + timeStart 0; + timeEnd 5000; + executeControl timeStep; + executeInterval 1; writeControl writeTime; + writeInterval -1; } } + // ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/controlDict b/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/controlDict index 1e42b994f329d4a5354c147d2f7dcef4bf6f4a96..dbd8b71a9d434de6a20107f9c04e04af15c81572 100644 --- a/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/controlDict +++ b/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/controlDict @@ -69,9 +69,9 @@ functions libs (fieldFunctionObjects); writeControl writeTime; } - lambVector1 + LambVector1 { - type lambVector; + type LambVector; libs (fieldFunctionObjects); writeControl writeTime; field U; @@ -81,7 +81,7 @@ functions type div; libs (fieldFunctionObjects); writeControl writeTime; - field lambVector; + field LambVector; } fieldAverage1 { @@ -106,14 +106,14 @@ functions base time; } - lambVector + LambVector { mean on; prime2Mean off; base time; } - div(lambVector) + div(LambVector) { mean on; prime2Mean off; diff --git a/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/fvSchemes b/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/fvSchemes index badf581ac014030df38b5a15c62066167217b283..0720b9feb9f3a7d982422494623a36d889d2a95a 100644 --- a/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/fvSchemes +++ b/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/fvSchemes @@ -33,7 +33,7 @@ divSchemes div(phi,B) Gauss limitedLinear 0.1; div(B) Gauss linear; div(phi,nuTilda) Gauss limitedLinear 0.1; - div(lambVector) Gauss linear; + div(LambVector) Gauss linear; div((nuEff*dev2(T(grad(U))))) Gauss linear; } diff --git a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/controlDict b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/controlDict index be569948903701f5e35a6b8d0288260ea8a11628..3260683c2fd42e9763fb8cb25190c2716ced38f6 100644 --- a/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/controlDict +++ b/tutorials/incompressible/pimpleFoam/LES/periodicHill/transient/system/controlDict @@ -77,13 +77,9 @@ functions columnAverage { + // Mandatory entries type columnAverage; libs (fieldFunctionObjects); - - executeControl writeTime; - writeControl none; - timeStart 1500.5; // approx 2x flow-throughs - // Note: include processorCyclics! patches (front "proc.*throughfront"); fields @@ -93,6 +89,17 @@ functions UMean UPrime2Mean ); + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 1500.5; // approx 2x flow-throughs + // timeEnd inf; + executeControl writeTime; + // executeInterval -1; + writeControl none; + // writeInterval -1; } sample diff --git a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/system/controlDict b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/system/controlDict index 20739dbd3e9725030b0fafb39e4168e96eb95c73..8bc5912fb87e6087b97d659c931c4519cfb54b3e 100644 --- a/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/system/controlDict +++ b/tutorials/incompressible/pimpleFoam/LES/surfaceMountedCube/fullCase/system/controlDict @@ -56,10 +56,27 @@ functions } DESField { + // Mandatory entries type DESModelRegions; libs (fieldFunctionObjects); - //region "region0"; + + // Optional entries + result DESField; + + // Optional (inherited) entries + writePrecision 6; + writeToFile true; + useUserTime false; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; writeControl writeTime; + writeInterval -1; } Q1 { diff --git a/tutorials/incompressible/pimpleFoam/LES/vortexShed/Allrun b/tutorials/incompressible/pimpleFoam/LES/vortexShed/Allrun index 8acb73de70acd40a64e83203d21ada32adc27051..37a5417ec4fa299b2eac3be8f3da9c986e19ca73 100755 --- a/tutorials/incompressible/pimpleFoam/LES/vortexShed/Allrun +++ b/tutorials/incompressible/pimpleFoam/LES/vortexShed/Allrun @@ -21,5 +21,5 @@ then runParallel -s surface noise -dict system/noiseDict-surface fi - #------------------------------------------------------------------------------ + diff --git a/tutorials/incompressible/pimpleFoam/LES/vortexShed/system/controlDict b/tutorials/incompressible/pimpleFoam/LES/vortexShed/system/controlDict index 67b5c6b6cba715077d5acadd3ada9c3fd4bc6c8d..9a90a30b1e13cea50cf8d1197f3b8c20f716c454 100644 --- a/tutorials/incompressible/pimpleFoam/LES/vortexShed/system/controlDict +++ b/tutorials/incompressible/pimpleFoam/LES/vortexShed/system/controlDict @@ -45,6 +45,7 @@ timePrecision 6; runTimeModifiable true; + functions { minMax1 @@ -56,13 +57,24 @@ functions curle { - libs (fieldFunctionObjects); + // Mandatory entries type Curle; - writeControl writeTime; - timeStart 0.1; - + libs (fieldFunctionObjects); patches (cylinder); c0 343; + + // Optional (inherited) entries + field p; + result Curle; + region region0; + enabled true; + log true; + timeStart 0.1; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; } cuttingPlane diff --git a/tutorials/incompressible/pimpleFoam/RAS/propeller/system/AMIWeights b/tutorials/incompressible/pimpleFoam/RAS/propeller/system/AMIWeights index 58eaf268a6604b74258d00372b380a016ab782f6..b2ac75dc28a9536757c0e73d8b3171a0111b0102 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/propeller/system/AMIWeights +++ b/tutorials/incompressible/pimpleFoam/RAS/propeller/system/AMIWeights @@ -6,13 +6,28 @@ | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ -AMIWeights +AMIWeights1 { - type AMIWeights; - libs (fieldFunctionObjects); - writeControl writeTime; - writeFields no; - // writeFields yes; + // Mandatory entries + type AMIWeights; + libs (fieldFunctionObjects); + writeFields true; + + // Optional (inherited) entries + writePrecision 10; + writeToFile true; + useUserTime false; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; } + // ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/stabilizationSchemes b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/stabilizationSchemes index b349d7881c583070ce4a97c3187d5b320ead5e9a..94794c1c362b566352e7000091692291074f2769 100644 --- a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/stabilizationSchemes +++ b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/stabilizationSchemes @@ -11,48 +11,69 @@ residuals type solverInfo; libs (utilityFunctionObjects); writeResidualFields true; - writeControl outputTime; + writeControl writeTime; fields (p); } blendingFactor { + // Mandatory entries type stabilityBlendingFactor; libs (fieldFunctionObjects); - log true; - writeToFile false; + field U; + result UBlendingFactor; - switchNonOrtho yes; - switchGradCc no; - switchResiduals yes; - switchSkewness no; - switchFaceWeight no; - switchCo no; + // Optional entries + tolerance 0.001; + // Any of the options can be chosen in combinations + // Option-1 + switchNonOrtho yes; maxNonOrthogonality 20; minNonOrthogonality 60; + // Option-2 + switchGradCc no; maxGradCc 3; minGradCc 4; + // Option-3 + switchResiduals yes; maxResidual 100; - P 5; I 0.01; D 0.5; + // Option-4 + switchFaceWeight no; minFaceWeight 0.3; maxFaceWeight 0.2; - Co1 1; - Co2 2; - + // Option-5 + switchSkewness no; maxSkewness 2; minSkewness 3; + // Option-6 + switchCo no; + Co1 1; + Co2 2; + + // Optional (inherited) entries + writePrecision 10; + writeToFile false; + useUserTime true; - field U; - result UBlendingFactor; + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; } + // ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/0/U b/tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/U similarity index 100% rename from tutorials/incompressible/pisoFoam/RAS/cavity/0/U rename to tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/U diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/0/epsilon b/tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/epsilon similarity index 100% rename from tutorials/incompressible/pisoFoam/RAS/cavity/0/epsilon rename to tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/epsilon diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/0/k b/tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/k similarity index 100% rename from tutorials/incompressible/pisoFoam/RAS/cavity/0/k rename to tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/k diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/0/nuTilda b/tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/nuTilda similarity index 100% rename from tutorials/incompressible/pisoFoam/RAS/cavity/0/nuTilda rename to tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/nuTilda diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/0/nut b/tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/nut similarity index 100% rename from tutorials/incompressible/pisoFoam/RAS/cavity/0/nut rename to tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/nut diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/0/omega b/tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/omega similarity index 100% rename from tutorials/incompressible/pisoFoam/RAS/cavity/0/omega rename to tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/omega diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/0/p b/tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/p similarity index 100% rename from tutorials/incompressible/pisoFoam/RAS/cavity/0/p rename to tutorials/incompressible/pisoFoam/RAS/cavity/0.orig/p diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/Allclean b/tutorials/incompressible/pisoFoam/RAS/cavity/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..fb1f3847301c377e02e12439ba58cbf303af3ef9 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/Allclean @@ -0,0 +1,8 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase0 + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/Allrun b/tutorials/incompressible/pisoFoam/RAS/cavity/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..457cd661e45ad27844dfe14d76afbf2acd8e9c67 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/Allrun @@ -0,0 +1,12 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +runApplication blockMesh + +restore0Dir + +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOCourantNo b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOCourantNo new file mode 100644 index 0000000000000000000000000000000000000000..84bb600199b504334af77047d747b7675e0e31af --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOCourantNo @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +CourantNo1 +{ + // Mandatory entries + type CourantNo; + libs (fieldFunctionObjects); + + // Optional entries + rho rho; + + // Optional (inherited) entries + field phi; + result CourantNumberField; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOLambVector b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOLambVector new file mode 100644 index 0000000000000000000000000000000000000000..4c2c208399dd460f8fa75a564a75863e7b392772 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOLambVector @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +LambVector1 +{ + // Mandatory entries + type LambVector; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + field U; + result LambVectorField; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOLambda2 b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOLambda2 new file mode 100644 index 0000000000000000000000000000000000000000..47c7aea56b972924aee10dff4708393f5706a2ec --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOLambda2 @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +Lambda21 +{ + // Mandatory entries + type Lambda2; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + field U; + result Lambda2Field; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOPecletNo b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOPecletNo new file mode 100644 index 0000000000000000000000000000000000000000..61dacfe50699793ea763250809d348b20707e3e9 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOPecletNo @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +PecletNo1 +{ + // Mandatory entries + type PecletNo; + libs (fieldFunctionObjects); + + // Optional entries + rho rho; + + // Optional (inherited) entries + field phi; + result PecletNoField; + region region0; + enabled true; + log true; + timeStart 0.1; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOQ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOQ new file mode 100644 index 0000000000000000000000000000000000000000..c1a94b96828ec5e16aa408e065d2b7abaf77e165 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOQ @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +Q1 +{ + // Mandatory entries + type Q; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + field U; + result QField; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOadd b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOadd new file mode 100644 index 0000000000000000000000000000000000000000..53ab4255d7e5f0bc47fd474ca2878dc5a5d960ba --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOadd @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +add1 +{ + // Mandatory entries + type add; + libs (fieldFunctionObjects); + fields (k k_0); + + // Optional (inherited) entries + result kTotal; + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 10; + executeControl timeStep; + executeInterval 1; + writeControl runTime; + writeInterval 1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOblendingFactor b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOblendingFactor new file mode 100644 index 0000000000000000000000000000000000000000..993527c09c1c32b0eeab99a07f782187a441a625 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOblendingFactor @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +blendingFactor1 +{ + // Mandatory entries + type blendingFactor; + libs (fieldFunctionObjects); + field U; + + // Optional entries + phi phi; + tolerance 0.001; + + // Optional (inherited) entries + result blendingFactorField; + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 2; + writeControl timeStep; + writeInterval 50; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOcomponents b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOcomponents new file mode 100644 index 0000000000000000000000000000000000000000..6df0242f82fae8e19cead4d10636fd19e395c18b --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOcomponents @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +components1 +{ + // Mandatory entries + type components; + libs (fieldFunctionObjects); + field U; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOcontinuityError b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOcontinuityError new file mode 100644 index 0000000000000000000000000000000000000000..7c16ff2de78dc82112d76d808ad0ad203e908742 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOcontinuityError @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +continuityError1 +{ + // Mandatory entries + type continuityError; + libs (fieldFunctionObjects); + + // Optional entries + phi phi; + + // Optional (inherited) entries + writePrecision 10; + writeToFile true; + useUserTime true; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOddt b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOddt new file mode 100644 index 0000000000000000000000000000000000000000..5080cc8240d3369839f76ca5c746ba42f6a5f5fa --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOddt @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +ddt1 +{ + // Mandatory entries + type ddt; + libs (fieldFunctionObjects); + field U; + + // Optional (inherited) entries + result ddtU; + region region0; + enabled true; + log true; + timeStart 0.1; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOddt2 b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOddt2 new file mode 100644 index 0000000000000000000000000000000000000000..e509f4fd6c48d83c6dba8b7f2281ce423be4344d --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOddt2 @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +ddt21 +{ + // Mandatory entries + type ddt2; + libs (fieldFunctionObjects); + fields (U p); + + // Optional entries + mag false; + result d@@dt2; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 10; + executeControl timeStep; + executeInterval 1; + writeControl runTime; + writeInterval 1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOdiv b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOdiv new file mode 100644 index 0000000000000000000000000000000000000000..44375fbb7fdc27e2513ca741b086b6ef485f1c10 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOdiv @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +div1 +{ + // Mandatory entries + type div; + libs (fieldFunctionObjects); + field U; + + // Optional (inherited) entries + result divU; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +div2 +{ + // Mandatory entries + type div; + libs (fieldFunctionObjects); + field phi; + + // Optional (inherited) entries + result divPhi; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 10; + writeControl timeStep; + writeInterval 50; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOenstrophy b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOenstrophy new file mode 100644 index 0000000000000000000000000000000000000000..934ccba4618c49d2ef88cf8d3a5222acda3bbcf2 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOenstrophy @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +enstrophy1 +{ + // Mandatory entries + type enstrophy; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + field U; + result enstrophyField; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOfieldAverage b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOfieldAverage new file mode 100644 index 0000000000000000000000000000000000000000..b874c2256cdb407639fa31fb41d31ad98b2ace6c --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOfieldAverage @@ -0,0 +1,61 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +fieldAverage1 +{ + // Mandatory entries + type fieldAverage; + libs (fieldFunctionObjects); + fields + ( + U + { + mean on; + prime2Mean on; + base time; + /* + windowType exact; + window 10.0; + windowName w1U; + allowRestart true; + */ + } + + /* + p + { + mean on; + prime2Mean on; + base iteration; + windowType approximate; + window 1000; + windowName w1p; + } + */ + ); + + // Optional entries + restartOnRestart false; + restartOnOutput false; + periodicRestart false; + // restartPeriod 0.002; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOflowType b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOflowType new file mode 100644 index 0000000000000000000000000000000000000000..34b6597b8c883510ce7844b506124b104034bef6 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOflowType @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +flowType1 +{ + // Mandatory entries + type flowType; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + field U; + result flowTypeField; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOflux b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOflux new file mode 100644 index 0000000000000000000000000000000000000000..c37847e685a7f165f63adc094582ddd837011115 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOflux @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +flux1 +{ + // Mandatory entries + type flux; + libs (fieldFunctionObjects); + + // Optional entries + rho none; + + // Optional (inherited) entries + field U; + result fluxField; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOgrad b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOgrad new file mode 100644 index 0000000000000000000000000000000000000000..e25b13372da4b82c4c8f0981d557f37a36ca26f8 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOgrad @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +grad1 +{ + // Mandatory entries + type grad; + libs (fieldFunctionObjects); + field U; + + // Optional (inherited) entries + result gradU; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +grad2 +{ + // Mandatory entries + type grad; + libs (fieldFunctionObjects); + field phi; + + // Optional (inherited) entries + result gradPhi; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 10; + writeControl timeStep; + writeInterval 50; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOhistogram b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOhistogram new file mode 100644 index 0000000000000000000000000000000000000000..ca9e6f321d705b00419be2c31a84fa00458f1e08 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOhistogram @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +histogram1 +{ + // Mandatory entries + type histogram; + libs (fieldFunctionObjects); + field p; + nBins 100; + setFormat raw; + + // Optional entries + max 10; + min -10; + + // Optional (inherited) entries + writePrecision 16; + writeToFile true; + useUserTime true; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOlimitFields b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOlimitFields new file mode 100644 index 0000000000000000000000000000000000000000..9d2159c98617219904dc4e4f1ccae19440f7f34f --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOlimitFields @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +limitFields1 +{ + // Mandatory entries + type limitFields; + libs (fieldFunctionObjects); + fields (U p); + limit both; + min 0; + max 5; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOmag b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOmag new file mode 100644 index 0000000000000000000000000000000000000000..f0f2f91e34f1668374d1e859d2598b765caae162 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOmag @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +mag1 +{ + // Mandatory entries + type mag; + libs (fieldFunctionObjects); + field U; + + // Optional (inherited) entries + result magU; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +mag2 +{ + // Mandatory entries + type mag; + libs (fieldFunctionObjects); + field p; + + // Optional (inherited) entries + result magP; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 10; + writeControl timeStep; + writeInterval 50; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOmagSqr b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOmagSqr new file mode 100644 index 0000000000000000000000000000000000000000..f342be3f4c38885eea1a9101a030f0153b38b2b7 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOmagSqr @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +magSqr1 +{ + // Mandatory entries + type magSqr; + libs (fieldFunctionObjects); + field U; + + // Optional (inherited) entries + result magSqrU; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +magSqr2 +{ + // Mandatory entries + type magSqr; + libs (fieldFunctionObjects); + field p; + + // Optional (inherited) entries + result magSqrP; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 10; + writeControl timeStep; + writeInterval 50; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOmomentum b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOmomentum new file mode 100644 index 0000000000000000000000000000000000000000..14891606178da6b3e6487008a90c80273d5c03a8 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOmomentum @@ -0,0 +1,43 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +momentum1 +{ + // Mandatory entries + type momentum; + libs (fieldFunctionObjects); + + // Optional entries + regionType all; + writeMomentum yes; + writePosition yes; + writeVelocity yes; + p p; + U U; + rho rho; + rhoRef 1.0; + cylindrical false; + + // Optional (inherited) entries + writePrecision 10; + writeToFile true; + useUserTime true; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOnearWallFields b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOnearWallFields new file mode 100644 index 0000000000000000000000000000000000000000..e47e148d94b981fb3e5491f88d8bd9f927f1fc8e --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOnearWallFields @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +nearWallFields1 +{ + // Mandatory entries + type nearWallFields; + libs (fieldFunctionObjects); + fields + ( + (U UNear) + (p pNear) + ); + patches (fixedWalls); + distance 0.001; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOpressure b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOpressure new file mode 100644 index 0000000000000000000000000000000000000000..2b09f1ea584536ff86c4e893a81e84186bb5c577 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOpressure @@ -0,0 +1,121 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +pressure1 +{ + // Mandatory entries + type pressure; + libs (fieldFunctionObjects); + mode static; + + // Optional entries + U U; + rho rhoInf; + rhoInf 1.0; + pRef 1.0; + + // Optional (inherited) entries + result staticP; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +pressure2 +{ + // Mandatory entries + type pressure; + libs (fieldFunctionObjects); + mode total; + + // Optional entries + U U; + rho rhoInf; + rhoInf 1.0; + pRef 1.0; + + // Optional (inherited) entries + result totalP; + region region0; + enabled true; + log true; + timeStart 1; + timeEnd 1000; + executeControl timeStep; + executeInterval 10; + writeControl timeStep; + writeInterval 50; +} + + +pressure3 +{ + // Mandatory entries + type pressure; + libs (fieldFunctionObjects); + mode staticCoeff; + + // Optional entries + U U; + rho rhoInf; + rhoInf 1.0; + pRef 1.0; + pInf 1.0; + UInf (1 0 0); + + // Optional (inherited) entries + result staticCoeffP; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 15; + writeControl timeStep; + writeInterval 75; +} + + +pressure4 +{ + // Mandatory entries + type pressure; + libs (fieldFunctionObjects); + mode totalCoeff; + + // Optional entries + U U; + rho rhoInf; + rhoInf 1.0; + pRef 1.0; + pInf 1.0; + UInf (1.0 0.0 0.0); + + // Optional (inherited) entries + result totalCoeffP; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 25; + writeControl timeStep; + writeInterval 100; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOprocessorField b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOprocessorField new file mode 100644 index 0000000000000000000000000000000000000000..2b109ba2b10f67f1529f7a6f75bb8a9f6e6a0229 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOprocessorField @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +processorField1 +{ + // Mandatory entries + type processorField; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 5000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOproudmanAcousticPower b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOproudmanAcousticPower new file mode 100644 index 0000000000000000000000000000000000000000..ebc9d2bd61581e5eff77823a9aff51e247da31b5 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOproudmanAcousticPower @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +proudmanAcousticPower1 +{ + // Mandatory entries + type proudmanAcousticPower; + libs (fieldFunctionObjects); + + // Optional entries + alphaEps 0.1; + aRef 340; + rhoInf 1.0; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 5000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOrandomise b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOrandomise new file mode 100644 index 0000000000000000000000000000000000000000..ed1a36e487f30cb41b24be348398aa828fa6d03d --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOrandomise @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +randomise1 +{ + // Mandatory entries + type randomise; + libs (fieldFunctionObjects); + magPerturbation 0.1; + field U; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOreadFields b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOreadFields new file mode 100644 index 0000000000000000000000000000000000000000..e532b745dd34106b38bc06702ff1532e06fe0259 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOreadFields @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +readFields1 +{ + // Mandatory entries + type readFields; + libs (fieldFunctionObjects); + fields (U p); + + // Optional entries + readOnStart true; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOreference b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOreference new file mode 100644 index 0000000000000000000000000000000000000000..972fceba7b31fa17fa280d82fdec66130e7b0241 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOreference @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +reference1 +{ + // Mandatory entries + type reference; + libs (fieldFunctionObjects); + field U; + + // Optional entries + scale 1.0; + offset (0.0 0.0 0.0); + position (0 0 0); + interpolationScheme cell; + + // Optional (inherited) entries + result diffU; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +reference2 +{ + // Mandatory entries + type reference; + libs (fieldFunctionObjects); + field p; + + // Optional entries + scale -2.0; + offset 1.5; + position (0 0 0); + interpolationScheme cellPoint; + + // Optional (inherited) entries + result diffP; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsetFlow b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsetFlow new file mode 100644 index 0000000000000000000000000000000000000000..5d2175cb72495b804e86d4b29a03a04c5ff883c1 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsetFlow @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +setFlow1 +{ + // Mandatory entries + type setFlow; + libs (fieldFunctionObjects); + mode function; + scale 1; + reverseTime 1; + velocity (1 0 0); + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 500; + writeControl timeStep; + writeInterval 500; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOstreamFunction b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOstreamFunction new file mode 100644 index 0000000000000000000000000000000000000000..a4081be01cc57e4fbbf931cec851abee161c9364 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOstreamFunction @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +streamFunction1 +{ + // Mandatory entries + type streamFunction; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + field phi; + result streamFunc; + region region0; + enabled true; + log true; + timeStart 0.1; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOstreamLine b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOstreamLine new file mode 100644 index 0000000000000000000000000000000000000000..7b8b6b4125bdea433eb11c1b6c2562e67733a838 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOstreamLine @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +streamLine1 +{ + // Mandatory entries + type streamLine; + libs (fieldFunctionObjects); + U U; + fields (U p k); + setFormat vtk; + direction forward; + lifeTime 10; + cloud particleTracks; + seedSampleSet + { + type uniform; + axis x; + start (0.0 0.05 0.005); + end (0.1 0.05 0.005); + nPoints 20; + } + + // Optional entries + // bounds (0.2 -10 -10)(0.22 10 10); + // trackLength 1e-3; + nSubCycle 1; + interpolationScheme cellPoint; + + // Deprecated + // trackForward true; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsubtract b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsubtract new file mode 100644 index 0000000000000000000000000000000000000000..ab35c1d51bc1c012f3e7611abbff781a0f0168f8 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsubtract @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +subtract1 +{ + // Mandatory entries + type subtract; + libs (fieldFunctionObjects); + fields (k k_0); + + // Optional (inherited) entries + result kDiff; + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 10; + executeControl timeStep; + executeInterval 1; + writeControl runTime; + writeInterval 1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsurfaceDistance b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsurfaceDistance new file mode 100644 index 0000000000000000000000000000000000000000..1551952815ff0e80132fb8d3c83f2495529a9b71 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsurfaceDistance @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +surfaceDistance1 +{ + // Mandatory entries + type surfaceDistance; + libs (fieldFunctionObjects); + geometry + { + pending.obj + { + type triSurfaceMesh; + name pending; + } + } + + // Optional entries + calculateCells true; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl writeTime; + executeInterval -1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsurfaceInterpolate b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsurfaceInterpolate new file mode 100644 index 0000000000000000000000000000000000000000..390581a039500e4216ea2f9b25467a38f2098bb0 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOsurfaceInterpolate @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +surfaceInterpolate1 +{ + // Mandatory entries + type surfaceInterpolate; + libs (fieldFunctionObjects); + fields ((U surfaceU) (p surfaceP) (k surfaceK) (divU surfaceDivU)); + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl writeTime; + executeInterval -1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOturbulenceFields b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOturbulenceFields new file mode 100644 index 0000000000000000000000000000000000000000..cd81b187cf05f9a19a9985c9c839c85cb2798f4f --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOturbulenceFields @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +turbulenceFields1 +{ + // Mandatory entries + type turbulenceFields; + libs (fieldFunctionObjects); + fields (k epsilon omega nuTilda nut nuEff R devReff L); + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl writeTime; + executeInterval -1; + writeControl writeTime; + writeInterval -1; +} + + +turbulenceFields2 +{ + // Mandatory entries + type turbulenceFields; + libs (fieldFunctionObjects); + field I; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl writeTime; + executeInterval -1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOvalueAverage b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOvalueAverage new file mode 100644 index 0000000000000000000000000000000000000000..252cc44b867f1ac0db3be391f5ae3a1ed40b94b9 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOvalueAverage @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +valueAverage1 +{ + // Mandatory entries + type valueAverage; + libs (fieldFunctionObjects); + functionObject momentum1; + fields (momentum_x momentum_y momentum_z); + + // Optional entries + resetOnRestart false; + window 1; + + // Optional (inherited) entries + writePrecision 10; + writeToFile true; + useUserTime true; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOvorticity b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOvorticity new file mode 100644 index 0000000000000000000000000000000000000000..51ab43da759d189cdc0f856a032d8a222b187885 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOvorticity @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +vorticity1 +{ + // Mandatory entries + type vorticity; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + field U; + result vorticityField; + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOwallShearStress b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOwallShearStress new file mode 100644 index 0000000000000000000000000000000000000000..e0d232f44c66c140eba87dbf7b012062a33bf867 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOwallShearStress @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +wallShearStress1 +{ + // Mandatory entries + type wallShearStress; + libs (fieldFunctionObjects); + + // Optional entries + patches (fixedWalls); + + // Optional (inherited) entries + writePrecision 10; + writeToFile true; + useUserTime true; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOwriteCellCentres b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOwriteCellCentres new file mode 100644 index 0000000000000000000000000000000000000000..a66f57ec5a4f5973ff1d621022a80e60e1e5707f --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOwriteCellCentres @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +writeCellCentres1 +{ + // Mandatory entries + type writeCellCentres; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl writeTime; + executeInterval -1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOwriteCellVolumes b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOwriteCellVolumes new file mode 100644 index 0000000000000000000000000000000000000000..434b4d6ae1b7c4a2f8bdc4d3e226fe97b42b1927 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOwriteCellVolumes @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +writeCellVolumes1 +{ + // Mandatory entries + type writeCellVolumes; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl writeTime; + executeInterval -1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOyPlus b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOyPlus new file mode 100644 index 0000000000000000000000000000000000000000..866f25ddd5e0bbb511b2eef1d5d26304acec83eb --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOyPlus @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +yPlus1 +{ + // Mandatory entries + type yPlus; + libs (fieldFunctionObjects); + + // Optional (inherited) entries + writePrecision 10; + writeToFile true; + useUserTime true; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOzeroGradient b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOzeroGradient new file mode 100644 index 0000000000000000000000000000000000000000..2a3d70f9759c401c8488bfd9229f033361a56220 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/FOzeroGradient @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +zeroGradient1 +{ + // Mandatory entries + type zeroGradient; + libs (fieldFunctionObjects); + fields (U "(epsilon|omega)" p); + + // Optional entries + result @@zeroGrad; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +zeroGradient2 +{ + // Mandatory entries + type zeroGradient; + libs (fieldFunctionObjects); + fields (U "(epsilon|omega)" p); + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0.25; + timeEnd 1000; + executeControl timeStep; + executeInterval 5; + writeControl timeStep; + writeInterval 25; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/controlDict b/tutorials/incompressible/pisoFoam/RAS/cavity/system/controlDict index b82b255acdfb396a7df0f0e515990bc095ded701..2bd75b7277d3d28fa367d1d824781c9488c90ee4 100644 --- a/tutorials/incompressible/pisoFoam/RAS/cavity/system/controlDict +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/controlDict @@ -46,4 +46,52 @@ timePrecision 6; runTimeModifiable true; +functions +{ + #include "FOfieldAverage" + #include "FOadd" + #include "FOblendingFactor" + #include "FOcomponents" + #include "FOCourantNo" + #include "FOcontinuityError" + #include "FOddt" + #include "FOddt2" + #include "FOdiv" + #include "FOenstrophy" + #include "FOflowType" + #include "FOflux" + #include "FOgrad" + #include "FOhistogram" + #include "FOLambda2" + #include "FOLambVector" + #include "FOlimitFields" + #include "FOmag" + #include "FOmagSqr" + #include "FOmomentum" + #include "FOnearWallFields" + #include "FOPecletNo" + #include "FOpressure" + #include "FOprocessorField" + #include "FOproudmanAcousticPower" + #include "FOQ" + #include "FOrandomise" + #include "FOreadFields" + #include "FOsetFlow" + #include "FOstreamFunction" + #include "FOstreamLine" + #include "FOsubtract" + //#include "FOsurfaceDistance" + #include "FOsurfaceInterpolate" + #include "FOturbulenceFields" + #include "FOvalueAverage" + #include "FOvorticity" + #include "FOreference" + #include "FOwallShearStress" + #include "FOwriteCellCentres" + #include "FOwriteCellVolumes" + #include "FOyPlus" + #include "FOzeroGradient" +} + + // ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/fvSchemes b/tutorials/incompressible/pisoFoam/RAS/cavity/system/fvSchemes index e7c3727b4ffec25f53829c746e650b55f61951d2..a2e0ad2aa1bad4692340e5187eed6117eac00c64 100644 --- a/tutorials/incompressible/pisoFoam/RAS/cavity/system/fvSchemes +++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/fvSchemes @@ -28,12 +28,17 @@ gradSchemes divSchemes { default none; - div(phi,U) Gauss limitedLinearV 1; + div(phi,U) Gauss CoBlended + 0.01 // Co below which scheme1 is used + limitedLinearV 1 // scheme1 + 0.05 // Co above which scheme2 is used + linearUpwind grad(U); // scheme2 div(phi,k) Gauss limitedLinear 1; div(phi,epsilon) Gauss limitedLinear 1; div(phi,omega) Gauss limitedLinear 1; div(phi,R) Gauss limitedLinear 1; div(R) Gauss linear; + div(U) Gauss linear; // enables div function object div(phi,nuTilda) Gauss limitedLinear 1; div((nuEff*dev2(T(grad(U))))) Gauss linear; } diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/wallBoundedStreamLines b/tutorials/incompressible/simpleFoam/motorBike/system/wallBoundedStreamLines index 668e3718aff54ba3a9ec063081e8e1e1563535df..796b0a767a6d4f95829df9342b0e996baa51cd6a 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/wallBoundedStreamLines +++ b/tutorials/incompressible/simpleFoam/motorBike/system/wallBoundedStreamLines @@ -35,39 +35,19 @@ near distance 0.001; } + // Use UNear to track along wall wallBoundedStreamLines { - // Where to load it from (if not already in solver) - libs (fieldFunctionObjects); + // Mandatory entries type wallBoundedStreamLine; - - // Output every - writeControl writeTime; - - setFormat vtk; //gnuplot; //xmgr; //raw; //jplot; - - // Velocity field to use for tracking. - U UNear; - - // Interpolation method. Default is cellPoint. - // interpolationScheme pointMVC; - - // Tracked forwards (+U) or backwards (-U) - trackForward true; - - interpolationScheme cellPoint; - - // Names of fields to sample. Should contain above velocity field! - fields (p U k UNear); - - // Steps particles can travel before being removed - lifeTime 100; - - // Cloud name to use + libs (fieldFunctionObjects); + U UNear; // Velocity field to use for tracking. + fields (p U k UNear); // Names of fields to sample. + setFormat vtk; //gnuplot; //xmgr; //raw; //jplot; + direction forward; + lifeTime 100; // Steps particles can travel before being removed cloud wallBoundedParticleTracks; - - // Seeding method. seedSampleSet { type patchSeed; @@ -75,7 +55,6 @@ wallBoundedStreamLines uniformCoeffs { axis x; //distance; - start (0.0035 0.0999 0.0001); end (0.0035 0.0999 0.0099); nPoints 20; @@ -94,6 +73,26 @@ wallBoundedStreamLines maxPoints 20000; } } + + // Optional entries + // bounds (0.2 -10 -10)(0.22 10 10); + // trackLength 1e-3; + // nSubCycle 1; + interpolationScheme cellPoint; + + // Deprecated + // trackForward true; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; } diff --git a/tutorials/incompressible/simpleFoam/squareBend/system/derivedFields b/tutorials/incompressible/simpleFoam/squareBend/system/derivedFields index 5e0d3b203bbc71a2b545c58911b083543988cff9..e45c06077632033f650c667f05a055aca99bdd4a 100644 --- a/tutorials/incompressible/simpleFoam/squareBend/system/derivedFields +++ b/tutorials/incompressible/simpleFoam/squareBend/system/derivedFields @@ -1,21 +1,33 @@ -// -*- C++ -*- - -// ************************************************************************* // +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ // Create additional volume fields (for sampling) derivedFields { - type derivedFields; - libs (fieldFunctionObjects); - log true; + // Mandatory entries + type derivedFields; + libs (fieldFunctionObjects); + derived (rhoU pTotal); - writeControl none; + // Optional entries + rhoRef 1.25; + + // Optional (inherited) entries + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 10000; executeControl timeStep; executeInterval 1; - - derived (rhoU pTotal); - - rhoRef 1.25; + writeControl none; + writeInterval -1; } + // ************************************************************************* // diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict b/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict index 3ef13718f7a0b58c09e61bf6feaca95543ee40fa..7ed4f0d849bc4723c30fe00454cd19a475d2413d 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/system/controlDict @@ -49,13 +49,14 @@ maxCo 0.1; runTimeModifiable yes; + functions { - distribtion1 + distribution1 { + // Mandatory entries type particleDistribution; libs (fieldFunctionObjects); - writeControl writeTime; cloud sprayCloud; nameVsBinWidth ( @@ -63,6 +64,24 @@ functions (U 10) ); setFormat raw; + + // Optional entries + tagField none; + + // Optional (inherited) entries + writePrecision 10; + writeToFile true; + useUserTime true; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; } } diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/controlDict b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/controlDict index d46a0c9dadedb7fc18c71237b829664a9e95f89b..d36cbdc1f60d5e7f6b3aa3b5a3eaec2ad67dcf1b 100644 --- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/controlDict +++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/controlDict @@ -53,16 +53,40 @@ maxAlphaCo 1; maxDeltaT 1; + functions { extractEulerianParticles1 { + // Mandatory entries type extractEulerianParticles; libs (fieldFunctionObjects); - writeControl writeTime; faceZone collector; alpha alpha.water; + + // Optional entries + alphaThreshold 0.1; nLocations 20; + U U; + rho rho; + phi phi; + //minDiameter 1e-30; + //maxDiameter 1e30; + + // Optional (inherited) entries + writePrecision 6; + writeToFile true; + useUserTime false; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; } } diff --git a/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/system/controlDict b/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/system/controlDict index 5e82c78905bd8cc586a9888bd6a7b88132125ae2..74074c07a979b5e65419e28a4f55d2310f8865d9 100644 --- a/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/system/controlDict +++ b/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/system/controlDict @@ -74,4 +74,5 @@ functions } } + // ************************************************************************* // diff --git a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/controlDict b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/controlDict index ff3acb8ec9dd030d7e4639a022b420d272a4fb71..84b498f4d7549053651cf50eb1f5610dd1a537a9 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/controlDict +++ b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/controlDict @@ -90,6 +90,39 @@ functions } ); } + + regionSizeDistribution1 + { + // Mandatory entries + type regionSizeDistribution; + libs (fieldFunctionObjects); + field alpha.air; + patches (inlet); + fields (p U); + threshold 0.5; + maxDiameter 0.5; + nBins 100; + setFormat gnuplot; + + // Optional entries + minDiameter 0.0; + isoPlanes false; + + // Optional (inherited) entries + writePrecision 12; + writeToFile true; + useUserTime true; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; + writeControl writeTime; + writeInterval -1; + } } diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/controlDict b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/controlDict index ff3acb8ec9dd030d7e4639a022b420d272a4fb71..83e37384513857b2cd9bc7c0c5bd97377965805a 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/controlDict +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/controlDict @@ -54,6 +54,15 @@ maxDeltaT 1; functions { + add1 + { + type add; + libs (fieldFunctionObjects); + fields (U.air U.water); + result U.total; + writeControl writeTime; + } + fieldAverage1 { type fieldAverage; diff --git a/tutorials/verificationAndValidation/icoReactingMultiphaseInterFoam/stefanProblem/system/controlDict b/tutorials/verificationAndValidation/icoReactingMultiphaseInterFoam/stefanProblem/system/controlDict index e07bf4712f024f993e45ce237858c504c6b6901e..a00e81250e222728899ad7b823b43ecba6bacec6 100644 --- a/tutorials/verificationAndValidation/icoReactingMultiphaseInterFoam/stefanProblem/system/controlDict +++ b/tutorials/verificationAndValidation/icoReactingMultiphaseInterFoam/stefanProblem/system/controlDict @@ -51,18 +51,38 @@ maxCo 0.01; maxAlphaCo 0.01; maxAlphaDdt 0.01; + functions { interfaceHeight1 { - type interfaceHeight; - libs (fieldFunctionObjects); - alpha alpha.liquid; - locations ((0 0 0)); + // Mandatory entries + type interfaceHeight; + libs (fieldFunctionObjects); + locations ((0 0 0)); + + // Optional entries + alpha alpha.liquid; direction (1 0 0); + liquid true; + interpolationScheme cellPoint; + + // Optional (inherited) entries + writePrecision 16; + writeToFile true; + useUserTime true; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; writeControl timeStep; writeInterval 3; } } + // ************************************************************************* // diff --git a/tutorials/verificationAndValidation/interCondensatingEvaporatingFoam/stefanProblem/system/controlDict b/tutorials/verificationAndValidation/interCondensatingEvaporatingFoam/stefanProblem/system/controlDict index 319739f59caa1e4f79b88c9fba5f1421f781f49e..34e3fa3d17e5460a03e80698e0f202f9514a5914 100644 --- a/tutorials/verificationAndValidation/interCondensatingEvaporatingFoam/stefanProblem/system/controlDict +++ b/tutorials/verificationAndValidation/interCondensatingEvaporatingFoam/stefanProblem/system/controlDict @@ -51,18 +51,38 @@ maxCo 0.01; maxAlphaCo 0.01; maxDeltaT 0.01; + functions { interfaceHeight1 { - type interfaceHeight; - libs (fieldFunctionObjects); - alpha alpha.liquid; - locations ((0 0.0001 1e-5)); + // Mandatory entries + type interfaceHeight; + libs (fieldFunctionObjects); + locations ((0 0.0001 1e-5)); + + // Optional entries + alpha alpha.liquid; direction (1 0 0); + liquid true; + interpolationScheme cellPoint; + + // Optional (inherited) entries + writePrecision 16; + writeToFile true; + useUserTime true; + + region region0; + enabled true; + log true; + timeStart 0; + timeEnd 1000; + executeControl timeStep; + executeInterval 1; writeControl timeStep; writeInterval 3; } } + // ************************************************************************* //