
[Sponsors] 
January 27, 2009, 09:53 
Hi all OpenFOAMers,
I want

#1 
Member
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 10 
Hi all OpenFOAMers,
I want to deal with density currents (water/water with salt) simulations and, to do so, I depart from the twoLiquidMixingFoam and, as a first step, include the RANS libraries (OF1.5.x). If turbulence has to be taken into account, the gamma equation has to be modified including the turbulent diffusion coefficient, obtained from the turbulent viscosity. The new form of the gammaEqn is then: fvScalarMatrix gammaEqn ( fvm::ddt(gamma) + fvm::div(phi, gamma)  fvm::laplacian(Deff, gamma)  (fvc::grad(gamma) & fvc::grad(Deff)) //turbulence ); where Deff=Dab + turbulence>nut()/Prc; where Prc (or particle Schmidt number) has to be defined by the user). The surprising thing is that, during the simulations, the total salt concentration (gamma.weightedAverage(mesh.V()).value()) increases, let's say, 5%. However, when I delete from gammaEqn the new term corresponding to variable diffusivity, the total salt mass is conserved. I tried to modify the numerical schemes for gammaEqn, the default ones are: grad(gamma) Gauss linear; grad(Deff) Gauss linear; div(phi,gamma) Gauss vanLeer; but OF only allows me to modify the div scheme. I tested also limitedLinear01 but the imbalance was worst, of about 11% of mass increase. The mesh is structured and orthogonal. Has anyone any idea of what's going on? elisabet 

January 27, 2009, 16:43 
Hi Elisabet
I did a similar

#2 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,749
Rep Power: 29 
Hi Elisabet
I did a similar exercise some time ago, thus I went into my implementation. Apparently the only difference is that I didn't have  (fvc::grad(gamma) & fvc::grad(Deff)) in my gamma equation, as I took the programmersguide quite literally (correct, I do not know), but I had mass conservation nevertheless. Adding the above made it becomes nonconserving. Good luck, Niels
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

January 27, 2009, 19:01 
Hi Niels,
Thanks for your a

#3 
Member
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 10 
Hi Niels,
Thanks for your answer. I cannot omit this term as, when you develop the equations taking into account that Deff is not constant, this new term (or other similar expressions) appears. Any suggestion? elisabet 

January 28, 2009, 02:31 
Just for a clarification, so w

#4 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,749
Rep Power: 29 
Just for a clarification, so when the programmers guide states, that
laplacian(gamma,U) = Nab dot (gamma Nab U) then the implementation does only return gamma laplace U which is why one have to manually add Nab U dot Nab gamma? If that is the case, I have to revisit the implementation myself. Thanks and I will keep my head spinning Niels
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

January 28, 2009, 09:04 
Hi Niels,
I guess I'm wrong

#5 
Member
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 10 
Hi Niels,
I guess I'm wrong. Ok, in momentum equation and for incompressible fluids you have: div(tau) = div(nu_eff grad(u)) + grad(nu_eff):grad(u) hence, I just implemented the same procedure for gammaEqn, what I guess it's not correct. I've found some references for these kinds of flows and no one says anything of this extra term. However, the diffusion coefficient is not constant and takes the form Deff = D_laminar + nu/Sc, where Sc is around 0.70.9 If I keep this notation, then, the algorithm is conservative. Sorry for the confusion and thanks for making me think more about it. Tell me, please, if I'm missing anything. elisabet 

January 28, 2009, 09:26 
Hi Elisabet
Well, you have

#6 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,749
Rep Power: 29 
Hi Elisabet
Well, you have made me unsure, thus I went into the source, and at least for fvc:laplacian, see http://foam.sourceforge.net/doc/Doxy...8Csource.html l. 114, it is calculated by considering the diffusion as constant, however I have a hard time understanding whether or not the fvm:laplacian does that as well. For something quite different: You say that Sc = 0.70.9, but since you are dividing nu_t with this value, you state that the diffusion of the agent is more effective than the diffusion of the water. For turbulent flows it seems counterintuitive to me? I considering a small test, as my company needs to clearify the above, thus I will come back on the question of the laplacian. /Niels
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

January 28, 2009, 12:22 
Hi Niels,
Check in src/fini

#7 
Member
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 10 
Hi Niels,
Check in src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplaci anScheme.C About the particle Sc number, it is defined as: Sc=nu_t/D_t, where subscript t stands for turbulent. And the same occurs with the thermal Prandtl number in the thermal diffusion coefficient of energy equation. However, in momentum equation your effective viscosity is directly: nu_eff=nu_lam + nu_t. All this comes from the Eddy Viscosity Model (or Boussinesq assumption). elisabet 

February 2, 2009, 08:56 
Here are a few thoughts for th

#8 
New Member
Bjarne Jensen
Join Date: Mar 2009
Location: Denmark
Posts: 7
Rep Power: 10 
Here are a few thoughts for the above discussion.
After using the version of twoLiquidMixingFoam modified to include the RANS libraries by Niels I have been wondering why the gammeEqn should be modified to include the turbulent diffusivity? As I see it, when mixing fresh and salt water the diffusion between the two phases is far most dominated by the turbulent spreading. If you imagine a tank with still water and a dense bottom layer and a light top layer I would believe that the mixing of the two phases would be very small. Therefore when the turbulence model is included this should take care of the spreading/mixing of the two phases through the UEqn. At this point I see the gamma field as a passive scalar used to specify the combined density of the two phases thus any additional diffusion (beside the turbulence diffusion in the UEqn) is not included. If more diffusion is needed i.e. due to molecular diffusion between the two phases a value can be assigned to the Dab factor in the gammaEqn. Niels, you mention that the only difference is that your version didn't have (fvc::grad(gamma)&fvc::grad(Deff)) If you remember after testing your version we realized that the diffusion between the two phases was significantly too high. A simple lockexchange test ended up with total mixing of the two phases. Based on the thoughts about where to include the turbulence diffusivity I removed the turbulent diffusivity from the gammaEqn and thereby having the original formulation (setting the Dab factor = 0) and including the turbulence as turbulence>nut() only in the UEqn. This gave a remarkable improvement of the mixing results. Elisabeth, have you tried to make a test (lockexchange or similar) with the version where you have deleted the line: (fvc::grad(gamma)&fvc::grad(Deff)) It would be interesting to see if you will experience the same over predicted mixing as we have, as that was what made me think about the issue of including turbulence diffusivity in both gammaEqn and UEqn. Bjarne 

February 11, 2009, 16:07 
Hi
I have revisited the ab

#9 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,749
Rep Power: 29 
Hi
I have revisited the above problem. I have run a lockflow which measures 2 times 10 m i 2D. The densities of the two liquids are 1000 and 990 respectively. The initial setup is two identically sized columns which are released. The problem is solved as a test to look at the mixing rate with a kepsilon model on a structured and uniformly distributed mesh, thus the effect of boundaries is neglected at present. I have solved it without the additional term discussed above as it should not be there (one can show that the term in the momentum equation shows up because it is a vector field). Further the eddy viscosity is present in the gamma equations, as it needs to be there to mimic the turbulent mixing. The results look rather encouraging with a nice lockflow, see figure, where the above is discretized using 112*512 cells and the one below is discretized using 56*256 cells. So, apparently the mixing seems to be qualitatively correct and I think the chosen way of implementing the mixing of two liquids is the correct way to go. Best regards, Niels
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

February 11, 2009, 16:12 
Hmmm, it didn't work. Though t

#10 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,749
Rep Power: 29 
Hmmm, it didn't work. Though this does:
http://www.student.dtu.dk/~ngja/lockFlow.png Best regards, Niels
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

February 17, 2009, 05:55 
Hi Niels,
I did a similar r

#11 
Member
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 10 
Hi Niels,
I did a similar run some weeks ago and I got also nice results. However, we are planning to compare them with experimental data and see exactly how accurate it is. Moreover, I would need to have a correct interface tracking in the top, and I still have to learn more about it. Oh! and don't forget about a new turbulence model that includes the Richardson number! So.... still lots of pendent work... Best regards, elisabet 

February 24, 2009, 12:03 
Hi Elisabet
So what you bas

#12 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,749
Rep Power: 29 
Hi Elisabet
So what you basically need to do is couple this advectiondiffusion problem with a VOFmethod or the interTrackFoam and let the solution from the advectiondiffusion effect the density? However dangerous a word like basic might be I am not working on it myself, but I now that those who do have had a problem finding experimental data regarding stratified flows, thus do you have any references you wish to share, or are you going to do the experiments by yourself? Good luck, Niels P.S. From Milan, I recall you talked about fusion reactors ... isn't a large step to begin looking at stratified flow due to salt and I assume significantly smaller temperatures?
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

February 25, 2009, 07:02 
Hi Niels,
As you've said de

#13 
Member
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 10 
Hi Niels,
As you've said density currents is not my field, but I know some people working on it in Barcelona and Rome and I'm trying to collaborate with them, at least in a long term. They are planning to do some experiments and to analyze some experimental results, but still anything is published, sorry. By the way, you remember well: my research field is MHD applied to fusion. About interTrackFoam I experienced some stability problems for unstructured meshes when the Froude number is very low (in version 1.4.1dev) so I will repeat the same calculations (not right now) with the new version. Also, the implementation of the Richardson approximation in kepsilon turbulence model is not straight forward and I should spend more time on it. If you have any experience in one of these two fields, please, do not hesitate sharing it! Best regards, elisabet 

February 28, 2009, 20:42 
Hi Elisabet
Just a quick qu

#14 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,749
Rep Power: 29 
Hi Elisabet
Just a quick question / comment regarding the turbulence modeling: 1. With respect to the momentum equation, you need the uncorrected eddy viscosity (uncorrected meaning no effect of Richardson number). 2. With respect to the gammaequation, you need the corrected eddy viscosity. So why is it you want to change the turbulence model and not simply modify the eddy viscosity before applying it to the gammaequation (i.e. outside the turbulence library), as you need the noncorrected for the momentum?!? I am not strong in mixing, thus I might be on the wrong track. By the way, is the modification of the eddy viscosity based on a local Richardson number or a global one? And how do you define the turbulent diffusion coefficient D_t, if Sc is local and thereby unknown? Does it imply the use of an additional equation? I was at a seminar this Friday, where Håkan Nilsson noted that the standard kOmegaSST does not give reasonable results for swirling flows. The comparison I have made with the same model for mixing does produce to much mixing (to large nu_t I guess in the interior of the domain), thus Håkan introduced a filtered version and achieved significantly better results. It might be interesting with respect to the present problem!?! Have a nice weekend, Niels
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

March 1, 2009, 13:39 
P.S. Send me an email as I hav

#15 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,749
Rep Power: 29 
P.S. Send me an email as I have some information on the filtered version, I can forward to you.
/Niels
__________________
Please note that I do not use the Friendfeature, so do not be offended, if I do not accept a request. 

March 11, 2009, 13:03 
Hi Niels,
Sorry for the del

#16  
Member
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 10 
Hi Niels,
Sorry for the delay, I was quite busy with other things. First of all, there are some nowadays public experimental results with density currents. Take a look at: Quote:
Quote:
Regards, elisabet 

March 18, 2009, 03:56 
Additional Term in Turbulence Formulation

#17 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,749
Rep Power: 29 
Hi and goodmorning
I have read the second reference by now, and I agree that one need to modify the turbulence formulation. Thanks for shedding some light on it. I do not fully understand the thermodynamic approximations / relations in the appendix and "T" is left undefined (I am guessing temperature?). However it is merely details. What I am thinking is that one need to decide whether to model turbulence generation due to the density fluctuations or the temperature (?) fluctuations. This is because I can easily imagine flows where T is constant and the density is varying, and one wants to make the implementation as generic as possible!? Enjoy your day, Niels 

March 18, 2009, 14:17 
density fluctuations

#18 
Member
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 10 
Hi Niels,
The 'original' buoyancy term is just , where the density is a function of any other scalar, usually temperature, but it could also be pressure or concentration. From this point, the Boussinesq hypothesis stands that for moderate temperature (or p or C) variations, the density can be considered as constant in all the terms except for the buoyancy term. What considerably simplifies the momentum equation. One step further is to choose how the density depends on other variables. The most simple, and common, way is to apply a Taylor expansion, for example: Usually, only the first term of the Taylor expansion is considered, which reduces even more the applicability of the approximation. Moreover, if the compressibility coefficient is considered negligible, the approximation remains: what can be written as: and this is what we normally have. However, if the density varies depending on both, the temperature and the concentration, you will obtain an equivalent expression but including a new corresponding to the concentration expansion coefficient: Sorry if I extended too long but I've seen that very often the Boussinesq hypothesis is not well understood. Hope this will help to someone! If in your case you have both terms ( and ) in your momentum equation, you would have to develop your own k equation and deduce the new terms, it is straight forward as both terms have the same structure. The main drawback, from my point of view, is the definition of each Prandtl number for the Boussinesq approximation of the averaged terms (I'm talking about turbulence now, not about the buoyancy term). Regards, elisabet 

March 20, 2009, 05:24 

#19 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,749
Rep Power: 29 
Hi Elisabet
Thank you for the thorough explanation. Have a nice weekend, Niels 

April 21, 2009, 05:46 

#20 
New Member
Kyian Barrat
Join Date: Apr 2009
Posts: 25
Rep Power: 10 
Hi Elisabeth, Niels
The explanation about boussinesq assumption was really interesting... Im a new foamers and im a little confused about the equations... Indeed i work with buoyantSimpleFoam solver and i though that the boussinesq assumption was considered but i saw on the forum that there is a "special" boussinesqapproximation solver. So I guess this approximation is not used in buoyantSimpleFoam. If im right, i would like to know which density approximation or density law is used in buoyantSimpleFoam to solve the equations It's maybe a stupid question... Sorry 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
About the gammaEqn in interFoam  sandy  OpenFOAM Running, Solving & CFD  14  March 19, 2014 10:30 
GammaEqn and UEqn in interFoam  adekian  OpenFOAM Running, Solving & CFD  1  April 11, 2007 02:03 
about the nonconservative equation and FVM  maximus  Main CFD Forum  3  March 4, 2006 16:45 