1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
28 Calculates and writes the scalar fields of the six components of the stress
29 tensor sigma for each time.
31 \*---------------------------------------------------------------------------*/
34 #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
35 #include "zeroGradientFvPatchFields.H"
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 int main(int argc, char *argv[])
41 timeSelector::addOptions();
43 # include "setRootCase.H"
44 # include "createTime.H"
46 instantList timeDirs = timeSelector::select0(runTime, args);
48 # include "createMesh.H"
50 forAll(timeDirs, timeI)
52 runTime.setTime(timeDirs[timeI], timeI);
54 Info<< "Time = " << runTime.timeName() << endl;
65 if (Uheader.headerOk())
69 Info<< " Reading U" << endl;
70 volVectorField U(Uheader, mesh);
72 # include "createPhi.H"
74 singlePhaseTransportModel laminarTransport(U, phi);
76 volSymmTensorField sigma
86 laminarTransport.nu()*2*dev(symm(fvc::grad(U)))
90 volScalarField sigmaxx
99 sigma.component(symmTensor::XX)
103 volScalarField sigmayy
112 sigma.component(symmTensor::YY)
116 volScalarField sigmazz
125 sigma.component(symmTensor::ZZ)
129 volScalarField sigmaxy
138 sigma.component(symmTensor::XY)
142 volScalarField sigmaxz
151 sigma.component(symmTensor::XZ)
155 volScalarField sigmayz
164 sigma.component(symmTensor::YZ)
178 zeroGradientFvPatchVectorField::typeName
180 Ub.correctBoundaryConditions();
183 volScalarField sigmaUn
192 0.0*sigma.component(symmTensor::YZ)
195 forAll(sigmaUn.boundaryField(), patchI)
197 sigmaUn.boundaryField()[patchI] =
199 mesh.boundary()[patchI].nf()
200 & sigma.boundaryField()[patchI]
201 )().component(vector::X);
208 Info<< " No U" << endl;
214 Info<< "End" << endl;
220 // ************************************************************************* //