diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwmake b/applications/solvers/compressible/rhoCentralFoam/Allwmake index 69a108d537..698558da0b 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwmake +++ b/applications/solvers/compressible/rhoCentralFoam/Allwmake @@ -1,5 +1,8 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x wmake libso BCs wmake +# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C index a1347365f5..101c41a353 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C @@ -77,13 +77,13 @@ smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField : mixedFvPatchScalarField(p, iF), accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))), - Twall_("Twall", dict, p.size()) + Twall_("Twall", dict, p.size()), + gamma_(dict.lookupOrDefault("gamma", 1.4)) { if ( mag(accommodationCoeff_) < SMALL - || - mag(accommodationCoeff_) > 2.0 + || mag(accommodationCoeff_) > 2.0 ) { FatalIOErrorIn @@ -96,8 +96,8 @@ smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField " const dictionary&" ")", dict - ) << "unphysical accommodationCoeff_ specified" - << "(0 < accommodationCoeff_ <= 1)" << endl + ) << "unphysical accommodationCoeff specified" + << "(0 < accommodationCoeff <= 1)" << endl << exit(FatalError); } @@ -113,15 +113,6 @@ smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField fvPatchField::operator=(patchInternalField()); } - if (dict.found("gamma")) - { - gamma_ = readScalar(dict.lookup("gamma")); - } - else - { - gamma_ = 1.4; - } - refValue() = *this; refGrad() = 0.0; valueFraction() = 0.0; diff --git a/applications/solvers/compressible/rhopSonicFoam/Allwmake b/applications/solvers/compressible/rhopSonicFoam/Allwmake index cccfd63757..698558da0b 100755 --- a/applications/solvers/compressible/rhopSonicFoam/Allwmake +++ b/applications/solvers/compressible/rhopSonicFoam/Allwmake @@ -1,5 +1,8 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory set -x wmake libso BCs wmake + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C index b9b46a3cc9..19933091a0 100644 --- a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C +++ b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C @@ -26,8 +26,8 @@ Application boundaryFoam Description - Steady-state solver for 1D turbulent flow, typically to generate boundary - layer conditions at an inlet, for use in a simulation. + Steady-state solver for 1D turbulent flow, typically to generate boundary + layer conditions at an inlet, for use in a simulation. Boundary layer code to calculate the U, k and epsilon distributions. Used to create inlet boundary conditions for experimental comparisons @@ -82,11 +82,14 @@ int main(int argc, char *argv[]) U += (Ubar - UbarStar); gradP += (Ubar - UbarStar)/(1.0/UEqn.A())().weightedAverage(mesh.V()); + label id = y.size() - 1; + scalar wallShearStress = - flowDirection & turbulence->R()()[0] & wallNormal; + flowDirection & turbulence->R()()[id] & wallNormal; scalar yplusWall - = ::sqrt(mag(wallShearStress))*y[0]/laminarTransport.nu()()[0]; +// = ::sqrt(mag(wallShearStress))*y[id]/laminarTransport.nu()()[id]; + = ::sqrt(mag(wallShearStress))*y[id]/turbulence->nuEff()()[id]; Info<< "Uncorrected Ubar = " << (flowDirection & UbarStar.value())<< tab << "pressure gradient = " << (flowDirection & gradP.value()) << tab diff --git a/applications/solvers/incompressible/simpleFoam/Make/options b/applications/solvers/incompressible/simpleFoam/Make/options index e1ffa28773..8a31f7e5ab 100644 --- a/applications/solvers/incompressible/simpleFoam/Make/options +++ b/applications/solvers/incompressible/simpleFoam/Make/options @@ -7,5 +7,4 @@ EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleTransportModels \ -lfiniteVolume \ - -lmeshTools \ - /* $(LIB_WM_OPTIONS_DIR)/libfbsdmalloc.o */ + -lmeshTools diff --git a/applications/solvers/multiphase/lesInterFoam/lesInterFoam.C b/applications/solvers/multiphase/lesInterFoam/lesInterFoam.C index 264eb28dea..8d109f03b3 100644 --- a/applications/solvers/multiphase/lesInterFoam/lesInterFoam.C +++ b/applications/solvers/multiphase/lesInterFoam/lesInterFoam.C @@ -85,6 +85,8 @@ int main(int argc, char *argv[]) #include "continuityErrs.H" + p = pd + rho*gh; + runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake index 8314bfa069..29294d166a 100755 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwmake @@ -1,7 +1,10 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory set -x wmake libso phaseModel wmake libso interfacialModels wmake libso kineticTheoryModels wmake + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C index 61a2f4d854..f4336bce92 100644 --- a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C +++ b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C @@ -184,10 +184,6 @@ int main(int argc, char *argv[]) << endl; // Transfer DynamicLists to straight ones. - labelList cutEdges; - cutEdges.transfer(allCutEdges); - allCutEdges.clear(); - scalarField cutEdgeWeights; cutEdgeWeights.transfer(allCutEdgeWeights); allCutEdgeWeights.clear(); @@ -199,7 +195,7 @@ int main(int argc, char *argv[]) mesh, cutCells.toc(), // cells candidate for cutting labelList(0), // cut vertices - cutEdges, // cut edges + allCutEdges, // cut edges cutEdgeWeights // weight on cut edges ); diff --git a/applications/utilities/mesh/conversion/Optional/Allwmake b/applications/utilities/mesh/conversion/Optional/Allwmake index 2db40f48ad..2734e41562 100755 --- a/applications/utilities/mesh/conversion/Optional/Allwmake +++ b/applications/utilities/mesh/conversion/Optional/Allwmake @@ -2,7 +2,6 @@ # # Build optional components (eg, may depend on third-party libraries) # ----------------------------------------------------------------------------- - cd ${0%/*} || exit 1 # run from this directory set -x @@ -18,4 +17,4 @@ then wmake ccm26ToFoam fi -# end +# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/mesh/generation/extrudeMesh/Allwmake b/applications/utilities/mesh/generation/extrudeMesh/Allwmake index 876125ce82..871cad2b68 100755 --- a/applications/utilities/mesh/generation/extrudeMesh/Allwmake +++ b/applications/utilities/mesh/generation/extrudeMesh/Allwmake @@ -1,6 +1,8 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory set -x wmake libso extrudeModel wmake +# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 4737f38e53..edcfbf2aee 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -433,7 +433,7 @@ int main(int argc, char *argv[]) Info<< "Finished meshing in = " << runTime.elapsedCpuTime() << " s." << endl; - Pout<< "End\n" << endl; + Info<< "End\n" << endl; return(0); } diff --git a/applications/utilities/mesh/manipulation/setSet/Allwmake b/applications/utilities/mesh/manipulation/setSet/Allwmake index 35e3af7c1b..e10d037cbc 100755 --- a/applications/utilities/mesh/manipulation/setSet/Allwmake +++ b/applications/utilities/mesh/manipulation/setSet/Allwmake @@ -1,4 +1,5 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory READLINE=0 if [ -f /usr/include/readline/readline.h ]; then @@ -9,3 +10,5 @@ if [ -f /usr/include/readline/readline.h ]; then fi export READLINE wmake + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposeMesh.C b/applications/utilities/parallelProcessing/decomposePar/decomposeMesh.C index 0d81b1aedd..55f5c96579 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposeMesh.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposeMesh.C @@ -35,11 +35,8 @@ Description #include "IOstreams.H" #include "SLPtrList.H" #include "boolList.H" -#include "cellList.H" #include "primitiveMesh.H" -#include "cyclicFvPatch.H" -#include "fvPatchList.H" -#include "DynamicList.H" +#include "cyclicPolyPatch.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C index bee2d17b25..dd107c2f2f 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C @@ -33,7 +33,7 @@ License #include "OSspecific.H" #include "Map.H" #include "globalMeshData.H" - +#include "DynamicList.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C index 3030a30316..7cf137cd0e 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C +++ b/applications/utilities/postProcessing/dataConversion/foamToFieldview9/foamToFieldview9.C @@ -45,7 +45,6 @@ Description #include "IOobjectList.H" #include "boolList.H" #include "stringList.H" -#include "DynamicList.H" #include "cellModeller.H" #include "floatScalar.H" diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/internalWriter.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/internalWriter.C index bf1fb3b775..1ac0d8b729 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/internalWriter.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/internalWriter.C @@ -27,9 +27,6 @@ License #include "internalWriter.H" #include "writeFuns.H" -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from components diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/lagrangianWriter.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/lagrangianWriter.C index bbf24b1b17..ea7da50a40 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/lagrangianWriter.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/lagrangianWriter.C @@ -29,9 +29,6 @@ License #include "Cloud.H" #include "passiveParticle.H" -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from components diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/writePatchGeom.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/writePatchGeom.C index 62b8661810..6ad993e0aa 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/writePatchGeom.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/writePatchGeom.C @@ -78,6 +78,7 @@ void writePatchGeom writeFuns::write(pStream, binary, vertLabels); } + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/writePointSet.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/writePointSet.C index ea7dbf4301..9e495e073d 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/writePointSet.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/writePointSet.C @@ -103,6 +103,7 @@ void writePointSet writeFuns::write(pStream, binary, pointIDs); } + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake index a7e703b8c0..c7a80fc7fb 100755 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake @@ -17,3 +17,5 @@ then ;; esac fi + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PVFoamReader/Allwmake index ea67e28d5b..b1106aa608 100755 --- a/applications/utilities/postProcessing/graphics/PVFoamReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PVFoamReader/Allwmake @@ -1,4 +1,5 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] @@ -16,3 +17,5 @@ then ;; esac fi + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake b/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake index aca3e014c9..f29cdda208 100755 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake @@ -1,2 +1,6 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + wmake libso + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C b/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C index 4b7a09acbf..3c0e18a9cf 100644 --- a/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C +++ b/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C @@ -75,7 +75,7 @@ int main(int argc, char *argv[]) } // Give patch area - Info<< " Patch area = " << sum(mesh.Sf()) << endl; + Info<< " Patch area = " << sum(mesh.Sf().boundaryField()[patchi]) << endl; if (fieldHeader.headerClassName() == "volScalarField") { diff --git a/applications/utilities/preProcessing/applyWallFunctionBounaryConditions/Make/files b/applications/utilities/preProcessing/applyWallFunctionBounaryConditions/Make/files new file mode 100644 index 0000000000..58f5dd3974 --- /dev/null +++ b/applications/utilities/preProcessing/applyWallFunctionBounaryConditions/Make/files @@ -0,0 +1,3 @@ +applyWallFunctionBounaryConditions.C + +EXE = $(FOAM_APPBIN)/applyWallFunctionBounaryConditions diff --git a/applications/utilities/preProcessing/applyWallFunctionBounaryConditions/Make/options b/applications/utilities/preProcessing/applyWallFunctionBounaryConditions/Make/options new file mode 100644 index 0000000000..89e52b6d52 --- /dev/null +++ b/applications/utilities/preProcessing/applyWallFunctionBounaryConditions/Make/options @@ -0,0 +1,6 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lfiniteVolume + diff --git a/applications/utilities/preProcessing/applyWallFunctionBounaryConditions/applyWallFunctionBounaryConditions.C b/applications/utilities/preProcessing/applyWallFunctionBounaryConditions/applyWallFunctionBounaryConditions.C new file mode 100644 index 0000000000..e571cc4373 --- /dev/null +++ b/applications/utilities/preProcessing/applyWallFunctionBounaryConditions/applyWallFunctionBounaryConditions.C @@ -0,0 +1,279 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + applyWallFunctionBounaryConditions + +Description + Updates OpenFOAM RAS cases to use the new wall function framework + Attempts to determine whether case is compressible or incompressible, or + can be supplied with -compressible command line argument + +\*---------------------------------------------------------------------------*/ + + +#include "argList.H" +#include "fvMesh.H" +#include "Time.H" +#include "volFields.H" +#include "surfaceFields.H" + +#include "wallPolyPatch.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +bool caseIsCompressible(const fvMesh& mesh) +{ + // Attempt flux field + IOobject phiHeader + ( + "phi", + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (phiHeader.headerOk()) + { + surfaceScalarField phi(phiHeader, mesh); + if (phi.dimensions() == dimDensity*dimVelocity*dimArea) + { + return true; + } + } + + // Attempt density field + IOobject rhoHeader + ( + "rho", + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (rhoHeader.headerOk()) + { + volScalarField rho(rhoHeader, mesh); + if (rho.dimensions() == dimDensity) + { + return true; + } + } + + // Attempt pressure field + IOobject pHeader + ( + "p", + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (pHeader.headerOk()) + { + volScalarField p(pHeader, mesh); + if (p.dimensions() == dimMass/sqr(dimTime)/dimLength) + { + return true; + } + } + + // Attempt hydrostatic pressure field + IOobject pdHeader + ( + "pd", + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (pdHeader.headerOk()) + { + volScalarField pd(pdHeader, mesh); + if (pd.dimensions() == dimMass/sqr(dimTime)/dimLength) + { + return true; + } + } + + // If none of the above are true, assume that the case is incompressible + return false; +} + + +void createVolScalarField +( + const fvMesh& mesh, + const word& fieldName, + const dimensionSet& dims +) +{ + IOobject fieldHeader + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (!fieldHeader.headerOk()) + { + Info<< "Creating field " << fieldName << nl << endl; + + volScalarField field + ( + IOobject + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("zero", dims, 0.0) + ); + + field.write(); + } +} + + +void replaceBoundaryType +( + const fvMesh& mesh, + const word& fieldName, + const word& boundaryType, + const string& boundaryValue +) +{ + IOobject header + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (!header.headerOk()) + { + return; + } + + Info<< "Updating boundary types for field " << header.name() << endl; + + const word oldTypeName = IOdictionary::typeName; + const_cast(IOdictionary::typeName) = word::null; + + IOdictionary dict(header); + + const_cast(IOdictionary::typeName) = oldTypeName; + const_cast(dict.type()) = dict.headerClassName(); + + // Make a backup of the old field + word backupName(dict.name() + ".old"); + Info<< " copying " << dict.name() << " to " + << backupName << endl; + IOdictionary dictOld = dict; + dictOld.rename(backupName); + dictOld.regIOobject::write(); + + // Loop through boundary patches and update + const polyBoundaryMesh& bMesh = mesh.boundaryMesh(); + dictionary& boundaryDict = dict.subDict("boundaryField"); + forAll(bMesh, patchI) + { + if (isType(bMesh[patchI])) + { + word patchName = bMesh[patchI].name(); + dictionary& oldPatch = boundaryDict.subDict(patchName); + + dictionary newPatch(dictionary::null); + newPatch.add("type", boundaryType); + newPatch.add("value", ("uniform " + boundaryValue).c_str()); + + oldPatch = newPatch; + } + } + + Info<< " writing updated " << dict.name() << nl << endl; + dict.regIOobject::write(); +} + + +int main(int argc, char *argv[]) +{ + +# include "addTimeOptions.H" + argList::validOptions.insert("compressible", ""); + +# include "setRootCase.H" +# include "createTime.H" +# include "createMesh.H" + + bool compressible = args.options().found("compressible"); + + Info<< "Updating turbulence fields to operate using new run time " + << "selectable" << nl << "wall functions" + << nl << endl; + + if (compressible || caseIsCompressible(mesh)) + { + Info<< "Case treated as compressible" << nl << endl; + createVolScalarField + ( + mesh, + "mut", + dimArea/dimTime*dimDensity + ); + replaceBoundaryType(mesh, "mut", "mutWallFunction", "0"); + } + else + { + Info<< "Case treated as incompressible" << nl << endl; + createVolScalarField(mesh, "nut", dimArea/dimTime); + replaceBoundaryType(mesh, "nut", "nutWallFunction", "0"); + } + + replaceBoundaryType(mesh, "epsilon", "epsilonWallFunction", "0"); + replaceBoundaryType(mesh, "omega", "omegaWallFunction", "0"); + replaceBoundaryType(mesh, "k", "kQRWallFunction", "0"); + replaceBoundaryType(mesh, "q", "kQRWallFunction", "0"); + replaceBoundaryType(mesh, "R", "kQRWallFunction", "(0 0 0 0 0 0)"); + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/doc/Doxygen/Allwmake b/doc/Doxygen/Allwmake index 7f9ccb0522..dab44579b8 100755 --- a/doc/Doxygen/Allwmake +++ b/doc/Doxygen/Allwmake @@ -1,4 +1,5 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory set -x umask 22 diff --git a/etc/controlDict b/etc/controlDict index 2cf2ce334a..9651981ac9 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -808,7 +808,7 @@ OptimisationSwitches { fileModificationSkew 10; commsType nonBlocking; //scheduled; //blocking; - floatTransfer 1; + floatTransfer 0; nProcsSimpleSum 0; } diff --git a/etc/settings.csh b/etc/settings.csh index d21268aafb..cfa1927ef2 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -82,7 +82,10 @@ switch ("$WM_COMPILER_INST") case OpenFOAM: switch ("$WM_COMPILER") case Gcc: - setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.1/platforms/$WM_ARCH$WM_COMPILER_ARCH + #setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.1/platforms/$WM_ARCH$WM_COMPILER_ARCH + setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH + _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib + _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.3/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib breaksw case Gcc42: setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH @@ -105,13 +108,8 @@ case OpenFOAM: endsw if ($?WM_COMPILER_BIN) then - set path=($WM_COMPILER_BIN $path) - - if ($?LD_LIBRARY_PATH) then - setenv LD_LIBRARY_PATH ${WM_COMPILER_LIB}:${LD_LIBRARY_PATH} - else - setenv LD_LIBRARY_PATH ${WM_COMPILER_LIB} - endif + _foamAddPath $WM_COMPILER_BIN + _foamAddLib $WM_COMPILER_LIB endif unset WM_COMPILER_BIN diff --git a/etc/settings.sh b/etc/settings.sh index 612719e292..743d8e1fc0 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -99,7 +99,10 @@ case "$WM_COMPILER_INST" in OpenFOAM) case "$WM_COMPILER" in Gcc) - export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.1/platforms/$WM_ARCH$WM_COMPILER_ARCH + #export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.1/platforms/$WM_ARCH$WM_COMPILER_ARCH + export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH + _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib + _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.3/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib ;; Gcc42) export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH @@ -123,8 +126,8 @@ OpenFOAM) esac if [ -d "$WM_COMPILER_BIN" ]; then - export PATH=$WM_COMPILER_BIN:$PATH - export LD_LIBRARY_PATH=$WM_COMPILER_LIB:$LD_LIBRARY_PATH + _foamAddPath $WM_COMPILER_BIN + _foamAddLib $WM_COMPILER_LIB fi unset WM_COMPILER_BIN WM_COMPILER_LIB diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.C b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.C index 8297002b82..24d1edea53 100644 --- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.C +++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.C @@ -33,7 +33,7 @@ template Foam::DynamicList::DynamicList(Istream& is) : List(is), - nextFree_(List::size()) + allocSize_(List::size()) {} @@ -44,9 +44,6 @@ Foam::Ostream& Foam::operator<< const Foam::DynamicList& DL ) { - const_cast&>(DL) - .setSize(DL.nextFree_); - os << static_cast&>(DL); return os; } @@ -60,7 +57,7 @@ Foam::Istream& Foam::operator>> ) { is >> static_cast&>(DL); - DL.nextFree_ = DL.List::size(); + DL.allocSize_ = DL.List::size(); return is; } diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H index a98be44fef..95cb34932d 100644 --- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H +++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H @@ -26,7 +26,7 @@ Class Foam::DynamicList Description - A 1D vector of objects of type \ which resizes itself as necessary to + A 1D vector of objects of type \ that resizes itself as necessary to accept the new objects. Internal storage is a compact array and the list can be shrunk to compact @@ -81,24 +81,29 @@ class DynamicList { // Private data - //- Number of next free element - label nextFree_; + //- Allocated size for underlying List. + label allocSize_; public: + // Related types + + //- Declare friendship with the List class + friend class List; + // Constructors //- Construct null inline DynamicList(); - //- Construct given size + //- Construct given size. explicit inline DynamicList(const label); - //- Construct from UList. nextFree_ set to size(). + //- Construct from UList. Size set to UList size. explicit inline DynamicList(const UList&); - //- Construct from Istream. nextFree_ set to size(). + //- Construct from Istream. Size set to size of read list. explicit DynamicList(Istream&); @@ -106,22 +111,24 @@ public: // Access - //- Size of the active part of the list. - // Direct over-ride of list size member function - inline label size() const; + //- Size of the underlying storage. + inline label allocSize() const; // Edit //- Reset size of List. - void setSize(const label); + inline void setSize(const label); //- Reset size of List and value for new elements. - void setSize(const label, const T&); + inline void setSize(const label, const T&); - //- Clear the list, i.e. set next free to zero. + //- Clear the list, i.e. set the size to zero. // Allocated size does not change - void clear(); + inline void clear(); + + //- Clear the list and delete storage. + inline void clearStorage(); //- Shrink the List to the number of elements used inline DynamicList& shrink(); @@ -129,12 +136,12 @@ public: //- Transfer the contents of the argument List into this List // and annull the argument list. Is same as List::transfer except // checks that you're not changing the underlying list to something - // smaller than nextFree_. - void transfer(List&); + // smaller than allocSize_. + inline void transfer(List&); //- Transfer the contents of the argument DynamicList into this // DynamicList and annull the argument list. - void transfer(DynamicList&); + inline void transfer(DynamicList&); // Member Operators @@ -142,7 +149,7 @@ public: //- Append an element at the end of the list inline void append(const T& e); - //- Return and remove the top element + //- Remove and return the top element inline T remove(); //- Return non-const access to an element, @@ -152,7 +159,7 @@ public: //- Assignment of all entries to the given value inline void operator=(const T&); - //- Assignment to List + //- Assignment from List. Also handles assignment from DynamicList. inline void operator=(const List&); diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H index 8d451ccd7a..da6bd13067 100644 --- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H +++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H @@ -31,8 +31,10 @@ template inline Foam::DynamicList::DynamicList() : List(SizeInc), - nextFree_(0) -{} + allocSize_(SizeInc) +{ + List::size() = 0; +} //- Construct given size @@ -43,8 +45,10 @@ inline Foam::DynamicList::DynamicList ) : List(s), - nextFree_(0) -{} + allocSize_(s) +{ + List::size() = 0; +} //- Construct given size @@ -55,17 +59,17 @@ inline Foam::DynamicList::DynamicList ) : List(s), - nextFree_(s.size()) + allocSize_(s.size()) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -inline Foam::label Foam::DynamicList::size() +inline Foam::label Foam::DynamicList::allocSize() const { - return nextFree_; + return allocSize_; } @@ -75,13 +79,16 @@ inline void Foam::DynamicList::setSize const label s ) { - if (s < nextFree_) + if (s < List::size()) { - nextFree_ = s; + List::size() = s; } else { - List::setSize(s); + label nextFree = List::size(); + allocSize_ = s; + List::setSize(allocSize_); + List::size() = nextFree; } } @@ -93,14 +100,16 @@ inline void Foam::DynamicList::setSize const T& t ) { - if (s < nextFree_) + if (s < List::size()) { - nextFree_ = s; + List::size() = s; } else { - List::setSize(s, t); - nextFree_ = s; + label nextFree = List::size(); + allocSize_ = s; + List::setSize(allocSize_, t); + List::size() = nextFree; } } @@ -108,7 +117,15 @@ inline void Foam::DynamicList::setSize template inline void Foam::DynamicList::clear() { - nextFree_ = 0; + List::size() = 0; +} + + +template +inline void Foam::DynamicList::clearStorage() +{ + List::clear(); + allocSize_ = 0; } @@ -116,7 +133,8 @@ template inline Foam::DynamicList& Foam::DynamicList::shrink() { - List::setSize(nextFree_); + allocSize_ = List::size(); + List::setSize(allocSize_); return *this; } @@ -125,20 +143,20 @@ template inline void Foam::DynamicList::transfer(List& l) { - if (l.size() < nextFree_) + if (l.size() < List::size()) { FatalErrorIn ( "void DynamicList::transfer(List&)" ) << "Cannot replace the underlying storage of this DynamicList" - << " of which " << nextFree_ << " elements are used" << nl + << " of which " << List::size() << " elements are used" << nl << "with a List of size " << l.size() << abort(FatalError); } else { + allocSize_ = l.size(); List::transfer(l); // take over storage - l.clear(); // set nextFree of l to 0 } } @@ -150,48 +168,53 @@ Foam::DynamicList::transfer DynamicList& l ) { - List::transfer(l); // take over storage - nextFree_ = l.size(); // take over used size - l.clear(); // set nextFree of l to 0 + allocSize_ = l.allocSize(); + List::transfer(l); // take over storage. Null l. } template -inline void Foam::DynamicList::append -( - const T& e -) +inline void Foam::DynamicList::append(const T& e) { - nextFree_++; + // Work on copy free index since gets overwritten by setSize + label nextFree = List::size(); - if (nextFree_ > List::size()) + nextFree++; + + if (nextFree > allocSize_) { - List::setSize + allocSize_ = max ( - max - ( - nextFree_, - label(SizeMult*List::size()/SizeDiv + SizeInc) - ) + nextFree, + label(SizeMult*allocSize_/SizeDiv + SizeInc) ); + List::setSize(allocSize_); } - this->operator[](nextFree_ - 1) = e; + List::size() = nextFree; + + this->operator[](nextFree - 1) = e; } template inline T Foam::DynamicList::remove() { - if (nextFree_ == 0) + if (List::size() == 0) { FatalErrorIn ( - "void Foam::DynamicList::remove()" + "Foam::DynamicList::remove()" ) << "List is empty" << abort(FatalError); } - return List::operator[](--nextFree_); + label nextFree = List::size()-1; + + const T& val = List::operator[](nextFree); + + List::size() = nextFree; + + return val; } @@ -203,20 +226,22 @@ inline T& Foam::DynamicList::operator() const label i ) { - nextFree_ = max(nextFree_, i + 1); + label nextFree = List::size(); - if (nextFree_ > List::size()) + nextFree = max(nextFree, i + 1); + + if (nextFree > allocSize_) { - List::setSize + allocSize_ = max ( - max - ( - nextFree_, - label(SizeMult*List::size()/SizeDiv + SizeInc) - ) + nextFree, + label(SizeMult*allocSize_/SizeDiv + SizeInc) ); + List::setSize(allocSize_); } + List::size() = nextFree; + return this->operator[](i); } @@ -228,7 +253,7 @@ inline void Foam::DynamicList::operator= ) { List::operator=(t); - nextFree_ = List::size(); + allocSize_ = List::size(); } @@ -239,7 +264,7 @@ inline void Foam::DynamicList::operator= ) { List::operator=(l); - nextFree_ = l.size(); + allocSize_ = List::size(); } diff --git a/src/OpenFOAM/containers/Lists/List/List.C b/src/OpenFOAM/containers/Lists/List/List.C index 249d1fcf2b..a599490781 100644 --- a/src/OpenFOAM/containers/Lists/List/List.C +++ b/src/OpenFOAM/containers/Lists/List/List.C @@ -38,14 +38,11 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // // Construct with length specified template -List::List(const label s) +Foam::List::List(const label s) : UList(NULL, s) { @@ -69,7 +66,7 @@ List::List(const label s) // Construct with length and single value specified template -List::List(const label s, const T& a) +Foam::List::List(const label s, const T& a) : UList(NULL, s) { @@ -98,7 +95,7 @@ List::List(const label s, const T& a) // Construct as copy template -List::List(const List& a) +Foam::List::List(const List& a) : UList(NULL, a.size_) { @@ -130,7 +127,7 @@ List::List(const List& a) // Construct as copy or re-use as specified. template -List::List(List& a, bool reUse) +Foam::List::List(List& a, bool reUse) : UList(NULL, a.size_) { @@ -166,10 +163,10 @@ List::List(List& a, bool reUse) } -// Construct given size and start and end iterators. +// Construct given start and end iterators. template template -List::List(InputIterator first, InputIterator last) +Foam::List::List(InputIterator first, InputIterator last) { label s = 0; for @@ -200,8 +197,8 @@ List::List(InputIterator first, InputIterator last) // Construct as copy of FixedList template -template