00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "fvCFD.H"
00035 #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
00036 #include "zeroGradientFvPatchFields.H"
00037
00038
00039
00040 int main(int argc, char *argv[])
00041 {
00042 timeSelector::addOptions();
00043
00044 # include "setRootCase.H"
00045 # include "createTime.H"
00046
00047 instantList timeDirs = timeSelector::select0(runTime, args);
00048
00049 # include "createMesh.H"
00050
00051 forAll(timeDirs, timeI)
00052 {
00053 runTime.setTime(timeDirs[timeI], timeI);
00054
00055 Info<< "Time = " << runTime.timeName() << endl;
00056
00057 IOobject Uheader
00058 (
00059 "U",
00060 runTime.timeName(),
00061 mesh,
00062 IOobject::MUST_READ
00063 );
00064
00065
00066 if (Uheader.headerOk())
00067 {
00068 mesh.readUpdate();
00069
00070 Info<< " Reading U" << endl;
00071 volVectorField U(Uheader, mesh);
00072
00073 # include "createPhi.H"
00074
00075 singlePhaseTransportModel laminarTransport(U, phi);
00076
00077 volSymmTensorField sigma
00078 (
00079 IOobject
00080 (
00081 "sigma",
00082 runTime.timeName(),
00083 mesh,
00084 IOobject::NO_READ,
00085 IOobject::AUTO_WRITE
00086 ),
00087 laminarTransport.nu()*2*dev(symm(fvc::grad(U)))
00088 );
00089
00090
00091 volScalarField sigmaxx
00092 (
00093 IOobject
00094 (
00095 "sigmaxx",
00096 runTime.timeName(),
00097 mesh,
00098 IOobject::NO_READ
00099 ),
00100 sigma.component(tensor::XX)
00101 );
00102 sigmaxx.write();
00103
00104 volScalarField sigmayy
00105 (
00106 IOobject
00107 (
00108 "sigmayy",
00109 runTime.timeName(),
00110 mesh,
00111 IOobject::NO_READ
00112 ),
00113 sigma.component(tensor::YY)
00114 );
00115 sigmayy.write();
00116
00117 volScalarField sigmazz
00118 (
00119 IOobject
00120 (
00121 "sigmazz",
00122 runTime.timeName(),
00123 mesh,
00124 IOobject::NO_READ
00125 ),
00126 sigma.component(tensor::ZZ)
00127 );
00128 sigmazz.write();
00129
00130 volScalarField sigmaxy
00131 (
00132 IOobject
00133 (
00134 "sigmaxy",
00135 runTime.timeName(),
00136 mesh,
00137 IOobject::NO_READ
00138 ),
00139 sigma.component(tensor::XY)
00140 );
00141 sigmaxy.write();
00142
00143 volScalarField sigmaxz
00144 (
00145 IOobject
00146 (
00147 "sigmaxz",
00148 runTime.timeName(),
00149 mesh,
00150 IOobject::NO_READ
00151 ),
00152 sigma.component(tensor::XZ)
00153 );
00154 sigmaxz.write();
00155
00156 volScalarField sigmayz
00157 (
00158 IOobject
00159 (
00160 "sigmayz",
00161 runTime.timeName(),
00162 mesh,
00163 IOobject::NO_READ
00164 ),
00165 sigma.component(tensor::YZ)
00166 );
00167 sigmayz.write();
00168
00169 volVectorField Ub
00170 (
00171 IOobject
00172 (
00173 "Ub",
00174 runTime.timeName(),
00175 mesh,
00176 IOobject::NO_READ
00177 ),
00178 U,
00179 zeroGradientFvPatchVectorField::typeName
00180 );
00181 Ub.correctBoundaryConditions();
00182 Ub.write();
00183
00184 volScalarField sigmaUn
00185 (
00186 IOobject
00187 (
00188 "sigmaUn",
00189 runTime.timeName(),
00190 mesh,
00191 IOobject::NO_READ
00192 ),
00193 0.0*sigma.component(tensor::YZ)
00194 );
00195
00196 forAll(sigmaUn.boundaryField(), patchI)
00197 {
00198 sigmaUn.boundaryField()[patchI] =
00199 (
00200 mesh.boundary()[patchI].nf()
00201 & sigma.boundaryField()[patchI]
00202 )().component(vector::X);
00203 }
00204
00205 sigmaUn.write();
00206 }
00207 else
00208 {
00209 Info<< " No U" << endl;
00210 }
00211
00212 Info<< endl;
00213 }
00214
00215 Info<< "End" << endl;
00216
00217 return 0;
00218 }
00219
00220
00221