|
[Sponsors] |
![]() |
![]() |
#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 |
|
![]() |
![]() |
![]() |
![]() |
#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 |
|
![]() |
![]() |
![]() |
![]() |
#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. |
|
![]() |
![]() |
![]() |
![]() |
#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... |
|
![]() |
![]() |
![]() |
![]() |
#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. ![]() 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 08:51. Reason: merged posts a day apart |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
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...
__________________
|
|
![]() |
![]() |
![]() |
![]() |
#7 | |
Senior Member
Join Date: Mar 2018
Posts: 115
Rep Power: 8 ![]() |
Quote:
![]() |
||
![]() |
![]() |
![]() |
![]() |
#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? |
||
![]() |
![]() |
![]() |
![]() |
#9 | |||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
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». |
||||
![]() |
![]() |
![]() |
![]() |
#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. |
||
![]() |
![]() |
![]() |
![]() |
#12 | |
Senior Member
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10 ![]() |
Quote:
![]() |
||
![]() |
![]() |
![]() |
![]() |
#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?
|
|
![]() |
![]() |
![]() |
![]() |
#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. |
||
![]() |
![]() |
![]() |
![]() |
#15 |
Senior Member
TWB
Join Date: Mar 2009
Posts: 403
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! |
|
![]() |
![]() |
![]() |
![]() |
#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'*. |
|
![]() |
![]() |
![]() |
![]() |
#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; } // ************************************************************************* // |
|
![]() |
![]() |
![]() |
![]() |
#18 |
New Member
Bruno B W
Join Date: Aug 2023
Posts: 6
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. |
|
![]() |
![]() |
![]() |
![]() |
#19 | |
New Member
Carmelo Baronetto
Join Date: Dec 2023
Posts: 29
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 |
||
![]() |
![]() |
![]() |
![]() |
#20 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 711
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. |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
mixing plane model: too much backflow and does not converge | sbhi | FLUENT | 1 | December 4, 2014 00:31 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 03:32 |
fluid zone in mixing & transport reaction model | rahulangal | FLUENT | 0 | June 6, 2010 11:40 |
multiphase mixing Problem with MRF model in MixSim | Srinivas | FLUENT | 0 | October 17, 2005 06:35 |
Floworks: Mixing and thermal analysis of two gases | Jay Nelson | Main CFD Forum | 0 | June 14, 2005 18:29 |