CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Tracing a gas in a gas

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 7, 2007, 07:02
Default Hi, This may be a stupid qu
  #1
Member
 
Lasse Boehling
Join Date: Mar 2009
Posts: 35
Rep Power: 17
lasb is on a distinguished road
Hi,

This may be a stupid question, but here it comes:

I want to simulate a gasrelease.

How do you control an inlet so it is gas coming in instead of air?

And how do you track the evolution/mixing of the gas with the air?

All help will be much appreciated.

Regards,
Lasse
lasb is offline   Reply With Quote

Old   August 7, 2007, 08:52
Default What you want to do is tracing
  #2
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
What you want to do is tracing a passive scalar inside your domain.

To do so, you have to add a transport equation for that scalar to the code you're using and solve for it too.

To manage the boundary conditions, you do as for all other variable. You need to create a file in the 0 directory named as the variable and containing the boundary conditions for the scalar.

You can find al example of this, for more complex applications, in OpenFOAM-1.4/applications/solvers/combustion/reactingFoam

Regards,
Alberto
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   August 7, 2007, 09:06
Default Or even easier (if your flow f
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Or even easier (if your flow field is stationary):
* get a stationary solution with simpleFoam
* use scalarTransportFoam on that to transport non-air
(this assumes, that the injected gas doesn't modify the flo behaviour)

or

* use twoLiquidMixingFoam (but I'm not sure about the assumptions this solver makes)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   August 7, 2007, 09:38
Default Yes. Forgot the first possibil
  #4
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Yes. Forgot the first possibility, which is a lot faster.

About twoLiquidMixingFoam, it's a multiphase solver (VOF based) which assumes a diffusivity of a phase into the other to model phase mixing.

Regards,
Alberto
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   August 8, 2007, 05:54
Default Thanks for the inputs, The
  #5
Member
 
Lasse Boehling
Join Date: Mar 2009
Posts: 35
Rep Power: 17
lasb is on a distinguished road
Thanks for the inputs,

The scalarTransportFoam is now working with simpleFoam :-)

TwoLiquidMixingFoam is a multiphase solver and assumes diffusivity. That's exactly what I want, but I don't have two different phases. It is a gas mixed with air. And I can't make the assumption that the injected gas does not change the flow behaviour.

Somehow I need to control the injection of the gas, so the inlet is another gas and then see how the flow evolves in time.

Do you think bouyantSimpleFoam does the job?
Anyways, I will look into twoLiquidMixingFoam and bouyantSimpleFoam.

Cheers,
Lasse
lasb is offline   Reply With Quote

Old   August 8, 2007, 09:57
Default Hello, if you inject a gas in
  #6
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Hello,
if you inject a gas into a gas, you have a single phase, so using a multiphase solver is not what you need.

If you inject the gas into the main flow, it brings momentum and mass into the system. That's all. If you use an inlet BC to do the injection, this effect is already taken into account.

Are there temperature gradients in your system? If so, you need to solve the energy equation too.

Regards,
Alberto
granzer and qwertz like this.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   August 8, 2007, 10:52
Default Lasse, all you need is the abi
  #7
New Member
 
Sreekanth Pannala
Join Date: Mar 2009
Posts: 6
Rep Power: 17
pannala is on a distinguished road
Lasse, all you need is the ability to track multiple species (Air and whatever tracer gas you want to track). I am not sure about all the solvers in OF but reactingFoam without reactions will do your job. You do not need a multiphase solver as you still have only one gas phase.

Hope that helps,

Sreekanth
wayne14, granzer and altinel like this.
pannala is offline   Reply With Quote

Old   August 8, 2007, 10:53
Default Hi, There is no temperature
  #8
Member
 
Lasse Boehling
Join Date: Mar 2009
Posts: 35
Rep Power: 17
lasb is on a distinguished road
Hi,

There is no temperature gradient in the system. But the gas injected is 17 times lighter than air so I need to compute a new density in every timeloop.

An inlet Boundary Condition sounds like what I need. Sorry for my ignorance, but how do you customize the inlet so it is a different gas? Or how do I set the physical data for the inlet flow?

Regards,
Lasse
lasb is offline   Reply With Quote

Old   August 8, 2007, 10:55
Default Hi Sreekanth, Thanks for th
  #9
Member
 
Lasse Boehling
Join Date: Mar 2009
Posts: 35
Rep Power: 17
lasb is on a distinguished road
Hi Sreekanth,

Thanks for the advice. I'll have a look at reactingFoam (without reactions).

Regards,
Lasse
lasb is offline   Reply With Quote

Old   August 16, 2007, 11:03
Default Hi, I'm sorry, but I have t
  #10
Member
 
Lasse Boehling
Join Date: Mar 2009
Posts: 35
Rep Power: 17
lasb is on a distinguished road
Hi,

I'm sorry, but I have to take this thread up again.

I know how to trace a passive scalar, but I still need to set the thermophysical properties at the inlet so it is another gas.

Do I have to use reactingFoam (without reactions) to do that? Or can another solver do the job?

I can't see how to customise the inlet. I can set the scalarquantity to a value, but that doesn't change the flowbehaviour.

If there's an easier way to do it, I will be glad to know. (reactingFoam looks a little complicated..)

Regards,
Lasse
lasb is offline   Reply With Quote

Old   September 11, 2007, 03:15
Default Well, the suggestion that I fo
  #11
Member
 
Prashant Ojha
Join Date: Mar 2009
Posts: 38
Rep Power: 17
prashant24983 is on a distinguished road
Well, the suggestion that I found was to add a new scalar trasport equation to buoyantFoam solver. The basic idea is to make a solver similar to buoyantFoam which you can accomplish by copying the base buoyantFoam solver and then extract the relevant parts from scalarTransportFoam and add them to your solver, finally add the transport equation at the end of the time-loop...

As there is no reactions involved, I wouldn't advice you to use reactingFoam. I am working on the same advice, I will paste the solver once I am done!
prashant24983 is offline   Reply With Quote

Old   October 15, 2007, 15:30
Default Dear Prashant, how's your p
  #12
Member
 
sradl's Avatar
 
Stefan Radl
Join Date: Mar 2009
Location: Graz, Austria
Posts: 82
Rep Power: 18
sradl is on a distinguished road
Dear Prashant,

how's your progress with your buoyantFoam solver including scalar transport?

I'm also interesting in developing a similar solver (injection of a heavy gas into air)- so if we can help with programming/testing we will help.

br
Stefan
sradl is offline   Reply With Quote

Old   October 16, 2007, 05:22
Default Hello Stefan, I have compi
  #13
Member
 
Prashant Ojha
Join Date: Mar 2009
Posts: 38
Rep Power: 17
prashant24983 is on a distinguished road
Hello Stefan,

I have compiled a software which I believe should work for most heat tranfer problems with different gaseous species. I used buoyantFoam as the base solver and then added the species transport equation to add n number of species as implemented in reactingFoam solver.

I have complied it and it works good for a 2D case but then it stops working in between in a sample 3D case. I was using the chemkin file to add the species properties. But the temprature of janaf thermo keeps going out of range.

Now, I am thinking of using multicomponentMixture class but I still haven't figured out how I should write the thermophysicalproperties for the same case. http://www.cfd-online.com/OpenFOAM_D...tml?1192448636

If you want I can send you the solver and you can have a look at it. May be the problem is not with thermophysicalproperties...

I had adressed the issue about multicomponentmixuture in a different thread but no replies

Send me your mail ID so that I can forward you the solver. Make sure the mail ID can handle large attachment...

Cheers!
Prashant
prashant24983 is offline   Reply With Quote

Old   October 16, 2007, 17:06
Default Hi Prashant and Stefan, I u
  #14
Member
 
Lasse Boehling
Join Date: Mar 2009
Posts: 35
Rep Power: 17
lasb is on a distinguished road
Hi Prashant and Stefan,

I used reactingFoam as a solver because it can handle thermophysical properties and mixing of n gases. I turned the solver off by eliminating the reactions from the Chemkinfile. (Don't know if it was necessary if you just say off to reactions.)

It worked and I checked the massbalance (fractions of each gas in each cell summed up to one in all cells) which looked like it should.

I had a similar problem with bouyantFoam with the temperature going out of range.

I'm pretty sure the reactingFoam solver handles the job with heavy gas into air. It worked for me injecting hydrogen into air. (I just mixed oxygen and nitrogen and neglected the small fraction of other species when simulating air.)

If you want I can post the solver, but it's reactingFoam just with no reactions. I used it simulating a hydrogen release in a garage.

Cheers,

-- Lasse
wayne14, DaveD!, adrieno and 1 others like this.
lasb is offline   Reply With Quote

Old   October 17, 2007, 00:06
Default Hello Lasse, ReactingFoam
  #15
Member
 
Prashant Ojha
Join Date: Mar 2009
Posts: 38
Rep Power: 17
prashant24983 is on a distinguished road
Hello Lasse,

ReactingFoam does serve the purpose, but for the particular case that I was working the temperature range again went out of limits. I had modified my case, shut the chemistry reactions off in reactingFoam and deleted the reactions from chemkin file.

Well from what I understand of your post, I just have to switch off the chemical reactions? The source term in transport equation will become zero and the reactingFoam will be doing exactly what I intend it to do.

If you made some more changes i reactingFoam solver then I would want to give it a look.

For this particular case I manage to get only 10-15 iterations done before the run crashes... I do not understand Janaf thermo. I thought multicomponenetmixture should be good for such cases instead of reactingFoam. But I do not understand how I should implement this class.

In the meantime, I was also wondering if the crash is caused by the the size of mesh? I haven't found a comprehensive explanation of Janaf Thermo and its implementation and it seems there is lot of hacking to be done.

please do send the solver at prashantojha@gmail.com
prashant24983 is offline   Reply With Quote

Old   October 17, 2007, 09:32
Default Hi all, Have you made very
  #16
Member
 
Michael Rangitsch
Join Date: Mar 2009
Location: Midland, Michigan, USA
Posts: 31
Rep Power: 17
mrangitschdowcom is on a distinguished road
Hi all,
Have you made very sure that your boundary conditions are correct? You need to be very sure the mass fractions of all the components sum up to 1.0 exactly. I had no ends of problems with the temperatures running away (for a non-reacting case) that were immediately fixed when I corrected the inlet mass fractions.

Good luck!

Mike Rangitsch
mrangitschdowcom is offline   Reply With Quote

Old   October 17, 2007, 09:56
Default I am using three species, O2,
  #17
Member
 
Prashant Ojha
Join Date: Mar 2009
Posts: 38
Rep Power: 17
prashant24983 is on a distinguished road
I am using three species, O2, N2 and CO. The mass fraction of O2 is set to 0.3 and 0.7 for N2 except at the source of CO where it is set to zero for both N2 and O2.

The internal field of CO is set to zero while at the CO inlet, the mass fraction is set at 1. Rest all patches are set to zeroGradient boundary condition.


O2

dimensions [0 0 0 0 0 0 0];

internalField uniform 0.3;

boundaryField
{
Vent_inlets
{
type zeroGradient;
}

Smokesource
{
type fixedValue;
value uniform 0;
}

Fans
{
type zeroGradient;
}
Walls
{
type zeroGradient;

}
}


N2

dimensions [0 0 0 0 0 0 0];

internalField uniform 0.7;

boundaryField
{
Vent_inlets
{
type zeroGradient;
}

Smokesource
{
type fixedValue;
value uniform 0;
}

Fans
{
type zeroGradient;
}
Walls
{
type zeroGradient;

}
}

CO

dimensions [0 0 0 0 0 0 0];

internalField uniform 0;

boundaryField
{

Vent_inlets
{
type zeroGradient;
}

Smokesource
{
type fixedValue;
value uniform 1;
}

Fans
{
type zeroGradient;
}
Walls
{
type zeroGradient;

}
}
prashant24983 is offline   Reply With Quote

Old   February 11, 2008, 08:43
Default Hi Lasse, I have a similar
  #18
Member
 
Jason Dale
Join Date: Mar 2009
Location: UK
Posts: 80
Rep Power: 17
jason is on a distinguished road
Hi Lasse,

I have a similar problem to your garage with Hydrogen. I want to release a quantity of H2 into the middle of a square room that has an inlet blowing air in and an outlet where the air/hydrogen mix can escape. There could also be a heat source in the room such as a radiator. I want to to be able to see how the hydrogen mixes with the air and monitor if the mixture in the room ever reaches flammable levels.

I was wondering if you have a small example that I could look at or even a copy of the solver that you mention, any info would be much appreciated.

Many Thanks

Jason
jason is offline   Reply With Quote

Old   November 16, 2009, 12:40
Default Example
  #19
New Member
 
Hyrum Fairbanks
Join Date: Nov 2009
Posts: 1
Rep Power: 0
Hyrum is on a distinguished road
I also have a similar problem. I would like to trace a methane release into the atmosphere with the ultimate goal of knowing the air/gas mixture at various elevations. I am really new to OpenFOAM but have got my geometry set up already. I would really like to see any examples that might help me or any hints. Could you please forward me anything you sent Jason?

Thanks
Hyrum
Hyrum is offline   Reply With Quote

Old   June 16, 2010, 07:49
Default Same problem
  #20
OMN
New Member
 
Olivier Macchion
Join Date: Jun 2010
Posts: 12
Rep Power: 16
OMN is on a distinguished road
Hello

I have also the same problem. I model a release of methane in a mixture of O2 and N2. I have kept the reactingMixture in the thermophysicalProperties dictionary, and I turn off reactions. But I end up with Janaf errors, where the temperature gets outside the range of the table. Does someone want to help?

Cheers

Olivier
OMN 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
solar ray tracing yosr FLUENT 0 January 29, 2009 11:40
VOF tracing rafal FLUENT 0 August 7, 2007 12:54
Particle tracing and Re Jackie CFX 8 August 12, 2003 00:12
Ray tracing Mark FLUENT 0 June 25, 2003 07:30
Ray-tracing mario Main CFD Forum 1 February 10, 2002 09:12


All times are GMT -4. The time now is 03:24.