|
[Sponsors] |
running rhoSimpleFoam to simulate real gas through nozzle |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Member
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12 ![]() |
Dear all,
I want to simulate a flow through a nozzle connecting two concentric tubes. I created a very simplified 2D geometry of the real case as starting step. The case is a steady-state flow and the real condition to simulate are:
To start the simulation I set the boundary conditions with very low inlet pressure and mass flow. It will be worthful to make run the simulation with this conditions and then high the value more and more up to the real ones My problem is that running rhoSimpleFoam it just runs very few iterations before stopping. It's not clear to me what is wrong to run the simulation. The flow should not reach Mach>1 but it's not sure. Could someone expert watch my case and help me explaining what I wronged to set in the solver? CheckMesh reports it is all ok. The error I get is: Code:
Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 ? in "/lib/x86_64-linux-gnu/libm.so.6" #4 pow in "/lib/x86_64-linux-gnu/libm.so.6" #5 Foam::PengRobinsonGas<Foam::specie>::Z(double, double) const at ??:? #6 Foam::PengRobinsonGas<Foam::specie>::h(double, double) const at ??:? #7 Foam::heThermo<Foam::psiThermo, Foam::pureMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::PengRobinsonGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::he(Foam::Field<double> const&, Foam::Field<double> const&, Foam::List<int> const&) const at ??:? #8 Foam::gradientEnergyFvPatchScalarField::updateCoeffs() at ??:? #9 Foam::fvMatrix<double>::fvMatrix(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) at ??:? #10 Foam::tmp<Foam::fvMatrix<double> > Foam::fv::optionList::operator()<double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::word const&) at ??:? #11 ? at ??:? #12 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #13 ? at ??:? Floating point exception (core dumped) I read a lot about rhoSimpleFoam and I tried a lot of combinations to make stable the simulation but now I think I don't know what else to do. Let me know what else you need to know to give me some useful hints I hope you can help or give me some useful hints. Thanks Last edited by enginpower; May 30, 2017 at 04:34. Reason: update link |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,712
Blog Entries: 6
Rep Power: 52 ![]() ![]() ![]() |
Dear Saverio,
I got your message on research gate and checked your case. After 1 iteration, your solver blows up because the velocity already reaches 750 m/s. Doing some simple tests:
I would suggest you to create a uniform mesh first. 4-5 cells in the connection part. If this works, you can refine locally (but not with blockMesh). Otherwise you will get the problem you have now. Good luck.
__________________
Keep foaming, Tobias Holzmann |
|
![]() |
![]() |
![]() |
![]() |
#3 | |||||||
Member
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12 ![]() |
Hey,
Quote:
![]() Quote:
Quote:
Quote:
Good luck and if there is some compressible expert - I would be glad to have also new input. Last edited by Tobi; May 18, 2017 at 09:07. |
||||||||
![]() |
![]() |
![]() |
![]() |
#4 |
Member
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12 ![]() |
Hey Tobi,
thanks a lot about answering to my points directly in my message. The procedure you explained to get last value is effectively very useful! Waiting for some compressible experts, I'd like to address the problem of the mesh. It is a very huge problem to me getting a good mesh using open source tools. I do a lot of trials in the past but with low level of success. I followed also some of your tutorials. Maybe I've just given up soon or I started directly with a complex geometry. About this case, what do you suggest? I have to create the same geometry in Salome, mesh simply it in Salome, extrude it in Salome, export all the patches each by one as stl files. Then I have to configure snappyHexMeshDict file to get a good mesh. Is it this procedure correct? Let me do this further trial ![]() |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,712
Blog Entries: 6
Rep Power: 52 ![]() ![]() ![]() |
I have to say that I never used mergeMesh and other good tools in FOAM. That's why I would do it as follow:
You can also use some 2D tutorial that I already uploaded. Appropriate cases would be
https://openfoamwiki.net/index.php/S...als_and_Guides
__________________
Keep foaming, Tobias Holzmann |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 ![]() |
Hello,
As Tobi pointed out, it is a mesh problem. Please see the attached image, it is clear that this velocity jump is around the nozzle inlet where you have a huge mesh expansion ratio. Actually, there is no expansion ratio at all, it is a sudden jump in cell volumes. Regarding the BCs and the solver, I can see that you have very small inlet velocity but you have to make sure which type of flow range is expected for this case. Based on your BCs Mach number is very very small, which means the flow is incompressible. Anyway, the mesh should be fixed fist and I think it is possible to create a good mesh using blockMesh for this case. Best Regards, Hassan |
|
![]() |
![]() |
![]() |
![]() |
#7 |
Member
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12 ![]() |
Hello,
I improved globally the mesh to have uniform cells with lenght sides of about 1e-3. I also did some trials changing the gas properties. In the case of perfect gas, it diverges after 33 iterations but I've not undestood why. Pressure, velocity, etc...and all other parameters seem to be in reasonable range, apart from the omega value. What's the problem? In the case of real gas, it diverges after 1 iteration. Pressure reaches a value of 430 bar. So what's the problem with these case now? Is my mesh improvement enough? Where or what can I improve using blockmeshdict? You can download the two cases, with different settings but same mesh, from here: perfect_gas and real_gas I hope you can help me easily Thanks |
|
![]() |
![]() |
![]() |
![]() |
#8 |
New Member
Libor Macek
Join Date: Mar 2017
Location: Brno, Czech republic
Posts: 6
Rep Power: 9 ![]() |
Hello enginpower,
have you find out converging solution? I am making similar calculation, but i cannot cross critical pressure of nozzle. I am using rhoSimpleFoam and limit is flow from 2.3 bar to atmosphere (1 bar). I tried few meshes, but solution is still unreal and oscillatory. Transient solvers have similar problem, except of sonicFoam, which is diverging. Transonic option of rhoSimpleFoam has problem with pressure equation and diverging after 3 iterations |
|
![]() |
![]() |
![]() |
![]() |
#9 |
Member
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12 ![]() |
Hi @libi.macek,
I've not found a solution yet. But I know that the mesh is an important stuff so I'm trying to improve more that. The problem is how to create a good mesh with open source tools. I tried a lot Salome on complicated geometries but I've not found good for that. Mainly it is due to the fact it is hard to create connected meshed surfaces. What I mean is that it's difficult to connect different surfaces composing a 3D model. Then there is the problem you should mesh in 3D more with snappyhexmesh... up to now I've not succeeded! I hope soon will update here a better mesh of my 2D model and maybe news about simulation. Keep in touch! What about your problem? Last edited by enginpower; August 22, 2017 at 08:48. |
|
![]() |
![]() |
![]() |
![]() |
#10 |
New Member
Libor Macek
Join Date: Mar 2017
Location: Brno, Czech republic
Posts: 6
Rep Power: 9 ![]() |
Hey enginpower, make pressure inicialization to value of maximal pressure, i earn interesting results using this. Then text me, if it was successful
Sent from my iPhone using CFD Online Forum mobile app |
|
![]() |
![]() |
![]() |
![]() |
#11 |
Member
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12 ![]() |
What do you mean with:
'make pressure inicialization to value of maximal pressure'? Put the pressure on the inlet to the maximum? Which maximum? Explain better this point. I have already some fixed boundary conditions. ![]() Do you want to suggest a procedure to follow. changing boundary conditions, to improve stability and get convergence? How do you make start another simulation from another one. If yes, be more precise about this procedure. Thanks |
|
![]() |
![]() |
![]() |
![]() |
#12 |
New Member
Dave Christopher
Join Date: Dec 2009
Posts: 26
Rep Power: 17 ![]() |
As the previous commentators have said, the mesh is crucial. A very coarse mesh that does not refine anything will work (poor results) or a very fine mesh (can be slow). A moderate mesh will not work well.
I suggest that you start with subsonic flow, with the inlet pressure just 0.5 bar above the outlet pressure. You mentioned getting pressures of 450 bar, I think this is due to the inertia of the fluid, so you first need to get the fluid moving. So you need subsonic flow (for steady calculations) or very, very small time steps for transient flow at the desired inlet P. I also recommend first doing the calculation with ideal gas and then switching to a real gas. I am using Fluent and the real gas model will not work for me for inlet P > 20 bar. |
|
![]() |
![]() |
![]() |
![]() |
#13 |
Member
Hilbert
Join Date: Aug 2015
Location: Australia
Posts: 50
Rep Power: 11 ![]() |
Hey all, to my knowledge all solvers apart from rhoCentralFoam and rhoSonicFoam are not hyperbolic solvers. This basically means that they will crash once the flow goes supersonic.
SonicFoam and rhoCentralFoam can both achieve nice supersonic flows, so if the solution diverges that probably means the BC's aren't correctly setup. The downside of sonicfoam is that is doesn't have the viscous stress term in the energy equations, and so the temperature profile in the boundary layer will be wrong. rhoCentralFoam is quite nice, just slow. With local time stepping it is oke ish, but you will still have to wait a bit for the solution. I also agree that the first step should be to get a case running with an ideal gas before you switch to any real gas effects. |
|
![]() |
![]() |
![]() |
![]() |
#14 | |
New Member
Libor Macek
Join Date: Mar 2017
Location: Brno, Czech republic
Posts: 6
Rep Power: 9 ![]() |
Quote:
I meant InternalField in O/ files. If you think about it in physical way, you will not develop so critical pressure wave at start of the calculation (its not stupid, if it works ![]() Start one simulation from another one you can make by mapFields, if you have similar geometry and different mesh. Best regards |
||
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Supersonic real gas flows | David Christopher | FLUENT | 2 | September 5, 2023 08:28 |
Evaporating Multicomponent Spray | Sqnderby | Fluent UDF and Scheme Programming | 6 | June 17, 2016 22:14 |
Real gas and compressible flow | seanmike31 | Main CFD Forum | 0 | March 20, 2015 17:06 |
Problems in air flow udf - divergence | PJT | Fluent UDF and Scheme Programming | 0 | May 28, 2013 11:01 |
UDF for Turbulent Viscosity | Lourival | Fluent UDF and Scheme Programming | 3 | October 13, 2012 04:09 |