Gas dispersion in air error message
Hello. This is my first post here (after some time lurking) so please be gentle.
I've recently picked up OF and am a novice to the tool. My case is dispersion of CH4 in an open environment exposed to wind. The domain is just an open box. So far I've set up a case with an inlet for wind from one of the sides, and a small inlet for gas at the floor. The scenario could be an offshore pipeline rupture from which gas(CH4 in my case) has leaked to the surface of the sea, and my task is to look at the dispersion of CH4 in air. So far the wind is working well, and I did configure the 'gas inlet' to a standard air inlet, just for starters. And up till now I've been using simpleFoam, taking pieces from motorBike and turbineSiting tutorials. Now here's my problem: I'm not able to implement the gas profile into my case. How to make the 'gas inlet' spew out gas instead of air? Any tutorial recommendations? I've been through several tutorials(ie. counterFlowFlame2D) but it has become a bit too much for me to handle. As mentioned, I am quite the novice, at best. Also, I recognize that I should throw simpleFoam, and instead use the likes of perhaps reactingFoam? Any help is greatly appreciated! Any help at all. If you want me to provide any info, I'll be happy to. Cheers, Lasse |
Gas dispersion in air error message
Hi. I'm running a reactingFoam case. kOmegaSST for turbulence, CH4 dispersion in air. no chemistry, no combustion. I get an error message that I'm not capable of interpreting, and was hoping maybe one of you guys were able to, or even if you could tip me on how to learn it. Anyways, here's the error:
Code:
#0 Foam::error::printStack(Foam::Ostream&) in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" |
update
So I've discovered it's about "bad mathematics", such as dividing by zero etc.
I tried to turn turbulence off because I thought that might be the issue, but the error message remains the same. I'm also trying to debug with dbg, not that I really know how, just trying.. |
laminar
I changed the simulationType to laminar and now the error message changed, so definitely the original one is connected to turbulence. However, the new one looks like this:
Code:
#0 Foam::error::printStack(Foam::Ostream&) in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" |
Greetings redhoax and welcome to the forum!
I've merged your first post into this thread, because it gives a very good background on what you're trying to achieve! Nonetheless, it would be helpful if you could share your case, or at least what steps you've taken to prepare said case. As for the latest error, it does indeed look strange, but very clear: something was divided by zero or infinite! If you feel that you will stumble into these issues very often, then I suggest you have a look into this wiki page: http://openfoamwiki.net/index.php/HowTo_debugging As for tutorial cases... the only ones I can think of are the "multiphase/twoPhaseEulerFoam" ones, but I'm not familiar enough with it to tell you that it is the solver you're looking for. Then there is this old thread: http://www.cfd-online.com/Forums/ope...g-gas-gas.html Best regards, Bruno |
Hello Bruno - and thank you for your response :)
I did discover those debugging pages late on friday, but haven't had the chance to test them out yet. I do not have the code available today, but I will certainly provide the case and explain my process of building it as soon as I have it before me. It's not supposed to be a two-phase problem. I have been recommended reactingFoam with reactions turned off. I guess this will enable later development (if I or anyone else see fit) with regards to implementation of ignition sources for possible combustion etc. Thank you for the link to that old thread. I'll look into it. Regards, Lasse |
rough work log
Im using OF21x and Salome 6.4.
Case setup is like this: I have a mesh from Salome. It's an open space with a 'platform' in it (4xcylinder for legs, 1xbox on top, and 1 last cylinder for gas leak inlet under platform). I imported this mesh into the motorBike tutorial. I thought this would be a good starting point. I've used simpleFoam. I got this to work. Air flow through domain, around and about platform structure: OK. Then I went on to get ABLConditions from the turbineSiting tutorial to form some sort of wind profile instead of a plain air inlet. Got this to work as well(I think..). It converged anyway and looked nice in paraFoam. Still solving with simpleFoam. The mesh also includes a cylindrical inlet at the bottom of the domain, centered under the platform. I've kept this as a 'wall' up until this point to keep it as simple as possible. Now I it's time to turn it into a patch and the inlet for CH4. And to move on I've been recommended reactingFoam without reactions (for various reasons, one being further case development). From here on I use the counterFlowFlame2D tutorial as working case (a copy of it, surely). I set chemistryProperties off and combustionProperties false. I set gravity to -9.81 and T to 293 for all. Case still runs. So now I decided to import my own mesh. The motorBike tutorial uses kOmegaSST, but counterFlowFlame2D uses kEpsilon. I'm not sure which one I should use in my case, but I figured usingkOmegaSST would be simplest for some reason(calculations?). So, trying to run it I first encountered the initial error, posted first here. So I set simulationType laminar; just to see if that was it. Then the second error I posted came up. This is roughly where I'm at now. I'll try to compile and debug. I just want to add that I'm trying with some other mesh also, I'll keep you posted. |
Hi Lasse,
You forgot to mention what specific values you are using for pressure! In addition, it would help to know what was the text prior to the stack dump! edit: what does checkMesh tell you about your own mesh? Best regards, Bruno |
steady state. specific value for pressure is set to 0 m^2/s^2.
Code:
internalField uniform $pressure; The mesh is made in Salome and is 100% tetrahedrons(used NetGEN algorithm). Results from checkMesh look like this: Code:
Checking geometry... EDIT: I should mention also that this means modifying reactingFoam into steadystate, as the tutorial case is transient. I would provide the entire case if you like. Upload to a website or zip and mail it? Regards, Lasse |
Hi Lasse,
:eek: Check your mesh units first!! Does your domain really have 600 x 300 x 120 meters? Quote:
But if it's meant to be in meters... you can use Dropbox or something similar ;). Best regards, Bruno |
Hehe. It is meant to be in meters. The reason for this is, apparently, it is customary to have 1-2 platform lengths in front and behind of the platform as domain dimensions. Something of the sort goes for width as well. Not quite the same for height, but you get it. should i downscale it a lot? :P
EDIT: https://www.dropbox.com/sh/z0h5xhr6qq10zth/ehvp0eSdRy?m TIL dropbox is sweet Lasse |
figured I'd post an overview of challenges going from last converged solution to the current version:
- kOmegaSST vs kEpsilon - SS vs transient - perhaps some BCs under 0/, not sure about this - atmBoundaryLayerInletVelocity (accepted in OF17 but not OF21. this has led me to temporarily changing inlet to a simple inlet of air with fixedValue u=2m/s) Lasse |
Hi Lasse,
I finally managed to take a quick look at your case and I spotted that you forgot to re-check the settings on the tutorial "combustion/reactingFoam/ras/counterFlowFlame2D". Some of the ones I managed to find/figure out:
A few more suggestions:
Bruno |
woah, thanks a lot!
i'll go through my case real thorough before i get back to you, but eventually i'll give you an update on my progress:) Lasse |
Hello. Just a short update.
I created a much simpler 2D case with blockMesh, 6mx1.2m. Working on implementing log velocity profile with swak4foam to replace the ablinlet used with simpleFoam. This turned out to be more difficult than expected. As usual :p I expect to finish this soon. I'll upload the case again when I've worked out the log profile and a few other details! Lasse |
I updated the case and shared it with you on Dropbox. At the moment I'm experimenting with different variables, such as wind inlet velocity and fuel rate, and trying to decide how to make the platform geometry.
Lasse |
Hi Lasse,
I received your Dropbox message about the share on my email. I'll try to look into it during the weekend. Best regards, Bruno |
Methane dispersion in air
Hi redhoax and Wyldckat,
It is interesting redhoax that I am in same situation as you. i am very new to OpenFOAM (and Linux as well) and am struggling to solve CH4 dispersion in ambient air. i tried to follow the below http://www.personal.psu.edu/dab143/O...ist_slides.pdf http://openfoamwiki.net/index.php/Fi...Solvers.tar.gz as this has a feasibility to extend to combustion. but the problem is I cannot execute edcSimpleFoam after my problem is set Why? :confused: |
meanwhile, redhoax please let me know if you have some breakthrough in solving your problem. your advice is highly valuable.
|
Greetings Vivek and welcome to the forum!
For the problem with edcSimpleFoam, please start a new thread for that topic. And don't forget to specify the OpenFOAM version you're using! @Lasse: Sorry, I won't be able to look into this before the 2nd of May :( Best regards, Bruno |
Thanks Bruno!!
will do it! and i am using Openfoam version 2.2.0. |
Hi Brunos,
When i try to modify the reactingFoam model with my mesh i get the following error. [COLOR="Red"] Create time Create mesh for time = 0 Reading g Creating reaction model Selecting combustion model PaSR<psiChemistryCombustion> Selecting chemistry type { chemistrySolver ode; chemistryThermo psi; } Selecting thermodynamics package { type hePsiThermo; mixture reactingMixture; transport sutherland; thermo janaf; energy sensibleEnthalpy; equationOfState perfectGas; specie specie; } Selecting chemistryReader foamChemistryReader #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 Uninterpreted: #3 Foam::fvPatchField<double>::operator/=(Foam::fvPatchField<double> const&) at ??:? ... . . . . . . at ??:? #26 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6" #27 at ??:? Floating point exception (core dumped) Where is the problem??? What should i change? |
Quote:
to understand the problem I tried my geometry in rhoSimpleFOAM. when i encountered this i changed my underrelaxation factors of rho and p. the simulation was running fine. But when i run the case in reactingFOAM the problem is there. I am wondering is there any way i can change parameters ?(as i did for rhoSimpleFOAM) so i can run my simulations. |
Hi Lasse,
Quote:
By the way, you mentioned in the share message, that when you activate the gravity, that the solver/solution would diverge. There are two possibilities:
Bruno |
wow, i'm so sorry. i discovered that myself the same day(just after) i updated the dropbox case and corrected it. mustve forgot to upload the corrected one. I will however test higher k-Epsilon values. i'll update that blockmeshdict asap
|
4 Attachment(s)
Hello!:-)
i updated the case. the solution is not diverging now, however... i'm struggling with what seems to me as reversed flow from the outlet patch. at both top and bottom corner along the outlet(although one is located on the top patch) patch are strong velocity fields, oppositely directed. at the top is inflow, bottom outflow. see attached pictures for visual on how ridiculous my situation is. All taken at t=1s: This is full mesh 3D: Attachment 21515 This is top and outlet only. The blue field on the top patch is -23m/s in negative X-direction...Attachment 21516 Finally a picture of my outlet patch. How did it come to this? :pAttachment 21517 sine the issue arised after extracting the outlet patch from the top patch, and the problem shows on top and outlet patch, these boundary conditions are what i've looked into and played with the most. i made a table with an overview of my current conditions in the 0-folder. Attachment 21518 (This image is in the dropbox folder in full size. Also the full case is updated.) with this new issue i feel like i'm stumbling around in the dark looking for the solution in tutorials while not able to rationalize where it comes from, but i continue to look into it of course! And thanks a lot for all help you have provided me already. It's really generous :) Regards, Lasse |
2 Attachment(s)
Update: i've tried to eliminate possible sources of error, but in failing to locate the root cause i have now made the case a laminar one with a viscosity a 1000 times higher than normal. still, after just t=1s the entire domain is showing unrealistic velocities..
Full domain from side: Attachment 21541 Air inlet only: Attachment 21542 So the question is, what is causing the domain to obtain these velocity fields.. I'm in pursuit. Dropbox updated accordingly. Lasse |
Gas dispersion
Quote:
Can you share the case files with me too..... my email is alexleekh@singnet.com.sg Thanks |
All times are GMT -4. The time now is 07:52. |