empty boundry for interFoam
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.
|
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? |
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.
|
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.
|
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.
|
I think in your case you can just do
Code:
cp $FOAM_TUTORIALS/multiphase/interFoam/laminar/damBreak/system/setFieldsDict system/ Code:
setFields |
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 |
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. |
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 ... |
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.
|
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 Code:
forAll(alpha1, cellI) |
Quote:
|
Hi Anton,
Yep, good point, you live and you learn hehe :D |
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?
|
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); |
All times are GMT -4. The time now is 18:08. |