|
[Sponsors] |
How to get access to turbulence viscosity in multiphaseEulerFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 11, 2024, 22:18 |
How to get access to turbulence viscosity in multiphaseEulerFoam
|
#1 |
New Member
zyy
Join Date: Dec 2022
Posts: 5
Rep Power: 3 |
In openFOAM 10, sigle phase turbulence is constructed using following codes:
Code:
autoPtr<incompressible::turbulenceModel> turbulence ( incompressible::turbulenceModel::New(U, phi, laminarTransport) ); |
|
November 12, 2024, 11:52 |
|
#3 |
New Member
zyy
Join Date: Dec 2022
Posts: 5
Rep Power: 3 |
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. |
|
November 12, 2024, 14:35 |
|
#4 |
Member
Shravan
Join Date: Mar 2017
Posts: 73
Rep Power: 9 |
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 |
|
November 12, 2024, 14:52 |
|
#5 |
New Member
zyy
Join Date: Dec 2022
Posts: 5
Rep Power: 3 |
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?
|
|
November 12, 2024, 15:21 |
|
#6 |
Member
Shravan
Join Date: Mar 2017
Posts: 73
Rep Power: 9 |
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 |
|
November 12, 2024, 15:40 |
|
#7 |
New Member
zyy
Join Date: Dec 2022
Posts: 5
Rep Power: 3 |
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.
|
|
November 12, 2024, 15:57 |
|
#8 |
Member
Shravan
Join Date: Mar 2017
Posts: 73
Rep Power: 9 |
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 |
|
November 12, 2024, 21:17 |
|
#9 |
New Member
zyy
Join Date: Dec 2022
Posts: 5
Rep Power: 3 |
Thanks! That’s really helpful.
|
|
Tags |
multiphaseeulerfoam, turbulence viscosity |
|
|
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 |