|
[Sponsors] |
OpenFOAM - Implement Change To Modelled Term Reynolds Stress Models (LRR & SSG) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 2, 2024, 15:33 |
OpenFOAM - Implement Change To Modelled Term Reynolds Stress Models (LRR & SSG)
|
#1 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
Hi,
I am a PhD researcher based at the University of Leeds. I want to implement a change to the Reynolds Stress models in OpenFOAM (LRR & SSG). One of the terms modelled in the LRR and SSG model (turbulent diffusive transport) is based on the generalised gradient diffusion model of Daly & Harlow (1970). Using this approach leads to numerical instabilities and robustness issues in solution. Instead what I want to do is use the simplified gradient diffusion model of Shir (1973). This model is what is implemented in commerical CFD codes such as FLUENT and can improve solution robustness and accuracy. However, I am really struggling to implement such a model as I am more of an OpenFOAM user with 0 experience in modifying. Is there an expert out there who has experience in performing such procedures. I would greatly appreciate either being mentored or if they have done something similar to this, if they could share how exactly they did it? |
|
February 5, 2024, 10:13 |
|
#2 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 748
Rep Power: 14 |
To be honest, your question is far too open ... this explains why you haven't had any reply thus far. You'll find much more engagement if you can narrow it down to a specific question on a particular point.
Some thoughts from my side: 1. Learn how to implement a clone of the LRR model say, creating a myLRR model in your USERLIB library. Google a bit, and you will find some how-to guides (e.g. "chalmers openfoam new turbulence model" threw up a bunch of stuff for me - beware, some of it will be out of date since the coding around turbulence modelling has changed over the OF versions). 2. Once you have step 1 sorted, then start making the changes. Looking at LRR.C, the line you are interested in is: Code:
fvm::laplacian(alpha*rho*DREff(), R) In the end, the path to enlightenment in OpenFOAM is a painful one that requires a chunk of effort on your part - there's a LOT to take in. Luckily you're a PhD student, so have plenty of time! Good luck, and come back when you get stuck. |
|
February 5, 2024, 15:04 |
|
#3 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
Hi,
Thanks for the reply and advice. I realised that touching the CFD source code is a skill that I am lacking and it will be extremely useful to bridge this gap. My experience with OpenFOAM is largely front-end as I transferred skills from using FLUENT (running stirred tank reactor simulations, single phase & multi phase with steady state and transient solvers using two-equation turbulence models for both softwares without issue). This is the first time I've noticed OpenFOAM & FLUENT have a difference in implementation which took a bit of reading around. I am planning to do one of the training programs for cpp programming in OpenFOAM offered by OpenFOAM.org (I'm using OpenFOAM-9). I have one question though regarding lines 244-255. I assume this is where the turbulent diffusivity equation has been defined? But I notice the terms look different to Daly & Harlow (equation 1 from original JPEG) and don't exactly match template<class BasicTurbulenceModel> tmp<volSymmTensorField> LRR<BasicTurbulenceModel>:REff() const { return tmp<volSymmTensorField> ( new volSymmTensorField ( "DREff", (Cs_*(this->k_/this->epsilon_))*this->R_ + I*this->nu() ) ); } |
|
February 5, 2024, 15:15 |
|
#4 |
Senior Member
|
@sr786: congrats for picking up ideas so fast. The term this->nu() is a laminar contribution that is typically small, and therefore neglected.
@tobermory: I will steal you "paths of enlightment" expression, he he. Thank you for providing your ever short, concise and to the point answers. Much appreciated. |
|
February 10, 2024, 06:34 |
|
#5 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
Hi,
I've been thinking more about it The two main lines of code are 1: Code:
template<class BasicTurbulenceModel> tmp<volSymmTensorField> LRR<BasicTurbulenceModel>: DREff() const { return tmp<volSymmTensorField> ( new volSymmTensorField ( "DREff", (Cs_*(this->k_/this->epsilon_))*this->R_ + I*this->nu() ) ); } 2. Code:
fvm::laplacian(alpha*rho*DREff(), R) 3: Code:
template<class BasicTurbulenceModel> tmp<volSymmTensorField> LRR<BasicTurbulenceModel>:DREff() const { return tmp<volSymmTensorField> ( new volSymmTensorField ( "DREff", (this->nut_/sigmak_)+ I*this->nu() ) ); } Code:
template<class BasicMomentumTransportModel> void LRR<BasicMomentumTransportModel>::correctNut() { this->nut_ = this->Cmu_*sqr(k_)/epsilon_; this->nut_.correctBoundaryConditions(); fvConstraints::New(this->mesh_).constrain(this->nut_); } Last edited by sr786; February 10, 2024 at 08:53. |
|
February 10, 2024, 06:58 |
|
#6 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
So in essence all I need to do is re-define DREff() which I don't believe is complicated as it involves arithmetic operators to manipulate the equation and introduce a new constant term sigmak_ and remove Cs_ (provided I don't need to define nut).
This is all in the .C file. Do I need to make a complementary change to the .H file if I am introducing a new constant term and removing an old constant term? |
|
February 10, 2024, 08:04 |
|
#7 | |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 748
Rep Power: 14 |
Quote:
|
||
February 10, 2024, 08:50 |
|
#8 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
Hi,
No worries so the header file is irrelevant regardless if I add a new constant to the .C file. I ask because the header file has all the constants from the .C file. Code:
protected: // Protected data // Model coefficients dimensionedScalar Cmu_; dimensionedScalar C1_; dimensionedScalar C1s_; dimensionedScalar C2_; dimensionedScalar C3_; dimensionedScalar C3s_; dimensionedScalar C4_; dimensionedScalar C5_; dimensionedScalar Ceps1_; dimensionedScalar Ceps2_; dimensionedScalar Cs_; dimensionedScalar Ceps_; // Fields volScalarField k_; volScalarField epsilon_; |
|
February 10, 2024, 09:38 |
|
#9 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 748
Rep Power: 14 |
No - it's not that the .H file is irrelevant (far from it), it's just that if you are just changing some of the terms inside the DREff function, without changing the parameters of the function, then the DREff entry in the .H file
Code:
//- Return the effective diffusivity for R tmp<volSymmTensorField> DREff() const; |
|
February 10, 2024, 09:51 |
|
#10 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
Ah okay I see so it will recognise that a new term has been added (nut/sigmak) in my case. What about the model coefficients in the .H file surely do I not add a
dimensionedScalar sigmak_ 0.82; |
|
February 11, 2024, 08:30 |
|
#11 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
Hi,
If I implement the change below I'm wondering if defining this class as symmetrictensor would still be valid as nut and sigmak_ are scalars? Code:
template<class BasicTurbulenceModel> tmp<volSymmTensorField> LRR<BasicTurbulenceModel>:DREff() const { return tmp<volSymmTensorField> ( new volSymmTensorField ( "DREff", (this->nut_/sigmak_)+ I*this->nu() ) ); } Code:
//- Return the effective diffusivity for k tmp<volScalarField> DkEff() const { return tmp<volScalarField> ( new volScalarField ( "DkEff", (this->nut_/sigmak_ + this->nu()) ) ); } |
|
February 11, 2024, 09:04 |
|
#12 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
Yes because I've removed the Reynolds Stress Tensor, R(), from DREff, for the first term. The second term contains an Identity Tensor, I.
So if I try my original implementation of Code:
template<class BasicTurbulenceModel> tmp<volSymmTensorField> LRR<BasicTurbulenceModel>:DREff() const { return tmp<volSymmTensorField> ( new volSymmTensorField ( "DREff", (this->nut_/sigmak_)+ I*this->nu() ) ); } Should I just make DREff() a scalar, i.e., remove I from second term, or leave it as a tensor but multiply first term by I (same as second term)? |
|
February 12, 2024, 09:33 |
|
#13 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
Hi I have attempted to start off by just compiling a new turbulence model for OpenFOAM-9 based on online resources. I tried using the kOmega tutorials first and was able to compile a new turbulence model.
I am now attempting to compile a new turbulence model for SSG, called simpleSSG. This is without making any modifications to base code barring changing the callsign to simpleSSG. I am getting the following error: Code:
wmake libso . wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file mykinematicMomentumTransportModels.C g++ -std=c++14 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/incompressible/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/transportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/finiteVolume/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/meshTools/lnInclude -IlnInclude -I. -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OpenFOAM/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OSspecific/POSIX/lnInclude -fPIC -c mykinematicMomentumTransportModels.C -o Make/linux64GccDPInt32Opt/mykinematicMomentumTransportModels.o In file included from simpleSSG.H:210:0, from mykinematicMomentumTransportModels.C:47: simpleSSG.C: In instantiation of ‘Foam::RASModels::simpleSSG<BasicMomentumTransportModel>::simpleSSG(const alphaField&, const rhoField&, const volVectorField&, const surfaceScalarField&, const surfaceScalarField&, const transportModel&, const Foam::word&) [with BasicMomentumTransportModel = Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel>; Foam::RASModels::simpleSSG<BasicMomentumTransportModel>::alphaField = Foam::geometricOneField; Foam::RASModels::simpleSSG<BasicMomentumTransportModel>::rhoField = Foam::geometricOneField; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>; Foam::RASModels::simpleSSG<BasicMomentumTransportModel>::transportModel = Foam::kinematicTransportModel]’: /home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/momentumTransportModels/lnInclude/RASModel.H:100:9: required from ‘static Foam::autoPtr<Foam::RASModel<BasicMomentumTransportModel> > Foam::RASModel<BasicMomentumTransportModel>::adddictionaryConstructorToTable<RASModelType>::New(const alphaField&, const rhoField&, const volVectorField&, const surfaceScalarField&, const surfaceScalarField&, const transportModel&) [with RASModelType = Foam::RASModels::simpleSSG<Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel> >; BasicMomentumTransportModel = Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel>; Foam::RASModel<BasicMomentumTransportModel>::alphaField = Foam::geometricOneField; Foam::RASModel<BasicMomentumTransportModel>::rhoField = Foam::geometricOneField; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>; Foam::RASModel<BasicMomentumTransportModel>::transportModel = Foam::kinematicTransportModel]’ /home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/momentumTransportModels/lnInclude/RASModel.H:100:9: required from ‘Foam::RASModel<BasicMomentumTransportModel>::adddictionaryConstructorToTable<RASModelType>::adddictionaryConstructorToTable(const Foam::word&) [with RASModelType = Foam::RASModels::simpleSSG<Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel> >; BasicMomentumTransportModel = Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel>]’ mykinematicMomentumTransportModels.C:48:1: required from here simpleSSG.C:228:14: error: ‘bound’ was not declared in this scope bound(epsilon_, this->epsilonMin_); ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ simpleSSG.C:228:14: note: suggested alternative: ‘found’ bound(epsilon_, this->epsilonMin_); ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ found simpleSSG.C: In instantiation of ‘void Foam::RASModels::simpleSSG<BasicMomentumTransportModel>::correct() [with BasicMomentumTransportModel = Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel>]’: mykinematicMomentumTransportModels.C:48:24: required from here simpleSSG.C:335:10: error: ‘bound’ was not declared in this scope bound(epsilon_, this->epsilonMin_); ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ simpleSSG.C:335:10: note: suggested alternative: ‘found’ bound(epsilon_, this->epsilonMin_); ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ found make: *** [/home/cfd/OpenFOAM/OpenFOAM-9/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/mykinematicMomentumTransportModels.o] Error 1 |
|
February 12, 2024, 10:13 |
|
#14 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 748
Rep Power: 14 |
Sounds like you are missing a header file (?) or library (libfiniteVolume.so) from your make command, maybe?
|
|
February 12, 2024, 11:31 |
|
#15 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
Hi,
This is my set up in files Code:
mykinematicMomentumTransportModels.C LIB = $(FOAM_LIBBIN)/mykinematicMomentumTransportModels Code:
EXE_INC = \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ LIB_LIBS = \ -ltransportModels \ -lmomentumTransportModels \ -lfiniteVolume \ -lmeshTools |
|
February 12, 2024, 15:10 |
|
#16 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
I have compiled two turbulence models "mykOmega" and "mykEpsilon" using the exact same method and there were no issues:
mykEpsilon Code:
wmake libso . wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file mykinematicMomentumTransportModels.C g++ -std=c++14 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/incompressible/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/transportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/finiteVolume/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/meshTools/lnInclude -IlnInclude -I. -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OpenFOAM/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OSspecific/POSIX/lnInclude -fPIC -c mykinematicMomentumTransportModels.C -o Make/linux64GccDPInt32Opt/mykinematicMomentumTransportModels.o g++ -std=c++14 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/incompressible/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/transportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/finiteVolume/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/meshTools/lnInclude -IlnInclude -I. -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OpenFOAM/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OSspecific/POSIX/lnInclude -fPIC -fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/mykinematicMomentumTransportModels.o -L/home/cfd/OpenFOAM/OpenFOAM-9/platforms/linux64GccDPInt32Opt/lib \ -ltransportModels -lmomentumTransportModels -lfiniteVolume -lmeshTools -o /home/cfd/OpenFOAM/OpenFOAM-9/platforms/linux64GccDPInt32Opt/lib/mykinematicMomentumTransportModels.so Code:
wmake libso . wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file mykinematicMomentumTransportModels.C g++ -std=c++14 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/incompressible/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/transportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/finiteVolume/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/meshTools/lnInclude -IlnInclude -I. -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OpenFOAM/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OSspecific/POSIX/lnInclude -fPIC -c mykinematicMomentumTransportModels.C -o Make/linux64GccDPInt32Opt/mykinematicMomentumTransportModels.o g++ -std=c++14 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/incompressible/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/transportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/finiteVolume/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/meshTools/lnInclude -IlnInclude -I. -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OpenFOAM/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OSspecific/POSIX/lnInclude -fPIC -fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/mykinematicMomentumTransportModels.o -L/home/cfd/OpenFOAM/OpenFOAM-9/platforms/linux64GccDPInt32Opt/lib \ -ltransportModels -lmomentumTransportModels -lfiniteVolume -lmeshTools -o /home/cfd/OpenFOAM/OpenFOAM-9/platforms/linux64GccDPInt32Opt/lib/mykinematicMomentumTransportModels.so Code:
wmake libso . wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file mykinematicMomentumTransportModels.C g++ -std=c++14 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/incompressible/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/transportModels/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/finiteVolume/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/meshTools/lnInclude -IlnInclude -I. -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OpenFOAM/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-9/src/OSspecific/POSIX/lnInclude -fPIC -c mykinematicMomentumTransportModels.C -o Make/linux64GccDPInt32Opt/mykinematicMomentumTransportModels.o In file included from myLRR.H:219:0, from mykinematicMomentumTransportModels.C:49: myLRR.C: In instantiation of ‘Foam::RASModels::myLRR<BasicMomentumTransportModel>::myLRR(const alphaField&, const rhoField&, const volVectorField&, const surfaceScalarField&, const surfaceScalarField&, const transportModel&, const Foam::word&) [with BasicMomentumTransportModel = Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel>; Foam::RASModels::myLRR<BasicMomentumTransportModel>::alphaField = Foam::geometricOneField; Foam::RASModels::myLRR<BasicMomentumTransportModel>::rhoField = Foam::geometricOneField; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>; Foam::RASModels::myLRR<BasicMomentumTransportModel>::transportModel = Foam::kinematicTransportModel]’: /home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/momentumTransportModels/lnInclude/RASModel.H:100:9: required from ‘static Foam::autoPtr<Foam::RASModel<BasicMomentumTransportModel> > Foam::RASModel<BasicMomentumTransportModel>::adddictionaryConstructorToTable<RASModelType>::New(const alphaField&, const rhoField&, const volVectorField&, const surfaceScalarField&, const surfaceScalarField&, const transportModel&) [with RASModelType = Foam::RASModels::myLRR<Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel> >; BasicMomentumTransportModel = Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel>; Foam::RASModel<BasicMomentumTransportModel>::alphaField = Foam::geometricOneField; Foam::RASModel<BasicMomentumTransportModel>::rhoField = Foam::geometricOneField; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>; Foam::RASModel<BasicMomentumTransportModel>::transportModel = Foam::kinematicTransportModel]’ /home/cfd/OpenFOAM/OpenFOAM-9/src/MomentumTransportModels/momentumTransportModels/lnInclude/RASModel.H:100:9: required from ‘Foam::RASModel<BasicMomentumTransportModel>::adddictionaryConstructorToTable<RASModelType>::adddictionaryConstructorToTable(const Foam::word&) [with RASModelType = Foam::RASModels::myLRR<Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel> >; BasicMomentumTransportModel = Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel>]’ mykinematicMomentumTransportModels.C:50:1: required from here myLRR.C:219:14: error: ‘bound’ was not declared in this scope bound(epsilon_, this->epsilonMin_); ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ myLRR.C:219:14: note: suggested alternative: ‘found’ bound(epsilon_, this->epsilonMin_); ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ found myLRR.C: In instantiation of ‘void Foam::RASModels::myLRR<BasicMomentumTransportModel>::correct() [with BasicMomentumTransportModel = Foam::IncompressibleMomentumTransportModel<Foam::kinematicTransportModel>]’: mykinematicMomentumTransportModels.C:50:20: required from here myLRR.C:325:10: error: ‘bound’ was not declared in this scope bound(epsilon_, this->epsilonMin_); ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ myLRR.C:325:10: note: suggested alternative: ‘found’ bound(epsilon_, this->epsilonMin_); ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ found make: *** [/home/cfd/OpenFOAM/OpenFOAM-9/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/mykinematicMomentumTransportModels.o] Error 1 |
|
February 14, 2024, 04:11 |
|
#17 |
Senior Member
|
Are you sure that mykEpsilon.C and mykOmegas.C are compiled?
Rephrased: do you the the object files mykEpsilon.o and mykOmegas.o? Can you share here the output of the command "nm -g mykEpsilon.o" to make sure that the mykEpsilon.o is effectively there? Last edited by dlahaye; February 14, 2024 at 04:20. Reason: Added |
|
February 14, 2024, 04:19 |
|
#18 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
Hi,
Yes they are compiled. I’ve ran a test case using pitzDaily tutorial and the new kEpsilon and kOmega models were recognised after compilation. I’m stuck as to why Reynolds Stress models are failing to compile |
|
February 14, 2024, 06:35 |
|
#20 |
Member
ASR
Join Date: Jan 2023
Location: Leeds, UK
Posts: 52
Rep Power: 3 |
I went into the test case, changed the turbulence model in constant file to mykOmega and mykEpsilon and the solver recognised the terms. I also wrote the word 'test' in the turbulence model, which I knew would be invalid, and the solver gave me alternative suggestions for turbulence models which included the new ones mykEpsilon and mykOmega.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Map of the OpenFOAM Forum - Understanding where to post your questions! | wyldckat | OpenFOAM | 10 | September 2, 2021 06:29 |
STATEMENT about how to implement new turbulent models in OpenFOAM | PeterShi | OpenFOAM Running, Solving & CFD | 0 | February 28, 2017 08:18 |
Suggestion for a new sub-forum at OpenFOAM's Forum | wyldckat | Site Help, Feedback & Discussions | 20 | October 28, 2014 10:04 |
Reynolds Stress Model in OpenFOAM | harsha_kulkarni | OpenFOAM Pre-Processing | 0 | August 3, 2014 03:23 |
How the trace term of SGS stress tensor implemented in Openfoam | star shower | OpenFOAM Running, Solving & CFD | 0 | March 3, 2012 09:56 |