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
29 Calculates and writes the scalar fields of the six components of the stress
30 tensor sigma for each time.
32 \*---------------------------------------------------------------------------*/
35 #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
36 #include "zeroGradientFvPatchFields.H"
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 int main(int argc, char *argv[])
42 timeSelector::addOptions();
44 # include "setRootCase.H"
45 # include "createTime.H"
47 instantList timeDirs = timeSelector::select0(runTime, args);
49 # include "createMesh.H"
51 forAll(timeDirs, timeI)
53 runTime.setTime(timeDirs[timeI], timeI);
55 Info<< "Time = " << runTime.timeName() << endl;
66 if (Uheader.headerOk())
70 Info<< " Reading U" << endl;
71 volVectorField U(Uheader, mesh);
73 # include "createPhi.H"
75 singlePhaseTransportModel laminarTransport(U, phi);
77 volSymmTensorField sigma
87 laminarTransport.nu()*2*dev(symm(fvc::grad(U)))
91 volScalarField sigmaxx
100 sigma.component(symmTensor::XX)
104 volScalarField sigmayy
113 sigma.component(symmTensor::YY)
117 volScalarField sigmazz
126 sigma.component(symmTensor::ZZ)
130 volScalarField sigmaxy
139 sigma.component(symmTensor::XY)
143 volScalarField sigmaxz
152 sigma.component(symmTensor::XZ)
156 volScalarField sigmayz
165 sigma.component(symmTensor::YZ)
179 zeroGradientFvPatchVectorField::typeName
181 Ub.correctBoundaryConditions();
184 volScalarField sigmaUn
193 0.0*sigma.component(symmTensor::YZ)
196 forAll(sigmaUn.boundaryField(), patchI)
198 sigmaUn.boundaryField()[patchI] =
200 mesh.boundary()[patchI].nf()
201 & sigma.boundaryField()[patchI]
202 )().component(vector::X);
209 Info<< " No U" << endl;
215 Info<< "End" << endl;
221 // ************************************************************************* //