boundaryFoam.C
Go to the documentation of this file.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
00035
00036
00037
00038
00039 #include "fvCFD.H"
00040 #include "singlePhaseTransportModel.H"
00041 #include "RASModel.H"
00042 #include "wallFvPatch.H"
00043 #include "makeGraph.H"
00044
00045
00046
00047
00048 int main(int argc, char *argv[])
00049 {
00050 #include "setRootCase.H"
00051
00052 #include "createTime.H"
00053 #include "createMesh.H"
00054 #include "createFields.H"
00055
00056
00057
00058 Info<< "\nStarting time loop\n" << endl;
00059
00060 while (runTime.loop())
00061 {
00062 Info<< "Time = " << runTime.timeName() << nl << endl;
00063
00064 fvVectorMatrix divR = turbulence->divDevReff(U);
00065 divR.source() = flowMask & divR.source();
00066
00067 fvVectorMatrix UEqn
00068 (
00069 divR == gradP
00070 );
00071
00072 UEqn.relax();
00073
00074 UEqn.solve();
00075
00076
00077
00078
00079 dimensionedVector UbarStar = flowMask & U.weightedAverage(mesh.V());
00080
00081 U += (Ubar - UbarStar);
00082 gradP += (Ubar - UbarStar)/(1.0/UEqn.A())().weightedAverage(mesh.V());
00083
00084 label id = y.size() - 1;
00085
00086 scalar wallShearStress =
00087 flowDirection & turbulence->R()()[id] & wallNormal;
00088
00089 scalar yplusWall
00090
00091 = ::sqrt(mag(wallShearStress))*y[id]/turbulence->nuEff()()[id];
00092
00093 Info<< "Uncorrected Ubar = " << (flowDirection & UbarStar.value())<< tab
00094 << "pressure gradient = " << (flowDirection & gradP.value()) << tab
00095 << "min y+ = " << yplusWall << endl;
00096
00097
00098 turbulence->correct();
00099
00100
00101 if (runTime.outputTime())
00102 {
00103 volSymmTensorField R
00104 (
00105 IOobject
00106 (
00107 "R",
00108 runTime.timeName(),
00109 mesh,
00110 IOobject::NO_READ,
00111 IOobject::AUTO_WRITE
00112 ),
00113 turbulence->R()
00114 );
00115
00116 runTime.write();
00117
00118 const word& gFormat = runTime.graphFormat();
00119
00120 makeGraph(y, flowDirection & U, "Uf", gFormat);
00121
00122 makeGraph(y, laminarTransport.nu(), gFormat);
00123
00124 makeGraph(y, turbulence->k(), gFormat);
00125 makeGraph(y, turbulence->epsilon(), gFormat);
00126
00127
00128
00129
00130
00131
00132
00133
00134 makeGraph(y, R.component(tensor::XY), "uv", gFormat);
00135
00136 makeGraph(y, mag(fvc::grad(U)), "gammaDot", gFormat);
00137 }
00138
00139 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
00140 << " ClockTime = " << runTime.elapsedClockTime() << " s"
00141 << nl << endl;
00142 }
00143
00144 Info<< "End\n" << endl;
00145
00146 return 0;
00147 }
00148
00149
00150
Copyright © 2000-2009 OpenCFD Ltd