CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Gmsh] empty boundry for interFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2011, 12:22
Default empty boundry for interFoam
  #1
Member
 
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15
billynoe is on a distinguished road
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.
billynoe is offline   Reply With Quote

Old   March 9, 2011, 11:29
Default
  #2
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
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
gwierink is offline   Reply With Quote

Old   March 9, 2011, 12:14
Default
  #3
Member
 
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15
billynoe is on a distinguished road
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.
billynoe is offline   Reply With Quote

Old   March 9, 2011, 12:57
Default
  #4
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
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
gwierink is offline   Reply With Quote

Old   March 9, 2011, 13:28
Default
  #5
Member
 
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15
billynoe is on a distinguished road
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.
billynoe is offline   Reply With Quote

Old   March 9, 2011, 13:50
Default
  #6
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
I think in your case you can just do

Code:
cp $FOAM_TUTORIALS/multiphase/interFoam/laminar/damBreak/system/setFieldsDict system/
in your case directory. Then adjust the box area in system/setFieldsDict and set the fields to 1 and 0 in the appropriate areas and simply type
Code:
setFields
in your case directory.
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   March 10, 2011, 05:03
Default
  #7
New Member
 
Mark Beal
Join Date: Feb 2011
Posts: 24
Rep Power: 15
msbealo is on a distinguished road
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
msbealo is offline   Reply With Quote

Old   March 10, 2011, 11:54
Default
  #8
Member
 
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15
billynoe is on a distinguished road
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.
billynoe is offline   Reply With Quote

Old   March 10, 2011, 13:38
Default
  #9
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
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
gwierink is offline   Reply With Quote

Old   March 10, 2011, 17:20
Default
  #10
Member
 
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15
billynoe is on a distinguished road
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.
billynoe is offline   Reply With Quote

Old   March 11, 2011, 00:41
Default
  #11
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
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")
);
and define DC for different phases, just before the transport equation

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
gwierink is offline   Reply With Quote

Old   March 11, 2011, 11:49
Default
  #12
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Quote:
Originally Posted by gwierink View Post
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;
    }
}
Much more efficiently done by DC = alpha * DCwater + (1 - alpha) * DCair
akidess is offline   Reply With Quote

Old   March 11, 2011, 14:09
Default
  #13
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
Hi Anton,

Yep, good point, you live and you learn hehe
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   March 14, 2011, 15:50
Default
  #14
Member
 
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15
billynoe is on a distinguished road
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.
billynoe is offline   Reply With Quote

Old   March 15, 2011, 01:01
Default
  #15
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
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;
Instead of pRefPoint you can also set a pRefCell. If you would like (or need) to set up a pressure field as an initial condition you can run the case with potentialFoam to get an initial guess for pressure. PyFoam has a handy tool for that called pyFoamPotentialRunner.
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 10:17.