CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Velocity corrector

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 1 Post By Tibo99
  • 3 Post By Tobermory
  • 3 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2021, 10:08
Default Velocity corrector
  #1
Senior Member
 
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 6
Tibo99 is on a distinguished road
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.
Attached Images
File Type: png Ufactor.png (3.4 KB, 13 views)
File Type: png ULap.png (4.2 KB, 10 views)
Tibo99 is offline   Reply With Quote

Old   January 28, 2021, 10:40
Default
  #2
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 741
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Laplacian term is inside turbulence->divDevSigma(U). See e.g. line 9 of https://github.com/OpenFOAM/OpenFOAM...pleFoam/UEqn.H
dlahaye is online now   Reply With Quote

Old   January 28, 2021, 10:48
Default
  #3
Senior Member
 
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 6
Tibo99 is on a distinguished road
Thank for replying!

I have openfoam v1906 and it's 'turbulence->divDevReff(U)' instead of 'turbulence->divDevSigma(U)'.

It's probably the same term?
dlahaye likes this.
Tibo99 is offline   Reply With Quote

Old   May 31, 2021, 12:41
Default
  #4
New Member
 
Join Date: May 2019
Posts: 6
Rep Power: 7
ecles is on a distinguished road
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.
ecles is offline   Reply With Quote

Old   May 31, 2021, 18:02
Default
  #5
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14
Tobermory will become famous soon enough
https://cpp.openfoam.org/v8/Incompre...8C_source.html, line 106
Tobermory is offline   Reply With Quote

Old   May 31, 2021, 18:07
Default
  #6
New Member
 
Join Date: May 2019
Posts: 6
Rep Power: 7
ecles is on a distinguished road
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!
ecles is offline   Reply With Quote

Old   May 31, 2021, 18:11
Default
  #7
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14
Tobermory will become famous soon enough
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.
reza2031, ecles and yueyun like this.
Tobermory is offline   Reply With Quote

Old   June 1, 2021, 15:48
Default
  #8
New Member
 
Join Date: May 2019
Posts: 6
Rep Power: 7
ecles is on a distinguished road
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?
ecles is offline   Reply With Quote

Old   June 2, 2021, 05:24
Default
  #9
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14
Tobermory will become famous soon enough
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.
dlahaye, ecles and yueyun like this.
Tobermory is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
wrong velocity contour of rotating propeller - Fluent calv FLUENT 1 September 6, 2018 11:48
Problem with Velocity Poisson Equation and Vector Potential Poisson Equation mykkujinu2201 Main CFD Forum 1 August 12, 2017 13:15
Velocity in Porous medium : HELP! HELP! HELP! Kali Sanjay Phoenics 0 November 6, 2006 06:10
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 05:13


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