CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Bugs in LES filter codes (https://www.cfd-online.com/Forums/openfoam-bugs/62501-bugs-les-filter-codes.html)

 yekaniyasari February 17, 2008 04:12

Bug in LES Filter Codes: Desc

Bug in LES Filter Codes:
Description:
1-The problem is about the laplace filter and anisotropic filter:
with running a case in LES solvers (oodles, channelOodles &hellip;) and using "laplace" filter or "anisotropic" filter with "dynamic or mix models" an error about laplace or anisotropic filtercoeffs occurred .for solving this problem we should add the following line in "turbulenceproperties" file in "constant" directory of relevant case.
For example:

mixedSmagorinskyCoeffs
{
ce ce [0 0 0 0 0 0 0] 1.05;
ck ck [0 0 0 0 0 0 0] 0.07;
filter anisotropic;
anisotropicCoeffs
{
widthCoeff 24; or 6 (for box or Gaussian filter)
}
}

2.The second problem was seen about definition of "widthcoeff" vector in "anisotropicfilter.C" file that was placed in"/src/lesmodel/lesfilter" .
In order to modify this problem, instead of the statement below:
"
for (direction d=0; d<vector::nComponents; d++)
{
coeff_.internalField().replace
(
d,
(2.0/widthCoeff_)*mesh.V()
/fvc::surfaceSum(mag(mesh.Sf().component(d)))().int ernalField()
);
}
"
We should use the following code:
"
for (direction d=0; d<vector::nComponents; d++)
{
coeff_.internalField().replace
(
d,
(4.0/widthCoeff_)*(mesh.V()/fvc::surfaceSum(mag(mesh.Sf().component(d)))().int ernalField())*(mesh.V()/fvc::surfaceSum(mag(mesh.Sf().component(d)))().int ernalField())
);
}
"
3. The third one , was about dimension problem : in "anisotropicfilter.C" file , in definition of filtration for tensor field , with substituting this part of code :
tmp<voltensorfield> tmpFilteredField
(
new volTensorField
(
IOobject
(
"anisotropicFilteredTensorField",
mesh().time().timeName(),
mesh(),
IOobject::AUTO_WRITE
),
mesh(),
dimLength
)
);

With this form :
tmp<voltensorfield> tmpFilteredField
(
new volTensorField
(
IOobject
(
"anisotropicFilteredTensorField",
mesh().time().timeName(),
mesh(),
IOobject::AUTO_WRITE
),
mesh(),
dimLength*dimLength/(dimTime*dimTime)
)
);

the problem is solved.

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif anisotropicFilter.C

Testcase:
All case for example: channel395

Version:
OpenFOAM version 1.3

 yekaniyasari February 17, 2008 04:41

in number 2 change " "widthcoe

in number 2 change " "widthcoeff" vector " to " "coeff_" vector "

 henry February 17, 2008 07:10

I think it would be better to

I think it would be better to use unFilteredField().dimensions() rather than hard-coding dimLength*dimLength/(dimTime*dimTime) as the dimensions of the tensor field resulting from the filtering of given field.

Henry

 yekaniyasari February 18, 2008 02:59

Dr Henry Weller, Thanks for

Dr Henry Weller,