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 #include "cubeRootVolDelta.H"
00027 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00028
00029
00030
00031 namespace Foam
00032 {
00033
00034
00035
00036 defineTypeNameAndDebug(cubeRootVolDelta, 0);
00037 addToRunTimeSelectionTable(LESdelta, cubeRootVolDelta, dictionary);
00038
00039
00040
00041
00042 void cubeRootVolDelta::calcDelta()
00043 {
00044 label nD = mesh().nGeometricD();
00045
00046 if (nD == 3)
00047 {
00048 delta_.internalField() = deltaCoeff_*pow(mesh().V(), 1.0/3.0);
00049 }
00050 else if (nD == 2)
00051 {
00052 WarningIn("cubeRootVolDelta::calcDelta()")
00053 << "Case is 2D, LES is not strictly applicable\n"
00054 << endl;
00055
00056 const Vector<label>& directions = mesh().geometricD();
00057
00058 scalar thickness = 0.0;
00059 for (direction dir=0; dir<directions.nComponents; dir++)
00060 {
00061 if (directions[dir] == -1)
00062 {
00063 thickness = mesh().bounds().span()[dir];
00064 break;
00065 }
00066 }
00067
00068 delta_.internalField() = deltaCoeff_*sqrt(mesh().V()/thickness);
00069 }
00070 else
00071 {
00072 FatalErrorIn("cubeRootVolDelta::calcDelta()")
00073 << "Case is not 3D or 2D, LES is not applicable"
00074 << exit(FatalError);
00075 }
00076 }
00077
00078
00079
00080
00081 cubeRootVolDelta::cubeRootVolDelta
00082 (
00083 const word& name,
00084 const fvMesh& mesh,
00085 const dictionary& dd
00086 )
00087 :
00088 LESdelta(name, mesh),
00089 deltaCoeff_(readScalar(dd.subDict(type() + "Coeffs").lookup("deltaCoeff")))
00090 {
00091 calcDelta();
00092 }
00093
00094
00095
00096
00097 void cubeRootVolDelta::read(const dictionary& dd)
00098 {
00099 dd.subDict(type() + "Coeffs").lookup("deltaCoeff") >> deltaCoeff_;
00100 calcDelta();
00101 }
00102
00103
00104 void cubeRootVolDelta::correct()
00105 {
00106 if (mesh_.changing())
00107 {
00108 calcDelta();
00109 }
00110 }
00111
00112
00113
00114
00115 }
00116
00117