How to update density and viscosity on PimpleFoam?
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. |
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 |
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. |
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 |
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.
|
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 |
All times are GMT -4. The time now is 01:35. |