CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   interFoam open channel (https://www.cfd-online.com/Forums/openfoam/96986-interfoam-open-channel.html)

Gildeh February 6, 2012 15:06

interFoam open channel
 
Hello every body,

I am pretty new in using of OpenFoam. I am trying to solve a problem with OpenFoam and I am using interFoam solver, laminar. However, I have problem in my inlet.
I think the problem should be in inlet boundary condition. I am modeling an open channel that at the top I have a small inlet which creates a water jet that comes down from air phase into the water phase.And I do not have outlet. But when I define my boundary conditions as below:
for 0/alpha1
inlet
{
type fixedValue;
value uniform 1;

}
and for 0/U
inlet
{
type fixedValue;
value uniform (4 0 0);
}
and for 0/P_rgh
{

type buoyantPressure;
value uniform 0;
}
I do not have a continuous water entry in the inlet. It looks like that at time 0 the condition is water but when the program runs it is just air in the inlet. How can I figure out this problem?
If any body knows what should I do, please let me know. Because I think this is a pretty simple problem and I am missing some small items maybe in boundary conditions that I can not see a continuous water flow in my inlet.

Thank you indeed in anticipation.

Gildeh

nimasam February 9, 2012 03:51

Hi
it seems, its something like filling a tank, am i right?
whats wrong?
could you put your result here?

Gildeh February 9, 2012 05:51

Hi Nima,

I could resolve that problem finally. However, yes, that was about filling a tank. I have another question now:
I want to model temperature convection-diffusion in my jet that is filling the tank. And I am using the interFoam solver. I think this solver solves continuity, momentum and VOF equations for flow and these are the equations that should be solved for T convection-diffusion as well (if I am wrong correct me please). So, I used http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam link that is how to add T field to icoFoam solver and could create T field in my interFoam problem. My question is that how this temperature affect the fluid density? Where should I define the density as a function of temperature for interForm solver? Because, when the jet comes into the tank with a lower temperature than the ambient water in tank (imagine a deltaT=50 degree) it should go down since its density is higher than the warmer water inside tank, but it does not!!! So, I think this temperature is not affecting the density.
Do you have any idea of this?

Thanks

Andrea_85 February 9, 2012 08:12

Hi,
here you can find an exhaustive thread about how to add temperature equation in interFoam. I've never tried it but maybe it could help you!

http://www.cfd-online.com/Forums/ope...interfoam.html

regards

andrea

wouter February 9, 2012 17:53

hi,

I am no expert but I think at least you should use a compressible solver to have different densities, so interFoam in not suited for this. :confused:

hope this helps,
Wouter

nimasam February 10, 2012 03:01

Quote:

Originally Posted by Gildeh (Post 343531)
Hi Nima,

I could resolve that problem finally. However, yes, that was about filling a tank. I have another question now:
I want to model temperature convection-diffusion in my jet that is filling the tank. And I am using the interFoam solver. I think this solver solves continuity, momentum and VOF equations for flow and these are the equations that should be solved for T convection-diffusion as well (if I am wrong correct me please). So, I used http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam link that is how to add T field to icoFoam solver and could create T field in my interFoam problem. My question is that how this temperature affect the fluid density? Where should I define the density as a function of temperature for interForm solver? Because, when the jet comes into the tank with a lower temperature than the ambient water in tank (imagine a deltaT=50 degree) it should go down since its density is higher than the warmer water inside tank, but it does not!!! So, I think this temperature is not affecting the density.
Do you have any idea of this?

Thanks

Hi dear hossein
interFoam considers both two phases as incompressible so you can not see density changes.
but in your simulation density varies with temperature, do u know how density changes with temperature?
look into compressibleInterFoam to find how to make density changeable!
but remember compressibleInterFoam is isotheram and density changes based on pressure variation

Gildeh February 13, 2012 15:36

Hi Andrea, Wouter and Nima
 
Thank you all for your responses. I was sick for a while and could not check here.
Andrea: thank you very much for this thread. I just looked at that and I should follow the procedures.
Wouter: My problem is an incompressible problem. In fact I have a stationary water with a specified temperature in the tank that another fluid with different temp. is coming into the tank from inlet, so the density of this fluid is different from that in the tank (density=function(T)). However, this is just an extra term in momentum equation that controls the density differences (this is buoyancy term in momentum equation).
Nima: Yes. I have a formula for my density that is a function of temperature and I can implement this equation in my solver that I am working on. But my question is (see below please):
All: Now, I added a field as T (for temperature) but I added this as a scalar that I think it is not correct. Because temperature will affect the turbulent flows. I am using RANS model (k-e model) in interFoam.
So, now I have the density formula as a function of temperature and I know where I should insert this formula in the solver. But, do not know how to add the temperature field in order to see its influence on the turbulence model. In face, now I am just considering the temperature as a scalar that diffusion-advection equation is being solved for that.
Please let me know if you have any idea. And I have to go and read the thread which Andrea mentioned here.

Thanks again.
Gildeh

wouter February 13, 2012 17:36

sorry to bother you again. You mention three phases now ( heavy water, light water, air) and a changing density (so compressible) and still you want to use interFoam (two phase incompressible):confused:.

regards
Wouter

nimasam February 14, 2012 02:51

i think you may add some thing like Boussinesq term in your momentum term to consider the density variation due to temperature! however if you want to know the effect of temperature on turbulence model, i suggest you to look at turbulence model, in heat transfer solvers in OpenFOAM

Gildeh March 28, 2012 11:34

Hi again
 
Dear Friends,

I was pretty busy with my semester work and now come back to OF. I finally could change the boundary conditions in the dam break in order to simulate my problem by using the InterFoam. I also could change the solver as we discussed above.
Now, I want to change the turbulence model and see the effect of different turbulence models. There are two directories within the Constant folder that are related to turbulence mode:
1. turbulenceProperties: that includes this line:
"simulationType RASModel;"
I think, here we choose the model that RASModel is in this case.
2. RASProperties: that includes these 3 lines:
RASModel kEpsilon;
turbulence on;
printCoeffs on;
And I think here, it introduces the RAS type that KEpsilon is here.

Now I have these questions:
1. I want to see the other RAS types, (see all the list here http://www.openfoam.com/features/RAS.php),I am actually interesting to apply two RAS turbulence models for incompressible fluids:
LRR Launder-Reece-Rodi RSTM
LaunderGibsonRSTM Launder-Gibson RSTM with wall-reflection terms
Now, I want to know what should I change?
I guess that I have to change 2 directories out of 3 below:
1. turbulunceProperties
2. RASProperties
3. 0

1. turbulenceProperties: that includes this line:
"simulationType RASModel;"
I think, I should not change any thing here since the two above-mentioned models are within the RAS model.
2. RASProperties: that includes these 3 lines:
RASModel kEpsilon;
turbulence on;
printCoeffs on;
And for this directory, I believe that I should change the KEpsilon to LRR.

But that should not be the only things to change. I have to create 2 (or more?!) folders for initial and boundary conditions in 0 directory (instead of k and epsilon for KEpsilon case).
Now, I want to know:
1. Are the first and second steps (within turbulenceProperties and RASProperties) true as I mentioned above??!!
2. If yes, what files should I create in 0 directory for the two above-mentioned RAS models which I want to implement instead of KEpsilon model? (Now that I am using KEpsilon, there are 2 files, k and epsilon).

Thank you all if you can help me.

Cheers,
Gildeh

flowris March 29, 2012 04:36

Indeed, you need to add these files:
- constant/turbulenceProperties
- constant/RASProperties
- 0/k
- 0/epsilon

And you also have to add some lines in
- system/fvSolution
- system/fvSchemes

Take a look at the tutorial $FOAM_TUT/multiphase/interFoam/ras/damBreak, an interFoam RAS case.

Pallav March 29, 2012 05:10

Hi All,

I am working on a similar dambreak tutorial (filling a tank).

I need to alter the case file slightly and allow the water to flow for only 0.5 seconds at a velocity of 300 m/s in the -Y direction into an open tank filled with air.

So I edited the inlet properties in 0/U file as follows:

Code:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField  uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value          uniform (0 -300 0);
    }



Can you please tell me what changes should I make to the inlet to add a time constraint?

Andrea_85 March 29, 2012 05:58

Hi,
You can simply use a time dependent inlet velocity boundary condition. Make a search on the forum, there are a lot of posts about that.

best
andrea

Pallav March 30, 2012 02:10

Thanks Andrea.

Can I also just run the simulation with U (0 -300 0) for 0.5 secs and then restart the simulation from latestTime with U ( 0 0 0) ??

flowris March 30, 2012 02:34

Pallav,

That is also possible. Before starting the second part of the simulation, change startTime and endTime in the controlDict.

Andrea_85 March 30, 2012 03:26

Hi,
yes you can. If you want more info about how use unsteady BC, have a look here http://albertopassalacqua.com/?p=69 (thanks to Alberto Passalacqua).

best
andrea

Pallav March 30, 2012 05:12

Joris and Andrea,

Thanks a lot.

libia87 June 19, 2012 03:48

Hi!
I'm trying to add concentration following the tutorial "how to add temperature to icoFoam", but I'm using buoyantboussinesqPimpleFoam and it doesn't work, anyone knows why??
when I do the WMAKE appears that error:

make: *** [Make/linux64GccDPOpt/my_buoyantBoussinesqPimpleFoam.o] Error 1

I don't know why the file is not created...


All times are GMT -4. The time now is 19:41.