|
[Sponsors] |
July 23, 2019, 17:54 |
How to model the mixing of two gases
|
#1 |
Senior Member
Join Date: Mar 2018
Posts: 115
Rep Power: 8 |
Hello, I have two containers, the first container contains gas 1 and the second contains gas2. the two containers are separated by a thin membrane. at t = 0 this thin membrane is removed and the two gases start to mix.
Could you please give me some hints on how to model this process? Which solver should I use? Any similar examples or tutorials? Thank you |
|
July 24, 2019, 02:38 |
|
#2 |
New Member
Join Date: Apr 2014
Posts: 24
Rep Power: 12 |
Hey,
the easiest way would be to add a new equation for a scalar transport to model diffusion process. Which solver you use is your choice. I would recommend to start with the pimpleFoam. For the equation have look on: HTML Code:
https://en.wikipedia.org/wiki/Convection–diffusion_equation |
|
July 24, 2019, 08:27 |
|
#3 |
Senior Member
Join Date: Mar 2018
Posts: 115
Rep Power: 8 |
The transport equation AFAIK is for a single fluid.
My question was about the mixing of two gases as shown in the figure. |
|
July 24, 2019, 08:53 |
|
#4 |
New Member
Join Date: Apr 2014
Posts: 24
Rep Power: 12 |
Understood that...
With the scalar you can imitade a second gas species. scalar = 0 --> species 01 scalar = 1 --> species 02 0< scalar < 1 --> mixing of the gases. You can define density, viscosity and so on depending on the scalar (species). And you can also definde diffusion depending on the diffusivity of the species. Worked for me in a lot of cases and you don't have to set up a second set of navier-stokes-equations and doing the coupling... |
|
July 24, 2019, 11:09 |
|
#5 |
Senior Member
Join Date: Mar 2018
Posts: 115
Rep Power: 8 |
Unfortunately, your post is completely not clear for me.
If you know really how to set up a case why you don't simply just give the steps. I am looking for OpenFOAM solvers that already exist to model this process not to create my own solver. PS: I am not looking for programming a new solver. I am looking for any OF solver that could solve my problem (What about multiphase solvers). --- Any answers?! Last edited by wyldckat; July 27, 2019 at 09:51. Reason: merged posts a day apart |
|
July 25, 2019, 19:55 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quick answer: rhoReactingFoam if you only want different pressures or densities for each gas; rhoReactingBuoyantFoam if you want to use gravity to influence the flow/gases... in both, you can turn off the combustion modelling, so that they don't react...
__________________
|
|
July 25, 2019, 22:45 |
|
#7 |
Senior Member
Join Date: Mar 2018
Posts: 115
Rep Power: 8 |
Thank you very much for your answer
|
|
July 25, 2019, 23:41 |
|
#8 | |
Senior Member
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10 |
Quote:
In terms of your question, have you checked the so-called Volume-of-Fluid (VOF) approach, and the corresponding solvers in OpenFOAM? |
||
July 27, 2019, 10:01 |
|
#9 | |||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quote:
Quote:
Quote:
That said, searching online for: Code:
openfoam mixing gases Beyond this, VoF for mixing gases isn't all that great, unless the gases are barely mixable, given that VoF solvers in OpenFOAM usually go for «using a VOF (volume of fluid) phase-fraction based interface capturing approach». |
||||
July 28, 2019, 05:01 |
|
#10 | |
Senior Member
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10 |
Quote:
I understand that VOF is not that great for mixing problems, and I understand that the combustion solvers (with reactions turned off) may be the better choice. All I'm trying to say is, because we don't know enough details about this mixing process (are the gases mixable? are they compressible? is this a microscale process? etc.), it is very hard to pick a corresponding solver. |
||
July 28, 2019, 23:02 |
|
#12 |
Senior Member
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10 |
Maybe I didn't express myself in a better way and that causes confusion. Bottom line is, I'm really interested in this problem (mainly because I'm just very into multiphase problems) and want to see how it goes. I'm not an expert in this particular problem, but I want to throw some ideas out there and see how real experts would like to deal with it.
|
|
July 29, 2019, 03:40 |
|
#13 |
New Member
Join Date: Apr 2014
Posts: 24
Rep Power: 12 |
Have to ask again... u want to model something like in the picture?
|
|
July 29, 2019, 11:04 |
|
#14 | |
Senior Member
Join Date: Mar 2018
Posts: 115
Rep Power: 8 |
Quote:
My question is I want to see some mixing like in real life examples. |
||
July 30, 2019, 01:04 |
|
#15 |
Senior Member
TWB
Join Date: Mar 2009
Posts: 414
Rep Power: 19 |
Hi,
I just saw this question and it seems to be similar in some ways to my question too: shock tube modelling with 2 gases As mentioned, I'm trying to model a shock tube which consists of the driver and driven area. The driver and driven area contains helium at high pressure and nitrogen at low pressure respectively. They are separated by a diaphragm, which will rupture at t=0. This is a high speed flow problem with speed reaching 4-5 mach no. So which solver should I use? I was previously using rhoCentralFoam but can I make it work with 2 gases, assuming no reaction? I read thru the forum and some suggested rhoReactingFoam or rhoPimpleFoam. cfdvenkatesh suggested : "You could use Species Transport model to simulate mixing of 2 different gases. If your application is not IC engine related, I would suggest to use General Species Transport. In the inlets you can specify the mass fractions for the gases you like." So which is the more appropriate solver to use? I am now setting up the case for rhoReactingFoam.. Thanks! |
|
November 10, 2020, 00:44 |
rhoReactingBuoyantFoam - buoyantReactingFoam
|
#16 |
New Member
Join Date: Mar 2019
Posts: 3
Rep Power: 7 |
Hi,
I understand this is an old thread, but my problem is similar and I thought I'd ask my question here before starting an entirely new one. I'm trying to tackle a similar problem of two gases mixing with thermally driven buoyancy, without a lot of success. rhoReactingBuoyantFoam, which has been superceeded by buoyantReactingFoam in the OpenFOAM dev version, does not appear to handle simulations with combustion turned off well. I am encountering temperature fluctuations in the flow field that are causing my Courant number to spike and the simulation to crash, despite adaptive timesteps, fvOption file limited velocity and temperature. There is no physical reason for temperatures to rise in my simulation given inlet velocities < 1.2m/s and temperatures <375K. ie, subsonic and low temp with no reactions. This has been observed before, here: Temperature increase for gaseous diffusion with rhoReactingBuoyantFoam? and here: having trouble using reactingFoam with reactions turned off With a solution presented to re-write the rhoReactingBuoyantFoam solver to "... enforcing the alphaEff -> muEff, ..." - Swagga5aur Unfortunately I lack the skill set required to compile the file kindly provided by Swagga5aur. I am also reluctant to modify a solver without understanding what impact the changes made to gain stability have on the solution, which I do not at this time. Is there an alternative solver that will model 2 gasses mixing with buoyancy effects robustly? As a more permanent solution, is it viable to "fix" the buoyantReactingFoam solver at the source to address the 'instability'*. |
|
June 15, 2022, 07:58 |
Follow Up
|
#17 |
New Member
Join Date: Mar 2019
Posts: 3
Rep Power: 7 |
Apologies for once again resurrecting an old thread, but I was asked by a user if I found a solution to this problem and thought I'd post here so hopefully it's useful for others.
Using buoyantReactingFoam is viable for non-reacting fluid mixing with thermally driven buoyancy effects. Turning combustion 'off' in file combustionProperties allows the solver to model the flow without considering chemical reactions, see below. It's been a while, but I believe my stability issue was caused by inappropriate fvSchemes. If your encountering similar issues I recommend setting Co << 1 in a bid to improve stability initially. If this does not resolve the solution stability, adjust the fvSchemes. My file is below. Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // combustionModel none; // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: dev \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default leastSquares; //Gauss linear; } divSchemes { default Gauss limitedLinear 1; //none; div(phi,U) Gauss limitedLinearV 1; div(phi,Yi_h) Gauss limitedLinear 1; //div(phi,Yi) Gauss limitedLinear01 1; div(phi,K) Gauss limitedLinear 1; div(phid,p) Gauss limitedLinear 0.8; div(phi,epsilon) Gauss linear upwind; //Gauss limitedLinear 1; div(phi,k) Gauss limitedLinear 1; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear upwind; //Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } fluxRequired { p_rgh; } wallDist { method meshWave; } // ************************************************************************* // |
|
December 14, 2023, 16:11 |
|
#18 |
New Member
Bruno B W
Join Date: Aug 2023
Posts: 7
Rep Power: 3 |
Dear Fomers,
i wonder which solver i should use to model an ethanol pool evaporation and mixing with air in a close enclosure, with a hot celing. Any directions would be very helpful. Thanks. |
|
January 12, 2024, 06:51 |
|
#19 | |
Member
Carmelo Baronetto
Join Date: Dec 2023
Posts: 30
Rep Power: 2 |
Quote:
I write in this old thread because I would like to simulate excatly this case. I used reactingFoam, following these steps: 1) I tested a "real" shocktube problem, with N2 and O2 at different pressure and the the simulation was fine 2) I modified the initial conditions, setting uniform pressure (temperature uniform as in the previous case). However in this simulation, I see no mixing and the N2 and O2 remain unmixed. I set the turbulance model "laminar", because the velocity field is zero everywhere, but I think the two gases must still mixing. Does anyone have an idea why I got these results? Thank you |
||
January 12, 2024, 10:03 |
|
#20 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14 |
Yes, there should still be molecular diffusion, even if there is no turbulence. Questions:
1. Have you run it for long enough? Molecular diffusion is slowwww compared to turbulent diffusion. Try calculating a diffusion time scale and compare your run time to that. 2. Are you sure there was absolutely "no" diffusion - if you adjust the scale, are there perhaps some very low concentrations of gas seeping across the line? If so, then this supports the previous question - run for longer and perhaps also refine the mesh at the boundary between the 2 gases. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mixing plane model: too much backflow and does not converge | sbhi | FLUENT | 1 | December 4, 2014 01:31 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |
fluid zone in mixing & transport reaction model | rahulangal | FLUENT | 0 | June 6, 2010 12:40 |
multiphase mixing Problem with MRF model in MixSim | Srinivas | FLUENT | 0 | October 17, 2005 07:35 |
Floworks: Mixing and thermal analysis of two gases | Jay Nelson | Main CFD Forum | 0 | June 14, 2005 19:29 |