|
[Sponsors] |
March 2, 2011, 12:22 |
empty boundry for interFoam
|
#1 |
Member
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15 |
I am trying to use a gmsh mesh in OpenFoam for interFoam solver. Basically the two fluids water and air in my case need to be separated by a boundary patch. I made the mesh in gmsh with the boundary as a physical surface. then when I do gmshToFoam it recognizes the patch exists but it is always empty ie. it has no faces so it cannot be used by foam. the two volumes between the interface were defined as separate physical volumes as well. does anyone have experience with interFoam and gmsh that can give me some help.
|
|
March 9, 2011, 11:29 |
|
#2 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi William,
After your PM I'll continue here for the forum. I am not sure if I understand what you are trying to do. From your post it seems that you want to separate the two phases by a patch. If the patch is empty, flux will simply flow through it. If you want to separate phases with a patch, what do you want the patch to do? What is the physical idea?
__________________
Regards, Gijs |
|
March 9, 2011, 12:14 |
|
#3 |
Member
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15 |
My geometry is shown here I added a block on top to represent the air. My problem is the interface patch is empty. So I can't specify initial constraints on the interface. I'm pretty sure it is empty because it is an internal edge that is not an outside boundary. I want to simulate flowing water exposed at the surface to air and constrained by gravity. maybe interFoam is the wrong solver for this. In the future I would eventually like to simulate the transfer of oxygen into the water.
|
|
March 9, 2011, 12:57 |
|
#4 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
So you have a kind of cake slice, is that correct? And you put another cake slice on top for the air? What kind of constraint do you want to apply? A membrane? If you just want air on top of water, I would just make the cake slice wtice as high and use setFields to define where is water and where is air.
__________________
Regards, Gijs |
|
March 9, 2011, 13:28 |
|
#5 |
Member
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15 |
It is a wedge with radial symmetry. Yes it is just air on water. I will look into setFields I'm not familiar with this function yet. Thank you.
|
|
March 9, 2011, 13:50 |
|
#6 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
I think in your case you can just do
Code:
cp $FOAM_TUTORIALS/multiphase/interFoam/laminar/damBreak/system/setFieldsDict system/ Code:
setFields
__________________
Regards, Gijs |
|
March 10, 2011, 05:03 |
|
#7 |
New Member
Mark Beal
Join Date: Feb 2011
Posts: 24
Rep Power: 15 |
billynoe,
Thanks for the PM. I think gwierink is correct. Unless you want something specific at the interface (i.e. a membrane), then setFields is the way to separate air and water. The damBreak or floatingObject tutorial are good examples of setting air/water interfaces where you want them. Mark |
|
March 10, 2011, 11:54 |
|
#8 |
Member
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15 |
Thanks guys I appreciate the help. One more question how hard would it be to simulate diffusion across the interface based on concentration in the fluid.
For example I have an equation which relates the diffusion rate of the gas to the concentration of the gas in the liquid. basically rate=e^(-a(concentration)) which I derived. It has a good fit to experimental data, but it might not be technically correct. |
|
March 10, 2011, 13:38 |
|
#9 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi William,
If you're talking about the same gas (i.e. the air next to the water and not some third gas) (another gas could be a scalar that is transported, then you can implement Fick's law straight away) interFoam doesn't use diffusion as such. It's of course possible, but probably some work to implement interfacial diffusion in interFoam. Perhaps interPhaseChangeFoam or cavitatingFoam are a better base to work with, or perhaps use twoPhaseEulerFoam for an entirely different approach ...
__________________
Regards, Gijs |
|
March 10, 2011, 17:20 |
|
#10 |
Member
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15 |
thanks Gijs I'll look into those. The gas is air but the equation relates to the oxygen diffusion and dissolved oxygen concentration in water.
|
|
March 11, 2011, 00:41 |
|
#11 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Alright, so if it's a concentration of oxygen in water, you could model that as a tracer concentration. The tracer can then also be defined in the air, with different diffusivity of course. If you like this idea, have a look at "How to add temperature to icoFoam". There, a scalar field T is added and transported around according to a transport equation with given diffusivity coefficient. You could do the same, but replace "T" with "Coxygen" or something like that and define different diffusivity coefficient for different phases. that is, put DCair and DCwater as oxygen diffusivity coefficient for air and water, respectively, in the transportProperties dictionary. Then, add these to createFields.H:
Code:
dimensionedScalar DCair ( transportProperties.lookup("DCair") ); dimensionedScalar DCwater ( transportProperties.lookup("DCwater") ); Code:
forAll(alpha1, cellI) { if (alpha1[cellI] < 0.5) { // Define diff. coeff. in air DC = DCair; } if (alpha1[cellI] > 0.5) { // Define diff. coeff. in water DC = DCwater; } }
__________________
Regards, Gijs |
|
March 11, 2011, 11:49 |
|
#12 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
||
March 11, 2011, 14:09 |
|
#13 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi Anton,
Yep, good point, you live and you learn hehe
__________________
Regards, Gijs |
|
March 14, 2011, 15:50 |
|
#14 |
Member
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15 |
Thanks for the tips. I got the phases figured out, but the solution keeps crashing. I think I have the wrong boundary conditions. The DO modeling will have to wait until I get the basic model worked out. Should I need to specify the Pressure of the gas 101.3KPa and if so how do I do this?
Last edited by billynoe; March 14, 2011 at 16:58. |
|
March 15, 2011, 01:01 |
|
#15 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
You can set a reference pressure and a reference point in the PISO parameters in system/fvSolution:
Code:
pRefPoint (0.51 0.51 0.51); pRefValue 0;
__________________
Regards, Gijs |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Floating point exception | cshsgy | OpenFOAM Running, Solving & CFD | 8 | August 31, 2023 08:39 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 18:57 |
[snappyHexMesh] sHM quality of multi-region | aminem | OpenFOAM Meshing & Mesh Conversion | 0 | April 16, 2015 11:38 |
how to use directed-mapped boundry condition | zqlhzx | OpenFOAM Running, Solving & CFD | 0 | January 16, 2014 13:06 |
How to model the NR eqns in a domain with empty space | Vasilis | Main CFD Forum | 1 | April 14, 2009 04:35 |