|
[Sponsors] |
How to update density and viscosity on PimpleFoam? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 15, 2024, 21:23 |
How to update density and viscosity on PimpleFoam?
|
#1 |
New Member
Join Date: Jan 2024
Posts: 2
Rep Power: 0 |
If I want to define density/viscosity based on the relative composition of two solvents in the flow field, how can I add this line to the main solver so I can update the value of density/viscosity at the end of each iteration in OpenFOAM? For example, /rho = /rho_w (T1) + /rho_e(T2). I have already built the main body of my solver, but I need to add this functionality at the end of the solver as well, but I'm not sure how to do it.
Any help would be greatly appreciated. |
|
April 17, 2024, 12:24 |
|
#2 |
Member
Shravan
Join Date: Mar 2017
Posts: 60
Rep Power: 9 |
Hello,
You can take a look at twoLiquidMixingFoam solver. For example the densities (also viscosities) of the two fluids are read. The mixture density is calculated based on the composition of the solvent. This mixture density then is used when solving in the pressure equation. Solver https://cpp.openfoam.org/v9/twoLiqui...8C_source.html Tutorial https://github.com/OpenFOAM/OpenFOAM...m/lockExchange Thanks |
|
April 17, 2024, 12:29 |
|
#3 |
New Member
Join Date: Jan 2024
Posts: 2
Rep Power: 0 |
Thanks a lot for your reply. So, does this solver solve the convection-diffusion equation for two different scalars and then update density and viscosity with a linear relationship?Can this solver be used for turbulent flows? I'm dealing with high Reynolds numbers here.
Thanks a lot for your help. |
|
April 17, 2024, 12:44 |
|
#4 |
Member
Shravan
Join Date: Mar 2017
Posts: 60
Rep Power: 9 |
Hello,
Yes this solves the scalar transport equation of one scalar (lets say alpha1), the other will simply be alpha2= 1 - alpha1. For example the mixture density is calculated in the following way rho_mixture = alpha1*rho1 + alpha2*rho2 It can be used for turbulent flows (both RANS and LES modelling are possible). You can check out this thesis, the solver is explained very well. Jacobsen, K. Å. (2018). The dead water phenomenon. A computational fluid dynamics study (Master's thesis). https://www.duo.uio.no/handle/10852/63453 Thanks |
|
April 24, 2024, 00:51 |
|
#5 |
New Member
mo magd
Join Date: Apr 2024
Posts: 3
Rep Power: 2 |
When I run the simulaiton using this foam you recommended, it only outputs U, p_rgh, and alpha. I don't know how I can add the contour f density or viscosity in paraview.
|
|
April 24, 2024, 12:01 |
|
#6 |
Member
Shravan
Join Date: Mar 2017
Posts: 60
Rep Power: 9 |
Hello,
In Paraview, you can use the Calculator filter for this purpose. Once you select the calculator filter, enter the formula in the box. For density, for example let us say you call it density_effective as your Result array name. The formula that you have to enter will be density_effective = alpha*rho_1 + (1-alpha)*rho_2. Where rho_1 and rho_2 are constants. Similar to what I also mentioned earlier in this thread. Once you successfully implement this filter, you can see this density_effective field along with your other fields and you can now visualize it. Thanks |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiphase non-Newtonian viscosity of blood | mdmtramper | Fluent Multiphase | 3 | January 22, 2021 06:09 |
Density correction function for turbulent viscosity | Bando | STAR-CCM+ | 1 | July 9, 2017 02:44 |
PLEASE EXPLAIN: why reactingFoam is not outputting density and viscosity | sahmed | OpenFOAM Running, Solving & CFD | 2 | December 7, 2016 16:31 |
Variable density and viscosity | ravibhadauria | FLUENT | 0 | September 15, 2011 17:09 |
REAL GAS UDF | brian | FLUENT | 6 | September 11, 2006 08:23 |