1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "backwardsCompatibilityWallFunctions.H"
29 #include "OSspecific.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 namespace incompressible
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 template<class Type, class PatchType>
41 tmp<GeometricField<Type, fvPatchField, volMesh> >
42 autoCreateWallFunctionField
44 const word& fieldName,
51 mesh.time().timeName(),
56 typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
58 if (nutHeader.headerOk())
67 mesh.time().timeName(),
79 Info<< "--> Upgrading " << fieldName
80 << " to employ run-time selectable wall functions" << endl;
82 // Read existing field
86 mesh.time().timeName(),
93 tmp<fieldType> fieldOrig
103 Info<< " Backup original " << fieldName << " to "
104 << fieldName << ".old" << endl;
105 mvBak(ioObj.objectPath(), "old");
108 PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size());
110 forAll(newPatchFields, patchI)
112 if (mesh.boundary()[patchI].isWall())
119 mesh.boundary()[patchI],
120 fieldOrig().dimensionedInternalField()
123 newPatchFields[patchI] == fieldOrig().boundaryField()[patchI];
130 fieldOrig().boundaryField()[patchI].clone()
135 tmp<fieldType> fieldNew
142 mesh.time().timeName(),
149 fieldOrig().dimensions(),
150 fieldOrig().internalField(),
155 Info<< " Writing updated " << fieldName << endl;
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace incompressible
166 } // End namespace Foam
168 // ************************************************************************* //