From 11752041d3a4591b9eac0b3fbf4ff2fde3aae292 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 11 Aug 2009 16:43:59 +0100 Subject: [PATCH 1/9] Added option to change dictionary in /constant - could do with a 'nice' way to treat parent folders - constant, system, time dirs etc --- .../changeDictionary/changeDictionary.C | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/applications/utilities/preProcessing/changeDictionary/changeDictionary.C b/applications/utilities/preProcessing/changeDictionary/changeDictionary.C index 6ff9bbce18..917ddb0f1b 100644 --- a/applications/utilities/preProcessing/changeDictionary/changeDictionary.C +++ b/applications/utilities/preProcessing/changeDictionary/changeDictionary.C @@ -72,10 +72,12 @@ namespace Foam int main(int argc, char *argv[]) { -# include "addRegionOption.H" -# include "setRootCase.H" -# include "createTime.H" -# include "createNamedMesh.H" + argList::validOptions.insert("constant", ""); + #include "addRegionOption.H" + + #include "setRootCase.H" + #include "createTime.H" + #include "createNamedMesh.H" fileName regionPrefix = ""; if (regionName != fvMesh::defaultRegion) @@ -83,6 +85,8 @@ int main(int argc, char *argv[]) regionPrefix = regionName; } + bool constant = args.options().found("constant"); + // Get the replacement rules from a dictionary IOdictionary dict ( @@ -196,12 +200,23 @@ int main(int argc, char *argv[]) Info<< "Loading dictionary " << fieldName << endl; const word oldTypeName = IOdictionary::typeName; const_cast(IOdictionary::typeName) = word::null; + + word instance = ""; + if (constant) + { + instance = runTime.constant(); + } + else + { + instance = runTime.timeName(); + } + IOdictionary fieldDict ( IOobject ( fieldName, - runTime.timeName(), + instance, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, From 6f1a813044d9cef452353bf1736b394ceab83cb7 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 12 Aug 2009 10:48:07 +0100 Subject: [PATCH 2/9] minor formatting changes --- bin/foamLog | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/bin/foamLog b/bin/foamLog index 7490978c6e..87bfc9d376 100755 --- a/bin/foamLog +++ b/bin/foamLog @@ -58,9 +58,9 @@ cat <_, for every specified, for every occurrence inside @@ -69,7 +69,7 @@ a time step. For variables that are 'Solved for', the initial residual name will be , the final residual receive the name FinalRes, -The files are a simple xy format with the first column Time (default) +The files are output in a simple xy format with the first column Time (default) and the second the extracted values. Option -n creates single column files with the extracted data only. @@ -114,7 +114,6 @@ do done - myEcho() { if [ "$VERBOSE" ] then @@ -171,6 +170,7 @@ getSolveQueryList() { done } + # getAllQueries dbFile logFile # Gets all queries from database and from logfile getAllQueries() { @@ -202,6 +202,7 @@ getAllQueries() { done | sort -u } + #----------------------------- # Main #----------------------------- @@ -314,8 +315,6 @@ myEcho "" # Generate Awk program #----------------------------- - - #-- header rm -f $AWKFILE; touch $AWKFILE @@ -355,9 +354,6 @@ function extract(inLine,columnSel,outVar, LABEL - - - #-- Generate code for iteration separator (increments 'Iteration') getQueries $DBFILE 'Separator' cat <> $AWKFILE @@ -418,6 +414,7 @@ cat <> $AWKFILE LABSOLVE + #-- generate code to process queries for queryName in $QUERYNAMES do @@ -438,7 +435,6 @@ do done - #----------------------------- # Run awk program on log #----------------------------- From d02c8d1a52b6005e766353bc7340b35f520153a9 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 13 Aug 2009 09:44:09 +0100 Subject: [PATCH 3/9] updated Up calc to use mag() --- .../solvers/incompressible/boundaryFoam/evaluateNearWall.H | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H b/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H index b9683b9e68..8844f21e6e 100644 --- a/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H +++ b/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H @@ -7,8 +7,7 @@ scalar epsilon = turbulence->epsilon()()[cellId]; // scalar omega = turbulence->omega()()[cellId]; scalar k = turbulence->k()()[cellId]; - scalar Up = - flowDirection & (U[cellId] - U.boundaryField()[patchId][faceId]); + scalar magUp = mag(U[cellId] - U.boundaryField()[patchId][faceId]); scalar tauw = flowDirection & R & wallNormal; @@ -16,7 +15,7 @@ scalar yPlus = uTau*y[cellId]/(nu + ROOTVSMALL); - scalar uPlus = Up/(uTau + ROOTVSMALL); + scalar uPlus = magUp/(uTau + ROOTVSMALL); scalar nutPlus = nut/nu; @@ -26,7 +25,7 @@ // scalar omegaPlus = omega*nu/(sqr(uTau) + ROOTVSMALL); - scalar Rey = Up*y[cellId]/nu; + scalar Rey = magUp*y[cellId]/nu; Info<< "Rey = " << Rey << ", uTau = " << uTau << ", nut+ = " << nutPlus << ", y+ = " << yPlus << ", u+ = " << uPlus From 9fb0ed08e7f9821707aec0577a817847e04e0ef6 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 13 Aug 2009 09:54:57 +0100 Subject: [PATCH 4/9] updating turb coeffs + fix typo --- .../multiphase/settlingFoam/createFields.H | 75 +++++-------------- .../multiphase/settlingFoam/kEpsilon.H | 14 ++-- 2 files changed, 26 insertions(+), 63 deletions(-) diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H index 6acb19994a..a085aebb37 100644 --- a/applications/solvers/multiphase/settlingFoam/createFields.H +++ b/applications/solvers/multiphase/settlingFoam/createFields.H @@ -56,20 +56,11 @@ ); - dimensionedScalar rhoc - ( - transportProperties.lookup("rhoc") - ); + dimensionedScalar rhoc(transportProperties.lookup("rhoc")); - dimensionedScalar rhod - ( - transportProperties.lookup("rhod") - ); + dimensionedScalar rhod(transportProperties.lookup("rhod")); - dimensionedScalar muc - ( - transportProperties.lookup("muc") - ); + dimensionedScalar muc(transportProperties.lookup("muc")); dimensionedScalar plasticViscosityCoeff ( @@ -96,10 +87,7 @@ transportProperties.lookup("yieldStressOffset") ); - Switch BinghamPlastic - ( - transportProperties.lookup("BinghamPlastic") - ); + Switch BinghamPlastic(transportProperties.lookup("BinghamPlastic")); volScalarField rho ( @@ -147,8 +135,8 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - muc + - plasticViscosity + muc + + plasticViscosity ( plasticViscosityCoeff, plasticViscosityExponent, @@ -176,10 +164,7 @@ Info<< "Selecting Drift-Flux model " << endl; - word VdjModel - ( - transportProperties.lookup("VdjModel") - ); + word VdjModel(transportProperties.lookup("VdjModel")); Info<< tab << VdjModel << " selected\n" << endl; @@ -188,26 +173,13 @@ transportProperties.subDict(VdjModel + "Coeffs") ); - dimensionedVector V0 - ( - VdjModelCoeffs.lookup("V0") - ); + dimensionedVector V0(VdjModelCoeffs.lookup("V0")); - dimensionedScalar a - ( - VdjModelCoeffs.lookup("a") - ); + dimensionedScalar a(VdjModelCoeffs.lookup("a")); - dimensionedScalar a1 - ( - VdjModelCoeffs.lookup("a1") - ); - - dimensionedScalar alphaMin - ( - VdjModelCoeffs.lookup("alphaMin") - ); + dimensionedScalar a1(VdjModelCoeffs.lookup("a1")); + dimensionedScalar alphaMin(VdjModelCoeffs.lookup("alphaMin")); IOdictionary RASProperties @@ -223,15 +195,9 @@ ); - Switch turbulence - ( - RASProperties.lookup("turbulence") - ); + Switch turbulence(RASProperties.lookup("turbulence")); - dictionary kEpsilonDict - ( - RASProperties.subDictPtr("kEpsilonCoeffs") - ); + dictionary kEpsilonDict(RASProperties.subDictPtr("kEpsilonCoeffs")); dimensionedScalar Cmu ( @@ -273,30 +239,27 @@ ) ); - dimensionedScalar alphak + dimensionedScalar sigmak ( dimensionedScalar::lookupOrAddToDict ( - "alphaEps", + "sigmak", kEpsilonDict, 1.0 ) ); - dimensionedScalar alphaEps + dimensionedScalar sigmaEps ( dimensionedScalar::lookupOrAddToDict ( - "alphaEps", + "sigmaEps", kEpsilonDict, - 0.76923 + 1.3 ) ); - dictionary wallFunctionDict - ( - RASProperties.subDictPtr("wallFunctionCoeffs") - ); + dictionary wallFunctionDict(RASProperties.subDictPtr("wallFunctionCoeffs")); dimensionedScalar kappa ( diff --git a/applications/solvers/multiphase/settlingFoam/kEpsilon.H b/applications/solvers/multiphase/settlingFoam/kEpsilon.H index 742fcde708..522a9afac7 100644 --- a/applications/solvers/multiphase/settlingFoam/kEpsilon.H +++ b/applications/solvers/multiphase/settlingFoam/kEpsilon.H @@ -1,4 +1,4 @@ -if(turbulence) +if (turbulence) { if (mesh.changing()) { @@ -15,9 +15,9 @@ if(turbulence) tgradU.clear(); volScalarField Gcoef = - alphak*Cmu*k*(g & fvc::grad(rho))/(epsilon + epsilon0); + Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilon0); -# include "wallFunctions.H" + #include "wallFunctions.H" // Dissipation equation fvScalarMatrix epsEqn @@ -26,7 +26,7 @@ if(turbulence) + fvm::div(phi, epsilon) - fvm::laplacian ( - alphaEps*mut + mul, epsilon, + mut/sigmaEps + mul, epsilon, "laplacian(DepsilonEff,epsilon)" ) == @@ -35,7 +35,7 @@ if(turbulence) - fvm::Sp(C2*rho*epsilon/k, epsilon) ); -# include "wallDissipation.H" + #include "wallDissipation.H" epsEqn.relax(); epsEqn.solve(); @@ -51,7 +51,7 @@ if(turbulence) + fvm::div(phi, k) - fvm::laplacian ( - alphak*mut + mul, k, + mut/sigmak + mul, k, "laplacian(DkEff,k)" ) == @@ -66,7 +66,7 @@ if(turbulence) //- Re-calculate viscosity mut = rho*Cmu*sqr(k)/(epsilon + epsilon0); -# include "wallViscosity.H" + #include "wallViscosity.H" } mu = mut + mul; From 248eb8b51e057c8c9b112e247c4fcd1e8a91126a Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 13 Aug 2009 11:56:05 +0100 Subject: [PATCH 5/9] README for buoyantCavity tutorial case --- .../buoyantSimpleFoam/buoyantCavity/README | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/README diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/README b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/README new file mode 100644 index 0000000000..c8952e9c42 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/README @@ -0,0 +1,12 @@ +* Buoyancy driven, natural convection + + +* Reference: Betts, P.L. and Bokhari, I.H.; "Experiments in turbulent natural convection in an enclosed tall cavity"; International Journal of Heat and Fluid Flow; volume 21; 2000; pp 675-683. + + +* Test case considers the lower of the two plate temperature differences, 19.6 degC. + + +* Experimental data publicly available from (13/08/2009): + +http://cfd.mace.manchester.ac.uk/cgi-bin/cfddb/prpage.cgi?79&EXP&database/cases/case79/Case_data&database/cases/case79&cas79_head.html&cas79_desc.html&cas79_meth.html&cas79_data.html&cas79_refs.html&cas79_rsol.html&1&0&0&0&0&unknown From 4eb83aed2701ac52f9c7c33944130beed9d0951a Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 13 Aug 2009 15:31:39 +0100 Subject: [PATCH 6/9] using generic -instance option instead of -constant --- .../changeDictionary/changeDictionary.C | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/applications/utilities/preProcessing/changeDictionary/changeDictionary.C b/applications/utilities/preProcessing/changeDictionary/changeDictionary.C index 917ddb0f1b..e8e441b165 100644 --- a/applications/utilities/preProcessing/changeDictionary/changeDictionary.C +++ b/applications/utilities/preProcessing/changeDictionary/changeDictionary.C @@ -72,7 +72,7 @@ namespace Foam int main(int argc, char *argv[]) { - argList::validOptions.insert("constant", ""); + argList::validOptions.insert("instance", "instance"); #include "addRegionOption.H" #include "setRootCase.H" @@ -85,7 +85,11 @@ int main(int argc, char *argv[]) regionPrefix = regionName; } - bool constant = args.options().found("constant"); + word instance = runTime.timeName(); + if (args.options().found("instance")) + { + instance = args.options()["instance"]; + } // Get the replacement rules from a dictionary IOdictionary dict @@ -201,16 +205,6 @@ int main(int argc, char *argv[]) const word oldTypeName = IOdictionary::typeName; const_cast(IOdictionary::typeName) = word::null; - word instance = ""; - if (constant) - { - instance = runTime.constant(); - } - else - { - instance = runTime.timeName(); - } - IOdictionary fieldDict ( IOobject From a41b159fbc7e634b4430cc29e91d4153fcdb2879 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 13 Aug 2009 16:56:59 +0100 Subject: [PATCH 7/9] adding boundaryFoam tutorial to evaluate wall functions --- .../boundaryWallFunctionsProfile/0/U | 46 ++++++++++ .../boundaryWallFunctionsProfile/0/epsilon | 46 ++++++++++ .../boundaryWallFunctionsProfile/0/k | 46 ++++++++++ .../boundaryWallFunctionsProfile/0/nuTilda | 44 ++++++++++ .../boundaryWallFunctionsProfile/0/nut | 46 ++++++++++ .../boundaryWallFunctionsProfile/0/nut.k | 46 ++++++++++ .../0/nut.spalding | 46 ++++++++++ .../boundaryWallFunctionsProfile/0/omega | 46 ++++++++++ .../boundaryWallFunctionsProfile/Allclean | 11 +++ .../boundaryWallFunctionsProfile/Allrun | 69 +++++++++++++++ .../boundaryWallFunctionsProfile/README | 14 +++ .../constant/RASProperties | 25 ++++++ .../constant/polyMesh/blockMeshDict | 71 +++++++++++++++ .../constant/polyMesh/boundary | 47 ++++++++++ .../constant/transportProperties | 25 ++++++ .../constant/transportProperties.template | 25 ++++++ .../system/controlDict | 58 ++++++++++++ .../system/fvSchemes | 61 +++++++++++++ .../system/fvSolution | 88 +++++++++++++++++++ 19 files changed, 860 insertions(+) create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/U create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/epsilon create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/k create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nuTilda create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut.k create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut.spalding create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/omega create mode 100755 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allclean create mode 100755 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/README create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/constant/RASProperties create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/constant/polyMesh/blockMeshDict create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/constant/polyMesh/boundary create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/constant/transportProperties create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/constant/transportProperties.template create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/system/controlDict create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/system/fvSchemes create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/system/fvSolution diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/U b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/U new file mode 100644 index 0000000000..b75d124cdc --- /dev/null +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/U @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (1 0 0); + +boundaryField +{ + lowerWall + { + type fixedValue; + value uniform (0 0 0); + } + + upperWall + { + type fixedValue; + value uniform (0 0 0); + } + + frontBack + { + type cyclic; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/epsilon b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/epsilon new file mode 100644 index 0000000000..5b6d7f698f --- /dev/null +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/epsilon @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 1e-08; + +boundaryField +{ + lowerWall + { + type epsilonWallFunction; + value uniform 1e-08; + } + upperWall + { + type epsilonWallFunction; + value uniform 1e-08; + } + frontBack + { + type cyclic; + value uniform 1e-08; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/k b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/k new file mode 100644 index 0000000000..d278c05cef --- /dev/null +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/k @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.000000001; + +boundaryField +{ + lowerWall + { + type kqRWallFunction; + internalField uniform 0.1; + } + upperWall + { + type kqRWallFunction; + internalField uniform 0.1; + } + frontBack + { + type cyclic; + internalField uniform 0.1; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nuTilda b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nuTilda new file mode 100644 index 0000000000..38a021b100 --- /dev/null +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nuTilda @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nuTilda; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + lowerWall + { + type zeroGradient; + } + + upperWall + { + type zeroGradient; + } + + frontBack + { + type cyclic; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut new file mode 100644 index 0000000000..5bcd4c4a1d --- /dev/null +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + lowerWall + { + type nutkWallFunction; + value uniform 0; + } + upperWall + { + type nutkWallFunction; + value uniform 0; + } + frontBack + { + type cyclic; + value uniform 0; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut.k b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut.k new file mode 100644 index 0000000000..5bcd4c4a1d --- /dev/null +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut.k @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + lowerWall + { + type nutkWallFunction; + value uniform 0; + } + upperWall + { + type nutkWallFunction; + value uniform 0; + } + frontBack + { + type cyclic; + value uniform 0; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut.spalding b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut.spalding new file mode 100644 index 0000000000..21cc8ebc19 --- /dev/null +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/nut.spalding @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + lowerWall + { + type nutUSpaldingWallFunction; + value uniform 0; + } + upperWall + { + type nutUSpaldingWallFunction; + value uniform 0; + } + frontBack + { + type cyclic; + value uniform 0; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/omega b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/omega new file mode 100644 index 0000000000..75b8cd335b --- /dev/null +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/0/omega @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform 1111.11; + +boundaryField +{ + lowerWall + { + type omegaWallFunction; + value uniform 1111.11; + } + upperWall + { + type omegaWallFunction; + value uniform 1111.11; + } + frontBack + { + type cyclic; + value uniform 1111.11; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allclean b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allclean new file mode 100755 index 0000000000..0d6bac1543 --- /dev/null +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allclean @@ -0,0 +1,11 @@ +#!/bin/sh + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase + +rm -rf logs +rm -f *.eps yPlus_vs_uPlus + +echo "done" diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun new file mode 100755 index 0000000000..6f45774974 --- /dev/null +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun @@ -0,0 +1,69 @@ +#!/bin/sh + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh + +exponents="2 3 4 5 6 7 8" + +echo "# yPlus vs uPlus" > yPlus_vs_uPlus + +for e in $exponents; do + echo " Setting nu to 1e-$e" + + sed "s/XXX/$e/g" constant/transportProperties.template \ + > constant/transportProperties + + runApplication boundaryFoam + + mv log.boundaryFoam log.boundaryFoam_$e + + # extract y+, U+ + # note: both must be added to foamLog.db + runApplication foamLog log.boundaryFoam_$e + + mv log.foamLog log.foamLog_$e + + if [ -e logs/yPlus_0 ]; then + yPlus=`awk < logs/yPlus_0 'END{print $2}'` + uPlus=`awk < logs/uPlus_0 'END{print $2}'` + + echo "$yPlus $uPlus" >> yPlus_vs_uPlus + fi + + rm -rf logs +done + + +# create validation plot +# test if gnuplot exists on the system +type -P gnuplot &>/dev/null || { + echo "gnuplot not found - skipping graph creation" >&2; exit 1; +} +graphName="OF_vs_ANAYTICAL.eps" + +echo "Creating graph of u+ vs y+ to $graphName" +gnuplot< Date: Thu, 13 Aug 2009 16:58:10 +0100 Subject: [PATCH 8/9] adding location to list of searched locations for foamLog.db --- bin/foamLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/foamLog b/bin/foamLog index 87bfc9d376..47968aa120 100755 --- a/bin/foamLog +++ b/bin/foamLog @@ -82,6 +82,7 @@ separated with '/' : The value taken will be the first (non-space)word after this column. The database ($PROGNAME.db) will taken from these locations: + . $HOME/.OpenFOAM/$WM_PROJECT_VERSION $HOME/.OpenFOAM $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION @@ -98,6 +99,7 @@ LABHELP # The various places to be searched: for i in \ + . \ $HOME/.OpenFOAM/$WM_PROJECT_VERSION \ $HOME/.OpenFOAM \ $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION \ From a1d6fdf994f81802d2fbfcfd9bc5bde12eb14cb2 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 13 Aug 2009 17:09:22 +0100 Subject: [PATCH 9/9] adding local foamLog.db --- .../boundaryWallFunctionsProfile/foamLog.db | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/foamLog.db diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/foamLog.db b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/foamLog.db new file mode 100644 index 0000000000..dafe0166cc --- /dev/null +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/foamLog.db @@ -0,0 +1,62 @@ +#------------------------------------------------------------------------------ +# Query database for Foam Log extraction. +# Each line stands for one query: +# +# name '/' line selector '/' column selector +# +# e.g. +# kMin/bounding k,/min: +# +# The extraction will select a line using 'bounding k,' and in the line +# takes the word following 'min:' as the value. +# +# A special entry is the 'Separator' entry which delimits one iteration +# from the other. +# +#------------------------------------------------------------------------------ + +#- String to recognize new iteration by (usually same as 'Time') +Separator/^[ \t]*Time = /Time = + +#- Time value: +Time/^[ \t]*Time = /Time = + +#- Continuity errors: +contLocal/time step continuity errors :/sum local = +contGlobal/time step continuity errors :/ global = +contCumulative/time step continuity errors :/cumulative = + +#- Special for combustion code: +minFu/min\(fu\) = /min(fu) = +minFt/min\(ft\) = /min(ft) = + +#- Execution time: +executionTime/ExecutionTime = /ExecutionTime = + +#- Courant no: +CourantMax/Courant Number /max: +CourantMean/Courant Number /mean: + +#- K bounding +kMin/bounding k,/min: +kMax/bounding k,/max: +kAvg/bounding k,/average: + +#- epsilon bounding +epsMin/bounding epsilon,/min: +epsMax/bounding epsilon,/max: +epsAvg/bounding epsilon,/average: + +#- gamma bounding +gammaMin/Min\(gamma\) =/Min(gamma) = +gammaMax/Max\(gamma\) =/Max(gamma) = + +#- Wall function data - line begins with Rey = +Rey/Rey = /Rey = +uTau/Rey = /uTau = +nutPlus/Rey = /nut+ = +yPlus/Rey = /y+ = +uPlus/Rey = /u+ = +kPlus/Rey = /k+ = +epsilonPlus/Rey = /epsilon+ = +