|
[Sponsors] |
June 11, 2005, 12:33 |
Hello,
I would like to model
|
#1 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Hello,
I would like to model the dispersion of pollutants (non-reacting) in the environment (air). The air flow is described as a turbulent ideal gas. Species transport is described with the usual set of y equations. Species properties should be user-defined. I'm not familiar with the species transport model in OpenFOAM. I had a look to dieselFoam, but I have some doubt on how to manage species in OpenFOAM. Is there some example where this is shown? Thank you for your attention. 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. |
|
June 11, 2005, 12:59 |
Take a look at scalarTransport
|
#2 |
Guest
Posts: n/a
|
Take a look at scalarTransportFoam which shows the implementation of a simple passive scalar in a fixed flow field. However probably the best example is the ft equation in the combustion codes (XiFoam, engineFoam), take a look at ftEqn.H which is a simple transport equation for a passive scalar (ft) in the turbulent flow-field.
|
|
June 11, 2005, 22:12 |
Thank you for your answer.
My
|
#3 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Thank you for your answer.
My problem is not with the transport equation, but with the managment of a mixture of more than two components. If I'm not wrong, I found something similar to what i need in the YEqn.H of dieselEngineFoam and in reactingFoam, where a set of Yi equation is solved. What I don't understand is how species are defined and how their properties (for example, laminar diffusivity, which doesn't seem to be anywhere ) are passed to the solver. dieselFoam reads from a CHEMKIN file, but can species be defined without using it? If so, how? If I didn't misunderstand, in dieselEngineFoam, and similarly in XiFoam, the following lines should do the job reading from the thermophysicalProperties dictionary: Info<< nl << "Reading thermophysicalProperties" << endl; autoPtr<hcombustionthermo> thermo ( hCombustionThermo::New(mesh) ); combustionMixture& composition = thermo->composition(); ptrList<volscalarfield>& Y = composition.Y(); word inertSpecie(thermo->lookup("inertSpecie")); But in that dictionary there are the definitions of the fuel, oxidant, ... with parameters which are not required in my case. I just have one or more non-reacting species, and I need to set the basic transport properties (laminar diffusion included). Is there a way to manage it, or is it something to be implemented? Best 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. |
|
June 12, 2005, 05:33 |
Hi,
in diesel(Engine)Foam t
|
#4 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
Hi,
in diesel(Engine)Foam the Schmidt number is assumed to be 1, i.e mass-diffusion equals the momentum diffusion. Hence, its not necessary to define the diffusion for the species. Since laminar diffusion is much smaller than the turbulent diffusion this is acceptable for these codes. So if you want to specify your own laminar diffusion you have to so yourself. You're solving for a turbulent flow, so i would say that the Sc=1 assumption holds pretty well for you also, but if you want to have something else you could add the division of user defined Sc-number for each specie. The chemkin file specifies the NASA polynomial coefficients for the species, have a look at for instance this page http://diesel.me.berkeley.edu/~gri_m...nasa_plnm.html , if you want to know more about what they do. They are only necessary for calculating the temperature from the enthalpy and if you have a non-reacting environment with a constant temperature you dont need to define this. Then you could just skip the thermo-stuff and define the Yi's yourself as a ptrList<volscalarfield>. N |
|
June 12, 2005, 09:32 |
Thank you Niklas.
The assum
|
#5 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Thank you Niklas.
The assumption of using only the turbulent diffusion is OK in my case in an open environment, where the wind plays the biggest role. I don't think so in a closed one. Temperature is not necessarily constant, expecially in the case of pollutants released as a consequence of accident, so I need to solve the energy equation. Usually gases are supposed to be ideal however. 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. |
|
June 23, 2005, 14:47 |
Alberto,
I think you and I ar
|
#6 |
Member
David Segersson
Join Date: Mar 2009
Posts: 39
Rep Power: 17 |
Alberto,
I think you and I are trying to solve similar problems. However, I'm still trying to get the wind field right and haven't included dispersion of species (I will as soon as I'm satisfied with the wind field simulations). It would be interesting to hear of your exepriences when your ready. Regards David |
|
June 23, 2005, 17:49 |
Sure David.
I didn't implem
|
#7 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Sure David.
I didn't implement the wind profile. However there are two threads on inlet profiles here: http://www.cfd-online.com/OpenFOAM_D...ages/1/42.html http://www.cfd-online.com/OpenFOAM_D...ages/1/63.html I will move them to the wiki (The links to the code in these threads are not active, please, can someone send the snipplet so I can add them to the wiki? Feel free to use my email alberto.passalacqua@tin.it ). The species transport equation are quickly implemented, expecially if you neglect the laminar diffusion (It seems your case). All this is still done in dieselFoam and reactingFoam. I had to add the laminar diffusion for a particular application, but it was easy because I was considering a single pollutant in the air. I have some time in these days, I will work a bit on the wiki and I could clean the code. Feel free to e-mail me.
__________________
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. |
|
July 7, 2005, 18:36 |
Thank you Alberto!
You have d
|
#8 |
Member
David Segersson
Join Date: Mar 2009
Posts: 39
Rep Power: 17 |
Thank you Alberto!
You have definitely saved me some work. I'll try to follow your example as soon as I'm redy with the wind simulations. I'm trying to introduce vegetation in my wind simulations (as a drag term in the momentum equation). I've done it before using Fluent, so I'm quite sure it will work out fine. The trickiest part seems to the initialization of the vegetation data field.. If you are interested I'll send you the code when I'm ready. Regards David |
|
July 7, 2005, 18:56 |
Yes it would be very useful to
|
#9 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Yes it would be very useful to see the code and to put it on the wiki.
For initialization, there is an example of patching utility in the manual, where the dam break is presented. I plan to add multiple species diffusion as soon as I have some time. However, if you need the code, I can send it to you. 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. |
|
August 2, 2005, 22:24 |
Hello,
I'm trying to add mult
|
#10 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Hello,
I'm trying to add multiple species to the solver but I have some doubt on the usage of the ptrList. I defined a ptrList of volScalarField and I called it Y. How can I set the MUST_READ and the AUTO_WRITE options for the whole list of fields? Also, I have to read a list of diffusivities from a dictionary, and store it in a vector of scalars. I was thinking to define a prtList<dimensionedscalar> Dl and to fill it by reading from the dictionary, but I'm not sure how I can do it. Is something like ptrList<dimensionedscalar> Dl ( speciesProperties.lookup("Dl"); ); possibile? Thanks in advance for your answer, 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. |
|
August 3, 2005, 04:11 |
Hi,
Have a look in
OpenFOA
|
#11 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
Hi,
Have a look in OpenFOAM/OpenFOAM-1.2/src/thermophysicalModels/combustion/mixtureThermos/mixture s/combustionMixture/combustionMixture.C There we define a default-field, which is used to set every specie that is not defined. Typically we just want to set N2, O2 and use the default-setting for the rest. N |
|
August 3, 2005, 23:06 |
Thank you Niklas.
Defining
|
#12 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Thank you Niklas.
Defining a speciesTable, I can store the names of the species (I don't actually need this, but it makes the solver more user-friendly and the results easier to be read) and use its size to set the species ptrList size and set the Yi fields and their options. Now, the speciesTable constructor requires a wordList as argument, containing the species names. I tried to read it from the speciesProperties dictionary using: wordList speciesNames ( speciesProperties.lookup("speciesNames"); ); but the solver doesn't compile giving errors. Is there any way to read a list from a dictionary in OpenFOAM? P.S. Hehe OpenFOAM/OpenFOAM-1.2/src/... ;-)
__________________
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. |
|
August 4, 2005, 05:28 |
Hey,
If you get a compiler
|
#13 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
Hey,
If you get a compiler error it would be useful to see it, however, the semi-colon after speciesProperties should be removed if you have copy/pasted your code. also you dont need a ptrList for the diffusivities, a simple List<...> should work, i'm not sure if the ptrList will work. N |
|
August 4, 2005, 14:49 |
Sorry. It's a typo again.
The
|
#14 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Sorry. It's a typo again.
The actual code is: List<dimensionedscalar> Dl ( speciesProperties.lookup("Dl") ); //This is line 58 in createFields.H but the error is the same.
__________________
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. |
|
August 4, 2005, 15:07 |
List of anything requires the
|
#15 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
List of anything requires the anything to have a null constructor (which dimensionedScalar does not have)
Use ptrList in combination with hook(...) to create an indexable list. There should be some examples already posted. |
|
August 4, 2005, 16:19 |
OK. But hook() just adds an el
|
#16 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
OK. But hook() just adds an element at a time to the ptrList.
What I'd like to do is to let the user set the number of species, their name and then insert the diffusivities. The speciesTable manages the names of the species, and I was thinking to store the ordered list of diffusivities in a list like Dl ( Dl_0 Dl_1 Dl_2 ... ); in the speciesProperties dictionary. Now, if I use the ptrList, the problem of reading the list remains. 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. |
|
August 4, 2005, 17:15 |
I see your problem.
1. exte
|
#17 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
I see your problem.
1. extend dimensionedScalar to have a clone and INew functions so it can be used with ptrList. 2. define your own class that reads all the info and can be used in a ptrList/List and then construct List<dimensionedscalar*> (and make sure you delete any allocated dimensionedScalars) |
|
October 5, 2005, 12:03 |
Hello Alberto & David,
I'm
|
#18 |
New Member
Ramiro Brito Willmersdorf
Join Date: Mar 2009
Location: Recife, Pernambuco, Brasil
Posts: 15
Rep Power: 17 |
Hello Alberto & David,
I'm also interested in pollutant dispersal in the atmosphere, and I'm re-implementing your work described above. One thing I'd like to wonder aloud, though, is that, as far as I can see, a model using OpenFOAM would be realistic only for short(ish) distances, no? I think (this *really* is not my area, so please correct me if I'm wrong) that the turbulence in the atmosphere is not only due to the friction with the ground, which OpenFOAM can model easily, but mostly due to the stability conditions of the atmosphere, which, even though it's all cfd in end, would need *a lot* more input and physics that we (I at least) would be willing to add. Not so long ago, I checked the Weather Research and Forecast Model (http://www.wrf-model.org/index.php), which I thought could be a nice basis for this kind of work (fortran 90, though, I think.) I'll do this when I buy a clone of myself to get some extra free time... |
|
October 7, 2005, 08:50 |
Hello,
dispersion models toge
|
#19 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Hello,
dispersion models together with k-eps turbulence models are commonly used to predict the diffusion of pollutants in limited portions of athmosphere like a part of a city where an accident happened and so on. They are adopted in specific codes like FLACS too. 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. |
|
October 7, 2005, 17:23 |
Hi Alberto,
I should certai
|
#20 |
New Member
Ramiro Brito Willmersdorf
Join Date: Mar 2009
Location: Recife, Pernambuco, Brasil
Posts: 15
Rep Power: 17 |
Hi Alberto,
I should certainly hope so, since I'm doing the very thing myself! I'm just curious about the range where atmospheric turbulence starts to be more relevant. I'm not sure I'd feel too confortable with a simple k-epsilon model at distances over one kilometer (a nice round number . Are there any guidelines for this? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pollutant dispersion | Andy | CFX | 1 | August 26, 2007 19:41 |
Simulation of pollutant dispersion in a city | George | Siemens | 1 | June 27, 2007 05:26 |
pollutant source | J.Z | Phoenics | 2 | April 3, 2007 19:33 |
pollutant source | Riccardo Buccolieri | FLUENT | 0 | January 22, 2005 04:38 |
pollutant source | Riccardo Buccolieri | FLUENT | 0 | January 20, 2005 05:06 |