CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   LiencubiclowRemodel (http://www.cfd-online.com/Forums/openfoam-bugs/62546-liencubiclowremodel.html)

nzy102 August 23, 2007 23:16

Hi, there: I think I found
 
Hi, there:

I think I found a bug in liencubiclowRe model c file. The definition of nonlinearstress is as follows:

#################################################

nonlinearStress
(
"nonlinearStress",
symm
(
// quadratic terms
pow(k_, 3.0)/sqr(epsilon_)*
(
Ctau1/fEta*
(
(gradU & gradU)
+ (gradU & gradU)().T()
)
+ Ctau2/fEta*(gradU & gradU.T())
+ Ctau3/fEta*(gradU.T() & gradU)
)
// cubic term C4
- 20.0*pow(k_, 4.0)/pow(epsilon_, 3.0)*
pow(Cmu, 3.0)*
(
((gradU & gradU) & gradU.T())
+ ((gradU & gradU.T()) & gradU.T())
- ((gradU.T() & gradU) & gradU)
- ((gradU.T() & gradU.T()) & gradU)
)
// cubic term C5, explicit part
+ min
(
C5viscosity,
dimensionedScalar("0", C5viscosity.dimensions(), 0.0)
)*gradU
)
)
#################################################

here is the definitio of the Reynolds Stress:

#################################################

tmp<volsymmtensorfield> LienCubicKELowRe::R() const
{
return tmp<volsymmtensorfield>
(
new volSymmTensorField
(
IOobject
(
"R",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU) + nonlinearStress,
k_.boundaryField().types()
)
);
}
###############################################

I think the correct definition should be:
((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU) + nonlinearStress*fmu

where fmu is the damping function.

Reference:

Lien, F.S., Chen, W.L., Leschziner, M.A., 1996. Low-Reynolds-number eddy-viscosity modeling based on non-linear stress-strain/vorticity relations. Engineering Turbulence Modelling and Experiments 3 (Edited by Rodi, W. and Bergeles, G.), 91-100. Elsevier Science Publishers.

Etemad, S., et al., 2006. Turbulent flow and heat transfer in a square-sectioned U bend. Progress in compuational fluid dynamics 6, 89-100.

henry August 24, 2007 03:21

Do you think the nonlinearStre
 
Do you think the nonlinearStress should also be multiplied by fMu in the other terms i.e. in LienCubicKELowRe::divR and G? If so it could simply be multiplied by fMu when it is calculated at the bottom of LienCubicKELowRe::correct().

nzy102 August 28, 2007 20:10

Hi Henry: Thank you for you
 
Hi Henry:

Thank you for your help. There are several places I have to make changes. I modified nonlinearstress, fmu, nut, epsEqn, and lienleschzinerlowReSetWallDissipatoin.H file.

Then I compiled the new lienleschzinerLowRe with the following make/files:

turbulenceModel/turbulenceModel.C
turbulenceModel/newTurbulenceModel.C
laminar/laminar.C
LienCubicKELowRe/LienCubicKELowRe.C
wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField .C
wallFunctions/nutWallFunctions/nutStandardWallFunction/nutStandardWallFunctionFv PatchScalarField.C
wallFunctions/nutWallFunctions/nutStandardRoughWallFunction/nutStandardRoughWall FunctionFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libincompressibleTurbulenceModels

It turns out that I got errors as follows:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%
: undefined reference to `Foam::fvPatchField<double>::dictionaryConstructor TablePtr_'
Make/linux64GccDPOpt/nutWallFunctionFvPatchScalarField.o(.text+0x1): In function `__tcf_4':
: undefined reference to `Foam::fvPatchField<double>::destroydictionaryCons tructorTables()'
Make/linux64GccDPOpt/nutWallFunctionFvPatchScalarField.o(.text+0x11): In function `__tcf_3':
: undefined reference to `Foam::fvPatchField<double>::destroypatchMapperCon structorTables()'
Make/linux64GccDPOpt/nutWallFunctionFvPatchScalarField.o(.text+0x21): In function `__tcf_2':
: undefined reference to `Foam::fvPatchField<double>::destroypatchConstruct orTables()'
Make/linux64GccDPOpt/nutWallFunctionFvPatchScalarField.o(.text._ZNK4Foa m22fixedV alueFvPatchFieldIdE4typeEv[Foam::fixedValueFvPatchField<double>::type() const]+0x3): In function `Foam::fixedValueFvPatchField<double>::type() const':
: undefined reference to `Foam::fixedValueFvPatchField<double>::typeName'
Make/linux64GccDPOpt/nutWallFunctionFvPatchScalarField.o(.text._ZNK4Foa m22fixedV alueFvPatchFieldIdE22gradientBoundaryCoeffsEv[Foam::fixedValueFvPatchField<doubl e>::gradientBoundaryCoeffs() const]+0x19): In function `Foam::fixedValueFvPatchField<double>::gradientBou ndaryCoeffs() const':
: undefined reference to `Foam::fvPatch::deltaCoeffs() const'
Make/linux64GccDPOpt/nutWallFunctionFvPatchScalarField.o(.text._ZNK4Foa m22fixedV alueFvPatchFieldIdE22gradientInternalCoeffsEv[Foam::fixedValueFvPatchField<doubl e>::gradientInternalCoeffs() const]+0xd): In function `Foam::fixedValueFvPatchField<double>::gradientInt ernalCoeffs() const':
: undefined reference to `Foam::fvPatch::deltaCoeffs() const'
Make/linux64GccDPOpt/nutWallFunctionFvPatchScalarField.o(.text._ZNK4Foa m14object Registry12lookupObjectINS_14GeometricFieldIdNS_12f vPatchFieldENS_7volMeshEEEEERK T_RKNS_4wordE[Foam::GeometricField<double,> const& Foam::objectRegistry::lookupObject<foam::geometric field<double,> >(Foam::word const&) const]+0x125): In function `Foam::GeometricField<double,> const& Foam::objectRegistry::lookupObject<foam::geometric field<double,> >(Foam::word const&) const':
: undefined reference to `Foam::GeometricField<double,>::typeName'
Make/linux64GccDPOpt/nutWallFunctionFvPatchScalarField.o(.text._ZNK4Foa m14object Registry12lookupObjectINS_14GeometricFieldIdNS_12f vPatchFieldENS_7volMeshEEEEERK T_RKNS_4wordE[Foam::GeometricField<double,> const& Foam::objectRegistry::lookupObject<foam::geometric field<double,> >(Foam::word const&) const]+0x290): In function `Foam::GeometricField<double,> const& Foam::objectRegistry::lookupObject<foam::geometric field<double,> >(Foam::word const&) const':
: undefined reference to `Foam::GeometricField<double,>::typeName'
Make/linux64GccDPOpt/nutWallFunctionFvPatchScalarField.o(.text._ZNK4Foa m14object Registry12lookupObjectINS_14GeometricFieldINS_6Vec torIdEENS_12fvPatchFieldENS_7v olMeshEEEEERKT_RKNS_4wordE[Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<foam::geometric field<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const]+0x125): In function `Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<foam::geometric field<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const':
: undefined reference to `Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh>::typeName'
Make/linux64GccDPOpt/nutWallFunctionFvPatchScalarField.o(.text._ZNK4Foa m14object Registry12lookupObjectINS_14GeometricFieldINS_6Vec torIdEENS_12fvPatchFieldENS_7v olMeshEEEEERKT_RKNS_4wordE[Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<foam::geometric field<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const]+0x290): In function `Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<foam::geometric field<foam::vector<double>, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const':
: undefined reference to `Foam::GeometricField<foam::vector<double>, Foam::fvPatchField, Foam::volMesh>::typeName'
Make/linux64GccDPOpt/nutStandardWallFunctionFvPatchScalarField.o(.text+ 0x6bc): In function `Foam::turbulenceModels::nutStandardWallFunctionFv PatchScalarField::evaluate()':
: undefined reference to `Foam::fvPatch::deltaCoeffs() const'
Make/linux64GccDPOpt/nutStandardWallFunctionFvPatchScalarField.o(.text+ 0x18e9): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::constructpatchConstru ctorTables()'
Make/linux64GccDPOpt/nutStandardWallFunctionFvPatchScalarField.o(.text+ 0x1904): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::patchConstructorTable Ptr_'
Make/linux64GccDPOpt/nutStandardWallFunctionFvPatchScalarField.o(.text+ 0x1922): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::constructpatchMapperC onstructorTables()'
Make/linux64GccDPOpt/nutStandardWallFunctionFvPatchScalarField.o(.text+ 0x193d): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::patchMapperConstructo rTablePtr_'
Make/linux64GccDPOpt/nutStandardWallFunctionFvPatchScalarField.o(.text+ 0x195b): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::constructdictionaryCo nstructorTables()'
Make/linux64GccDPOpt/nutStandardWallFunctionFvPatchScalarField.o(.text+ 0x1973): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::dictionaryConstructor TablePtr_'
Make/linux64GccDPOpt/nutStandardWallFunctionFvPatchScalarField.o(.text+ 0x1): In function `__tcf_4':
: undefined reference to `Foam::fvPatchField<double>::destroydictionaryCons tructorTables()'
Make/linux64GccDPOpt/nutStandardWallFunctionFvPatchScalarField.o(.text+ 0x11): In function `__tcf_3':
: undefined reference to `Foam::fvPatchField<double>::destroypatchMapperCon structorTables()'
Make/linux64GccDPOpt/nutStandardWallFunctionFvPatchScalarField.o(.text+ 0x21): In function `__tcf_2':
: undefined reference to `Foam::fvPatchField<double>::destroypatchConstruct orTables()'
Make/linux64GccDPOpt/nutStandardRoughWallFunctionFvPatchScalarField.o(. text+0x7c 9): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::constructpatchConstru ctorTables()'
Make/linux64GccDPOpt/nutStandardRoughWallFunctionFvPatchScalarField.o(. text+0x7e 4): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::patchConstructorTable Ptr_'
Make/linux64GccDPOpt/nutStandardRoughWallFunctionFvPatchScalarField.o(. text+0x80 2): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::constructpatchMapperC onstructorTables()'
Make/linux64GccDPOpt/nutStandardRoughWallFunctionFvPatchScalarField.o(. text+0x81 d): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::patchMapperConstructo rTablePtr_'
Make/linux64GccDPOpt/nutStandardRoughWallFunctionFvPatchScalarField.o(. text+0x83 b): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::constructdictionaryCo nstructorTables()'
Make/linux64GccDPOpt/nutStandardRoughWallFunctionFvPatchScalarField.o(. text+0x85 3): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `Foam::fvPatchField<double>::dictionaryConstructor TablePtr_'
Make/linux64GccDPOpt/nutStandardRoughWallFunctionFvPatchScalarField.o(. text+0x14 3c): In function `Foam::turbulenceModels::nutStandardRoughWallFunct ionFvPatchScalarField::evaluat e()':
: undefined reference to `Foam::fvPatch::deltaCoeffs() const'
Make/linux64GccDPOpt/nutStandardRoughWallFunctionFvPatchScalarField.o(. text+0x1) : In function `__tcf_4':
: undefined reference to `Foam::fvPatchField<double>::destroydictionaryCons tructorTables()'
Make/linux64GccDPOpt/nutStandardRoughWallFunctionFvPatchScalarField.o(. text+0x11 ): In function `__tcf_3':
: undefined reference to `Foam::fvPatchField<double>::destroypatchMapperCon structorTables()'
Make/linux64GccDPOpt/nutStandardRoughWallFunctionFvPatchScalarField.o(. text+0x21 ): In function `__tcf_2':
: undefined reference to `Foam::fvPatchField<double>::destroypatchConstruct orTables()'
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %

The weird thing is I got the same error even when I compiled other available turbulence models in the foam such as KE, LRR, etc.

Do you have any suggestions?

Ning

qtian August 28, 2007 20:49

I had a similar post several d
 
I had a similar post several days ago with no answer yet. I also tried to recompile the turbulence models again without making any change and received similar error message.

Ning, if you happen to solve this problem, could you please share this information with me? thanks a lot.

Quinn

henry August 29, 2007 02:52

Which version of OpenFOAM are
 
Which version of OpenFOAM are you using?
Which compiler are you using?
Have you compiled everything from sources?

nzy102 August 29, 2007 03:48

I am using openfoam 1.4.1. wit
 
I am using openfoam 1.4.1. with Intel c++ compiler. And in the "files" file of "make" folder, I have:

================================================== =
turbulenceModel/turbulenceModel.C
turbulenceModel/newTurbulenceModel.C
laminar/laminar.C
LienCubicKELowRe/LienCubicKELowRe.C
wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField .C
wallFunctions/nutWallFunctions/nutStandardWallFunction/nutStandardWallFunctionFv PatchScalarField.C
wallFunctions/nutWallFunctions/nutStandardRoughWallFunction/nutStandardRoughWall FunctionFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libincompressibleTurbulenceModels
=================================================
everything is compiled under /src/turbulenceModels/incompressible using wmake. I guess my question is if i have to recompile all the other turbulent models. Is there anything else I have to do?

Thanks.

Ning

Ning

henry August 29, 2007 04:38

Did you compile the library us
 
Did you compile the library using wmake libso?

qtian August 29, 2007 09:25

Henry, Thank you so much fo
 
Henry,

Thank you so much for your help. My problem is solved. I did not realize that there is some difference between compiling application and dynamic lib.

nzy102 August 30, 2007 10:02

Henry: It works fine now. T
 
Henry:

It works fine now. Thanks. One more thing: do you know the source paper of liencubiclowRe model in the foam?

Ning

henry August 30, 2007 10:19

It was implemented as part of/
 
It was implemented as part of/following a turbulence model assessment project involving Imperial College. I have an unpublished report containing the details of this and the other non-linear models somewhere which I can dig-up if it is important. I have not checked or even used the model in OpenFOAM and there may be errors in it or it may be that it is a correct implementation of the form published at the time and you are working from more recent documents.

Do you now have a form consistent with the publications you are working from? Can you send details of the changes you have made or better still post the new version?

hjasak August 30, 2007 11:09

I implemented two versions: hi
 
I implemented two versions: high-Re with wall functions and low-Re. Here are the references I've used:

@Article{Lien:CUBICKE,
author = {Lien, F.S. and Leschziner, M.A.},
title = {Modelling 2D separation from a high lift airfoil
with a non-linear eddy viscosity model and second
moment closure},
journal = {Aeronautical Journal},
year = 1995,
pages = {125-144}
}

@InProceedings{Lien:LOWRECUBICKE,
author = {Lien, F.S. and Chen, W.L. and Leschziner, M.A.},
title = {Low-Reynolds-number eddy-viscosity modelling based
on non-linear stress-strain-vorticity relations},
booktitle = {Proc. 3rd Symp. on Engineering Turbulence Modelling
and Measurements},
year = 1996,
address = {Crete, Greece},
month = {May}
}


Enjoy,

Hrv

nzy102 August 30, 2007 15:19

The liencubiclowRe code in the
 
The liencubiclowRe code in the foam is different from lien's paper of Low-Reynolds-number eddy-viscosity modelling based on non-linear stress-strain-vorticity relations. Specifically, the differences are nonlinearstresses, fmu, the transport equation for epsilon, and wall dissipation. I changes the code and am testing the code now. If it works fine, I will post on the forum. One more question though: the definition of nut in the foam liencubiclowRe code is:

nut_ =
Cmu*fMu*sqr(k_)/epsilon_;
C5 term, implicit
+ max
(
C5viscosity,
dimensionedScalar("0", C5viscosity.dimensions(), 0.0)
);

I don't see this expression in lien's papers at all. I think the correct form is

nut_ = Cmu*fMu*sqr(k_)/epsilon_;

Can you explain what is the second term on the right for? Thanks.

Ning

martin September 6, 2007 06:42

Henry, I am interested in t
 
Henry,

I am interested in the report regarding non-linear turbulence models in foam. Is it possible to get one copy?

Thanks in advance,
Martin

hjasak September 6, 2007 06:55

The project was called the Rey
 
The project was called the Reynolds Solver project, sponsored by Audi, BMW, Ford,. Mercedes-Benz, Opel, Porsche and Renault and the European Union. I did a part of my PhD work on this: error estimation, automatic adaptive error-driven mesh refinement and implementation of various turbulence models.

Regarding the document, you will need to worry about confidentiality because the report was never released to the public.

Hrv

salehi144 January 10, 2012 09:53

Reference request for LienCubicKELoeRe model.
 
Hi.

I'm using the LienCubicKELoeRe model in OpenFOAM.
Unfortunatley i couldn't find a reference for this model. the main paper (" Low-Reynolds-number eddy-viscosity modeling based on non-linear stress-strain/vorticity relations ") is not available online (or i couldnt find it).
does anyone have this paper on one similar that has the LienCubicKELoeRe model formulation.

Thanks.


All times are GMT -4. The time now is 23:30.