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

How to get access to turbulence viscosity in multiphaseEulerFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 11, 2024, 22:18
Default How to get access to turbulence viscosity in multiphaseEulerFoam
  #1
zyy
New Member
 
zyy
Join Date: Dec 2022
Posts: 5
Rep Power: 3
zyy is on a distinguished road
In openFOAM 10, sigle phase turbulence is constructed using following codes:
Code:
autoPtr<incompressible::turbulenceModel> turbulence
(
    incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
However, I can't find similar codes in multiphaseEulerFoam. I guess it might be hidden in the class "phaseSystem". But I have no idea where the turbulenceModels are constructed.
zyy is offline   Reply With Quote

Old   November 12, 2024, 03:59
Default
  #2
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 798
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Euler is non-viscous and has there zero-viscosity?
dlahaye is offline   Reply With Quote

Old   November 12, 2024, 11:52
Default
  #3
zyy
New Member
 
zyy
Join Date: Dec 2022
Posts: 5
Rep Power: 3
zyy is on a distinguished road
Thank you for your reply. The tutorial of multiphaseEulerFoam can set simulationType to RAS and applys mixtureKEpsilon model instead of single phase kEpsilon. The model code can be found in src/MomentumTransportModels/PhaseCompressible. So the solver should have access to viscosity models.

The UEqns.H file constructed a momentumTransferPtr using the member function momentumTransfer() of class PhaseSystem. But the function momentumTransfer() is virtual, and I don't know if there are any subclass that rewrite that function.
zyy is offline   Reply With Quote

Old   November 12, 2024, 14:35
Default
  #4
Member
 
Shravan
Join Date: Mar 2017
Posts: 73
Rep Power: 9
Severus is on a distinguished road
Hello,
What you are looking for is in the phaseCompressibleMomentumTransportModel.H file
https://cpp.openfoam.org/v10/phaseCo...8H_source.html

You first have to take a look at multiphaseCompressibleMomentumTransportModels.C which is present under the multiphaseEulerFoam application folder
https://cpp.openfoam.org/v10/multiph...8C_source.html
If you carefully follow the dependencies and header files from this class you will finally get to phaseCompressibleMomentumTransportModel.H file

Thanks
Severus is offline   Reply With Quote

Old   November 12, 2024, 14:52
Default
  #5
zyy
New Member
 
zyy
Join Date: Dec 2022
Posts: 5
Rep Power: 3
zyy is on a distinguished road
Thank you so much for your response. That's a great point. However, I'm still a bit unsure about how the solver uses those models. I'm hoping to find something like "phase1.turbulence().nut()" as a way to express it. I actually tried removing #include "phaseCompressibleMomentumTransportModel.H" in multiphaseEulerFoam.C, but the solver still compiles and runs as usual, which is a bit confusing. How does the solver manage to construct fields like nut.air and nut.water?
zyy is offline   Reply With Quote

Old   November 12, 2024, 15:21
Default
  #6
Member
 
Shravan
Join Date: Mar 2017
Posts: 73
Rep Power: 9
Severus is on a distinguished road
Hello,
If you want to use nut fields for a specific phase (like nut.air or nut.water), the best way will be to take a look at the phaseScalarTransport functionObject, where it is easy to follow and adapt.
https://cpp.openfoam.org/v10/phaseSc...8C_source.html
Here, see lines 272-275. When adapting it for your case, check this class carefully so that you don't forget to add the right header files.

Within multiphaseEulerFoam it is not that easy to find out as the code is quite generalized and complicated. However, in the older versions, for instance in twoPhaseEulerFoam is easier to find how they use the turbulent viscosity.
https://cpp.openfoam.org/v7/twoPhase...8H_source.html
See line 27 and 60

Thanks
Severus is offline   Reply With Quote

Old   November 12, 2024, 15:40
Default
  #7
zyy
New Member
 
zyy
Join Date: Dec 2022
Posts: 5
Rep Power: 3
zyy is on a distinguished road
Thanks a lot for your advice. I have inplemented my code on twoPhaseEulerFoam in OF 7. I did some comparasion with multiphaseEulerFoam in OF 10 and find out that multiphaseEulerFoam is more stable when dealing with advetion term. I will update this post if I find a entry to the nut fields in multiphaseEulerFoam.
zyy is offline   Reply With Quote

Old   November 12, 2024, 15:57
Default
  #8
Member
 
Shravan
Join Date: Mar 2017
Posts: 73
Rep Power: 9
Severus is on a distinguished road
Hello,
Alright. In the past I have used the nut fields in multiphaseEulerFoam in OpenFOAM v9. I followed a similar procedure to that implemented in the phaseScalarTransport.C file. So, I think it should also work in your case.

Since you mentioned that you have issues with stability with the twoPhaseEulerFoam solver, I would recommend you to check out the faceMomentum formulation.
https://github.com/OpenFOAM/OpenFOAM...777bb10a3e1dda
What is "faceMomentum" in twoPhaseEulerFoam in OF 3.0.0

I have used it and it has proven to ensure stability for some cases.

Thanks
Severus is offline   Reply With Quote

Old   November 12, 2024, 21:17
Default
  #9
zyy
New Member
 
zyy
Join Date: Dec 2022
Posts: 5
Rep Power: 3
zyy is on a distinguished road
Thanks! That’s really helpful.
zyy is offline   Reply With Quote

Reply

Tags
multiphaseeulerfoam, turbulence viscosity


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
I can't add turbulence model in multiPhaseEulerFoam saeed sangchooly OpenFOAM 6 May 9, 2024 14:38
Clarification for the RANS-based turbulence model cfdnewb123 Main CFD Forum 6 April 27, 2020 14:10
Why is access to turbulence fields provided as const? mrishi OpenFOAM Programming & Development 3 January 23, 2020 13:51
How to access a new defined fields in turbulence model code JasonWang3 OpenFOAM Programming & Development 1 March 24, 2016 15:35
Turbulence viscosity limited Madhukar Rapaka FLUENT 0 June 26, 2006 04:17


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