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