|
[Sponsors] |
January 28, 2021, 11:08 |
Velocity corrector
|
#1 |
Senior Member
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 7 |
Hi everyone,
I'm looking to implement a correction factor to the velocity for the k-e turbulence model. I try to find the exact location in the code where I should apply the factor but I'm not quite sure. The factor is apply on the Laplacian term. I'm guessing it's in the 'UEqn.H' file but I don't find the Laplacian term in there. |
|
January 28, 2021, 11:40 |
|
#2 |
Senior Member
|
Laplacian term is inside turbulence->divDevSigma(U). See e.g. line 9 of https://github.com/OpenFOAM/OpenFOAM...pleFoam/UEqn.H
|
|
January 28, 2021, 11:48 |
|
#3 |
Senior Member
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 7 |
Thank for replying!
I have openfoam v1906 and it's 'turbulence->divDevReff(U)' instead of 'turbulence->divDevSigma(U)'. It's probably the same term? |
|
May 31, 2021, 13:41 |
|
#4 |
New Member
Join Date: May 2019
Posts: 6
Rep Power: 7 |
Hello!
Could you please tell me where divDevSigma(U) is currently implemented? In OF 8, I tried to search in: src/MomentumTransportModels/incompressible/IncompressibleMomentumTransportModel/IncompressibleMomentumTransportModel.C (https://cpp.openfoam.org/v8/Incompre...ce.html#l00118) But it seems to be currently not implemented. |
|
May 31, 2021, 19:02 |
|
#5 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
||
May 31, 2021, 19:07 |
|
#6 |
New Member
Join Date: May 2019
Posts: 6
Rep Power: 7 |
Yes, but then when you follow the code:
template<class TransportModel> Foam::tmp<Foam::fvVectorMatrix> Foam::IncompressibleMomentumTransportModel<Transpo rtModel>::divDevSigma ( volVectorField& U ) const { return divDevTau(U); } When you go to divDevTau: template<class TransportModel> Foam::tmp<Foam::fvVectorMatrix> Foam::IncompressibleMomentumTransportModel<Transpo rtModel>:: divDevTau ( volVectorField& U ) const { NotImplemented; return divDevSigma(U); } What's going on? Thanks! |
|
May 31, 2021, 19:11 |
|
#7 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
Yes, it IS confusing, since there is a lot of use made of templating. The definition of divDevTau is done in the viscosity model, eg in:
line 81 of https://cpp.openfoam.org/v8/linearVi...8C_source.html for the turbulence models that us a linear viscous stress, like kEpsilon. |
|
June 1, 2021, 16:48 |
|
#8 |
New Member
Join Date: May 2019
Posts: 6
Rep Power: 7 |
Thank you!
I still do not see how divDevTau in the selected viscosity Model is accessed by IncompressibleMomentumTransportModel<TransportMode l>. I tried to follow the classes:IncompressibleMomentumTransportModel->MomentumTransportModel->incompressibleMomentumTransportModel->momentumTransferModel, but I could not figure it out. Could you help me? |
|
June 2, 2021, 06:24 |
|
#9 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
The short answer (I think!) is that the turbulence model is instantiated as an object of type linearViscousStress<BasicMomentumTransportModel>, and has its own member function divDevTau() (as defined in linearViscousStress.C). The call in the solver to turbulence->divDevSigma(U) calls this function, as we saw from the earlier posts.
An incredible amount of detail is glossed over in the above "short answer". My advice, if you truly want to understand this, is to clear a few days from your schedule and then take a BIG piece of paper and draw out the connections between the classes, start working through it and make notes as you go. It is really complex - especially the turbulence model, which involves multiple levels of RTS selection (you'll need to understand RTS, to thoroughly understand how the class structure all fits together; if you're not up to speed on RTS, then start by checking out https://openfoamwiki.net/index.php/O...tion_mechanism, but be aware that the full implementation in OpenFOAM is much more intricate/complex than the wiki page suggests, with many of the key features buried in macros). If you do invest the time, you will learn a huge amount about the code ... so I do recommend it, but do write some notes since otherwise you may find that your moment of understanding evaporates quickly! Good luck. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
wrong velocity contour of rotating propeller - Fluent | calv | FLUENT | 1 | September 6, 2018 12:48 |
Problem with Velocity Poisson Equation and Vector Potential Poisson Equation | mykkujinu2201 | Main CFD Forum | 1 | August 12, 2017 14:15 |
Velocity in Porous medium : HELP! HELP! HELP! | Kali Sanjay | Phoenics | 0 | November 6, 2006 07:10 |
Terrible Mistake In Fluid Dynamics History | Abhi | Main CFD Forum | 12 | July 8, 2002 10:11 |
what the result is negatif pressure at inlet | chong chee nan | FLUENT | 0 | December 29, 2001 06:13 |