|
[Sponsors] |
August 1, 2020, 07:29 |
negative density in buoyantSimpleFoam
|
#1 |
Member
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 16 |
Hi Hi
So i am trying to simulate a engine cell. I am not looking at the engine itself but the exhaust gas. So i have an inlet where the air gets drawn in, and outlet where the hot gas is expelled. The room has a single inlet/outlet (called a port). The rest of the boundary conditions are walls. I have attached an image for reference. The problem is that teh denisty goes negative after a few iteratiorn causing a crash. The following are the boundary condistions being used. Code:
U boundaryField { walls { type noSlip; } inlet { type flowRateOutletVelocity; volumetricFlowRate 0.49; value uniform (0 0 0); } outlet { type flowRateInletVelocity; volumetricFlowRate 1.11; value uniform (0 0 0); } port { type zeroGradient; } } Code:
T - boundaryField { walls { type zeroGradient; } inlet { type zeroGradient; } outlet { type fixedValue; value uniform 673; } port { type inletOutlet; inletValue uniform 300; value uniform 300; } } Code:
p_rgh - boundaryField { walls { type fixedFluxPressure; gradient uniform 0; value uniform 101325; } inlet & outlet { type fixedFluxPressure; gradient uniform 0; value uniform 101325; } port { type fixedValue; value uniform 101325; } } I know i have problem with my boundary conditions but i don't know hat they should be... any suggestions |
|
August 1, 2020, 09:27 |
|
#2 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 21 |
Why are you using flowRateInletVelocity and flowRateOutletVelocity. And btw why outlet boundary conditions on the inlet and outlet boundary conditions at the outlet? Setting the velocity at inlet and outlet is pretty unstable. Typically you set the velocity at the inlet and use one of these at the outlet:
Code:
zeroGradient <- might cause problems with backflow inletOutlet <- explicitly specifing the backflow (to e.g zero) pressureInletOutletVelocity <- more suited if backflow can occur You can specify boundary conditions like that, you can also use pressure pressure boundary conditions, but we need to know why you are using this combination. Because you can try two ways to solve this:
|
|
August 2, 2020, 08:25 |
|
#3 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
Bloerb - I don't think you understand his geometry. Have a look at the figure - the inlet and outlet are boundaries on the engine that is inside the room. The port boundary is the actual domain inlet/outlet.
Bullmut - where does the density go negative? I would suggest looking at where the density goes negative and then look at the p, U, T field values there to try work out which field is causing the trouble. |
|
August 2, 2020, 11:28 |
|
#4 | |||
Member
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 16 |
@Bloerb, thanks for your reply, Ill try and address each of your concerns:
Quote:
Quote:
@Tobermory, i actually tried to find this out. but i dont have the density file in my folders. I only see the error in the log.txt (see below) Quote:
Since the density is negative the solver crashes during the p_rgh calculation. How do i go about viewing the density in the paraview? Can i explicitly ask for rho to be saved in a time folder? Thanks for the fast replies by the way! |
||||
August 2, 2020, 11:54 |
|
#5 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
You can force the density field (or other hidden fields) to be written using
Code:
buoyantSimpleFoam -postProcess -func 'writeObjects(rho)' |
|
August 2, 2020, 12:14 |
|
#6 | |
Member
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 16 |
Quote:
Hehe, found this (How to get density-field for compressible flow?) and am doing just that! Will keep you posted Cheers |
||
August 2, 2020, 14:28 |
|
#7 |
Member
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 16 |
Ok i am back,
Negative density is reported at the engine inlet Weirdly enough the timing is off. According to the log i get a negative density at step 3 but when i plot the values per time step i actually have a negative density at step 2. I have not yet adjusted the BCs as suggested. Mainly because if i remove prescribed velocity BC and make it pressure.. what do i do? What should p_rgh be? This is the situation as it stands FYI - TURBINE_out == engine out & TURBINE_IN == engine inlet when comparing code and images. Code:
p_rgh "engine_outlet|engine_inlet" { type fixedFluxPressure; gradient uniform 0; value uniform 101325; } Code:
U engine_inlet { type flowRateOutletVelocity; volumetricFlowRate 0.5; value uniform (0 0 0); } engine_outlet { type flowRateInletVelocity; volumetricFlowRate 0.5; value uniform (0 0 0); } |
|
August 6, 2020, 02:57 |
negative density in buoyantSimpleFoam
|
#8 |
New Member
Paul Pickering
Join Date: Aug 2020
Posts: 1
Rep Power: 0 |
I am not sure what the solution is to this problem, but I am having a similar problem with negative densities in buoyantSimpleFoam. I have a fairly complicated geometry and there is a crevice in the surface where negative densities occur and crashthe simulation on an early iteration. The equation of state being used is the perfect gas equation.
I am wondering if there is a way to put minimum limits on density (and perhaps other parameters) to allow the simulation to proceed to the next iterate? Does anyone know whether this is possible? |
|
August 10, 2020, 12:05 |
|
#9 | ||
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
Quote:
I believe the SIMPLE solver does struggle often if the initial field is far from the real solution, so if the above does not work, try initialise with potentialFoam & see if that helps. Quote:
Best of luck - and let us know when you have cracked it! |
|||
August 11, 2020, 11:27 |
|
#10 | |
Member
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 16 |
For those interested.. i have manged to get my simulation running.
the weird part is, it runs in openfoam 6 but not 8.. i think this is because the consolidated buoyantBoussinesqSimplefoam and buoyantSimpleFoam into 1 solver... in version 7 already. so if you still want to know, i changed the boundary conditions as follows (paste from patchSummary): Quote:
The simulation runs for a few hundred iterations, then i get a spike nine the k and epsilon values. If i let it run on it eventually crashes. Not due a negative density though. rather a uncontrolled k or epsilon value. so the spike warns me runaway is coming. I took the approach of turning turbulence off when i get the spike, and keeping the simulation going. 20 iterations later i turn on the turbulence again. I repeat this process 3 times before i leave turbulence on and run till i get convergence. so i dont have the prefect answer - BUT i have a working solution that gives realistic results. I am open to suggestions as to why my turbulence model spikes and causes a runaway situation. Also any info on how the consolidated the solvers between 6 and 7.. i looked at github but i am not expert in reading code. thanks for the suggestions everyone |
||
August 11, 2020, 12:01 |
|
#11 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
Well done. I have found that OF can be really touchy about BCs and initial fields. For the problem with the ke spike, just check your initial fields incl nut. Do you have something credible (non-zero) set for nut? And credible k/eps values on the engine outlet? That has tripped be up before, for a simple jet simulation that kept on blowing up for no apparent reason ... almost drove me mad.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Current density visualisation (PEM fuel cell add-on module) | pchoopanya | FLUENT | 10 | August 21, 2023 15:33 |
[blockMesh] edges not aligned with or perpendicular to non-empty directions | ynos | OpenFOAM Meshing & Mesh Conversion | 6 | March 26, 2020 16:02 |
incrompressible flow | Diger | FLUENT | 10 | January 10, 2017 08:09 |
[blockMesh] Errors during blockMesh meshing | Madeleine P. Vincent | OpenFOAM Meshing & Mesh Conversion | 51 | May 30, 2016 11:51 |
A problem about density in liquid air definition | alloveyou | CFX | 2 | June 14, 2012 15:20 |