
[Sponsors] 
December 17, 2012, 02:46 

#21 
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 16 
Quote:
Hello, Actually, is an additional source term. If you redo the equations development starting from You will obtain (neglecting the flux term), something like : The rhs must be treated as an explicit term in your C equation. is evaluated from the thermodynamics. It depends on or be constant, it's up to you. As a starting point, I suggest you to consider it as a constant value. Regards, Cyp Last edited by Cyp; December 17, 2012 at 03:47. 

December 18, 2012, 04:33 

#22 
Member
Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 13 
Quote:
got the point! I'll see if I can find some time to implement the equation in the code and run a test simulation so I can get back here and report the result. Thanks! Luca 

December 18, 2012, 22:17 

#23 
Member
Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 13 
Cyp,
you're the man! The problem was (almost) completely solved using your approach! I had some problems after inserting the alpha laplacian in the .C file as I had to specify to solve it as an explicit term but after figuring out how to fix that, the simulation runs smoothly. The tracer is still coming out from the liquid phase but only to a minor extent, due to the "froth" like interface smearing you have when a lot of bubbles hit the surface but that's something that really happens in the reactor so I think that won't bother me that much. I attach a screenshot of the simulation where you can see that. Man, thank you so much for your help! I can now move on to my next problem: coupling my algae growth curve in the system, but that will be done afterwards and not using openFOAM. Luca 

October 5, 2013, 01:51 

#24 
Member
vishal
Join Date: Mar 2013
Posts: 73
Rep Power: 11 
Hello luca,I am trying to simulate jet(liquid) in a different density medium (air) . The jet gets vaporized once it reaches it's specific vaporization temperature/pressure. I read ur thread but I am bit confused, how to add a transport scalar to the 2nd phase (air) to take into account vapor in interPhasechange Foam. What changes I have to make in the solvers??
Please help 

October 8, 2013, 21:45 

#25 
Member
Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 13 
Hello vishal, first of all let me tell you that I don't use that particular software so I may not be the best person to ask to....
For what I was able to read on the forum, that solver is used when a liquid phase vaporizes into its vapor, that is you are trying to make water to vaporize in air (three phases). I don't know if you can do that with that specific solver. It may look like you can use my approach in your situation but I think it is very different: in my case I have a low concentration parameter that changed the phase, not the liquid itself so its effect on liquid/gas properties is negligible. For this reason you have to keep in mind something:  adding a new equation (at least in interFoam) creates a sort of new layer over with the new scalar is solved. What I mean is that your main equations get solved beforehand and then, the new one is solved using (where needed) p and U values from the main ones. This makes the new equation "phase insensitive" that's in the end the reason why I created this thread.  when you add a new parameter with the alpha1 dependence you get two of them because: for this reason, if you add a new scalar it won't get solved together with the main equations and it will have to be adjusted to consist of just one phase (because you actually only need three). So, I think this is not the right approach. Moreover in your case, the liquid phase vanishes as it vaporizes so major changes that cannot be neglected happen in the momentum equation! The only thing I can think of is that you solve the problem using the 2 phases available and make adjustments for each time step to the gas phase. What i mean is that once solved the time step, your newly added equation can average the gas properties with those of air and then save the calculated data in a dedicated file. You may not want to average using alpha1 (or you get the liquid in the way again) but maybe with vapor pressure may work...?? Something like: This can be the air concentration in the vapor cloud (not in the liquid) where at the interface you have a pressuse equal to the vapor pressure for the given temperature and as you move away from the interface you have a lower pressure, up to zero where air concentration in air becomes, obviously 1. Doing this you can see the air concentration distribution. Then you can use this parameter to average gas properties between the air and the vapor values and write a dimensioned scalar file in each time step folder if you wish. However this approach will solve the jet flow phase change using ONLY the vapour transport properties stored in the transportProperties file. If they are similar to air properties (and they may be) the solution will not be that different from the right one. I am sorry if this is not what you are looking for but if you need help let's discuss it here. If you like it I can tell you how to do it. Luca 

October 18, 2013, 00:58 

#26 
Member
vishal
Join Date: Mar 2013
Posts: 73
Rep Power: 11 
Thanks Luca. I will give a try and let you know.


April 9, 2014, 16:45 

#27  
New Member
Jonas L. Ansoni
Join Date: Jun 2011
Location: Brazil
Posts: 22
Rep Power: 12 
Quote:
I'm having the same problem you got, as shown in attached Fig. I'm implementing the equation, but I'm having trouble to insert the term . How have you implemented this term in the .C file? Thank you in advance 

April 9, 2014, 23:27 

#28 
Member
Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 13 
Hi Jonas,
you did not explain which problem you are facing so I just try to guess. The only problem I had to implement the code in the C file was that you use an already calculated field (alpha1) in a laplacian so you have to calculate it as an explicit: Code:
fvc::laplacian(DC, alpha1) Let me know if you solved the problem. cheers 

April 9, 2014, 23:28 

#29 
Member
Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 13 
Sorry, I forgot to specify that DC is a new variable defined as the product between the diffusion coefficient and the equilibrium concentration.


November 25, 2014, 10:38 

#30 
New Member
Lu ZHOU
Join Date: Jul 2014
Location: Lyon, France
Posts: 12
Rep Power: 9 
Hello Luca,
I am doing a simulation with interFoam and I would also like to add a concentration equation (the concentration of sediment actually) into the solver. The problem is similar as yours which is that I want the concentration in the air to be zero and the equation only be solved in the water zone. Reading this thread gives me a lot of help. I just want to ask how did you define the equilibrium concentration at the interface ? As the concentration in air is zero and the concentration in water is unknown and to be calculated ... Maybe I don't understand correctly...Can you please help me with this problem ? Thanks ! 

November 25, 2014, 13:19 

#31 
Member
Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 13 
Hi Izhou!
First of all, if you're dealing with suspended solids, I seem to recall that a multiphase interFoam is available where you can model them. Did you give it a shot? Anyway, if you want to proceed with this approach, I will tell you what I did. I went through different approaches, the most correct of which is the one where you set the eq. concentration equal to the bulk concentration, to be solved for. As you correctly noticed. I was not able at first to compile or run the code, so I changed the approach and set it as a constant. I eventually succeeded but used that with the phase change. I was going to use this to calculate the mixing time and validating with an experiment so I made some assumptions:  whatever the initial pulse concentration, the interface concentration would be 0.  whatever the initial concentration, the interface concentration at t=t_mix would be exactly equal to the bulk concentration As you can see in the various screenshots, the liquid gas interface in an air lift reactor is on the top part (bubbles excluded) so I decided to approximate the interface concentration with the perfectly mixed concentration, that is the concentration attained after t_mix by using the initial NaCl in the pulse. This is an approximation but the error appears to be minimal when compared with a mixing time experiment in the actual reactor. If your concentrations are low enough and the instruments are sensitive enough to measure small pulses, you can actually verify this as I did and the result will not differ from the simulation. However, I don't know your situation and your simulation conditions so, the only thing is trying to set it up and verify if it works for you. If it doesn't, you should add C_eq=C as a variable and solve for it as usual. This is the case when you do have the phase change and the interface concentration is solved. I ended up with the equation (in the .cpp file): Code:
fvm :: laplacian ( alpha1 , C ) Let me know if you made it run successfully. Cheers Luca 

December 2, 2014, 09:02 

#32 
New Member
Lu ZHOU
Join Date: Jul 2014
Location: Lyon, France
Posts: 12
Rep Power: 9 
Hi Luca,
Thanks very much for your kindly help and I am sorry for the delay of my response. I have tried both of the ways you remanded and I have also looked into the "multiPhaseInterFoam". I'm not sure this solver can be used to solve my problem as it seems to me that the mixture of water and sediment is not the same as the mixture of water and oil.. Meanwhile, there is another solver called "settlingFoam" which seems to be interesting, but it does not include the free surface effect so I think I still have to use your method to solve this problem. My case is the water jet under a sluice gate as showed in fig.case. And I added the concentration equation into interFoam solver to calculate the suspended load concentration of sediment. I first set the Ceq as the concentration of sediment at steady state. During the development (fig.C1_development) it seems to cause a little error at the interface but after reaching steady state the result is fine(fig.C1_steady). So I thought the problem during the development is because the Ceq should be the same as the concentration at the interface. Then I set the value of Ceq as the C value at the interface as follow: Code:
surfaceScalarField Cf = fvc::interpolate(C); fvScalarMatrix CEqn ( fvm::ddt(C) + fvm::div(phiC, C)  fvm::laplacian(nuEff, C) ==  fvc::laplacian(nuEff*(Cf), alpha1) ); CEqn.solve(); Later in my case I have to add the falling velocity of the sediment into the concentration equation and the concentration at steady state will then no longer be uniform, so for now I will use the second way to implement the concentration equation...But I'll continue to look at this problem. And there is another question. I don't know what is the value of DC，which is the mass diffusivity, so I just use the effective viscosity...Is this reasonable ? Do you have any suggestions ? Thanks again for your reply and have a nice day ! Lu ZHOU Last edited by lzhou; December 4, 2014 at 10:22. 

July 28, 2016, 09:14 

#33  
New Member
Abbas Rahimi
Join Date: Jan 2013
Posts: 28
Rep Power: 11 
Quote:
I'm struggling with the same problem you did. I tried to used the steps you have provided to develop a new scalarTransportFoam to avoid diffusion of tracer into other phase. No success so far! Is there any chance you share the equations you put in scalarTransportFoam solver? Thanks and regards, Abbas 

July 29, 2016, 03:15 

#34 
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,265
Blog Entries: 1
Rep Power: 22 
Dear Abbas
look following papers: 1 A unified singlefield model framework for VolumeOfFluid simulations of interfacial species transfer applied to bubbly flows 2Numerical simulation of species transfer across fluid interfaces in freesurface flows using OpenFOAM
__________________
Telegram channel (https://telegram.me/openfoam4Iranian) My Weblog in Persian(http://openfoam.blogfa.com/) My Personal Website (http://nimasamkhaniani.ir/) 

July 29, 2016, 08:59 

#35 
New Member
Abbas Rahimi
Join Date: Jan 2013
Posts: 28
Rep Power: 11 
Thank you Nima for response. Have you tried the work in any of these papers?


July 30, 2016, 04:03 

#36 
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,265
Blog Entries: 1
Rep Power: 22 
yes, i did, it works
__________________
Telegram channel (https://telegram.me/openfoam4Iranian) My Weblog in Persian(http://openfoam.blogfa.com/) My Personal Website (http://nimasamkhaniani.ir/) 

July 30, 2016, 20:39 

#37 
New Member
Abbas Rahimi
Join Date: Jan 2013
Posts: 28
Rep Power: 11 
Is there any chance you share your code with me? My email is rahimi.abas@gmail.com


May 1, 2018, 07:06 

#38 
Member
K
Join Date: Mar 2018
Posts: 34
Rep Power: 6 
Hey voingiappone
It would be great if you could upload the code you used to fix this problem Thank you! Last edited by kuria; May 1, 2018 at 07:31. Reason: Incomplete reading of the thread 

November 26, 2020, 15:05 
mixing time tracer

#39  
New Member
roshan
Join Date: Dec 2019
Posts: 10
Rep Power: 4 
hi
I was wondering if you solved your problem or not. I had the same case, I want to calculate the mixing time. I created a new solver based on interFOAM and added a new transport equation. my problem is twopoint? I need to inject this tracer inside of domain, not at the inlet time of injection is not at the beginning, it applied at a specific time and specific duration How Can I do that? can you help me? Quote:


Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Momentum equation of interFoam?  cfdfans  OpenFOAM  10  May 9, 2018 02:43 
Solid/liquid phase change  fabian_roesler  OpenFOAM  10  December 24, 2012 06:37 
Adding a new term in momentum equation of Interfoam  udiitm  OpenFOAM  5  July 29, 2012 10:52 
compressible two phase flow in CFX4.4  youngan  CFX  0  July 1, 2003 23:32 
add user scalar in one phase  zhu  CFX  0  April 27, 2002 03:45 