CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Problems with implementing sink term in Gamma-Re-Theta turbulence model (https://www.cfd-online.com/Forums/openfoam-programming-development/244462-problems-implementing-sink-term-gamma-re-theta-turbulence-model.html)

sumedhss August 9, 2022 15:27

Problems with implementing sink term in Gamma-Re-Theta turbulence model
 
2 Attachment(s)
Hello all,
I'm trying to augment the Gamma-Re-Theta model to include crossflow effects as per Langtry (Langtry, Robin. "Extending the gamma-rethetat correlation based transition model for crossflow effects." In 45th AIAA fluid dynamics conference, p. 2474. 2015.) In this approach, an additional sink term D_{SCF} is added to the transport equation for \tilde{Re_{\theta t}}, which is described as-
D_{SCF} = c_{\theta t}\frac{\rho}{t}min(Re_{SCF}-\tilde{Re_{\theta t}},0)F_{\theta t 2}

Here, Re_{SCF} is the stationery crossflow Reynolds number, which is computed implicitly using a correlation. Since Re_{\theta t 0} (freestream transition momentum thickness Reynolds number) is also computed implicitly, I defined Re_{SCF} in a similar fashion as
Re_{\theta t 0} and called it in
Code:

correctReThetatGammaInt()
, but I get the following warning while compiling-
Code:

In file included from ../turbulenceModels/lnInclude/kOmegaSSTLMN.H:320,
                from turbulentTransportModels/myTurbulentTransportModels.C:60:
../turbulenceModels/lnInclude/kOmegaSSTLMN.C: In instantiation of ‘Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> > Foam::RASModels::kOmegaSSTLMN<BasicTurbulenceModel>::ReSCF(const Internal&, const Internal&, const Internal&) const [with BasicTurbulenceModel = Foam::IncompressibleTurbulenceModel<Foam::transportModel>; Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Internal = Foam::DimensionedField<double, Foam::volMesh>]’:
../turbulenceModels/lnInclude/kOmegaSSTLMN.C:707:21:  required from ‘void Foam::RASModels::kOmegaSSTLMN<BasicTurbulenceModel>::correctReThetatGammaInt() [with BasicTurbulenceModel = Foam::IncompressibleTurbulenceModel<Foam::transportModel>]’
../turbulenceModels/lnInclude/kOmegaSSTLMN.C:785:5:  required from ‘void Foam::RASModels::kOmegaSSTLMN<BasicTurbulenceModel>::correct() [with BasicTurbulenceModel = Foam::IncompressibleTurbulenceModel<Foam::transportModel>]’
../turbulenceModels/lnInclude/kOmegaSSTLMN.C:768:6:  required from here

I tried running simulations with this model, but they would crash instantly with the error log mentioning Re_{SCF}. When I replaced Re_{SCF} with a constant value in
Code:

correctReThetatGammaInt()
, the model compiles without issues and simulations also run without issues. It is clear that the problem is related to the instantiation of the function template, but I am not able to pinpoint the exact reason. I have attached the code and header file along with the post. I'm using OpenFOAM v2012. Any help on this topic would be sincerely appreciated.
Thanks a lot!

dlahaye August 10, 2022 07:10

Not sure.

Does its make sense to look into fvOptions to include an additional source term?

sumedhss August 13, 2022 04:34

Quote:

Originally Posted by dlahaye (Post 833557)
Not sure.

Does its make sense to look into fvOptions to include an additional source term?

Can fvOptions access protected member functions? All the constants required for the source terms are protected class members in this case.

Tobi August 31, 2022 11:24

You can redefine the constants in the coded FO.


All times are GMT -4. The time now is 08:40.