Running rhoSimpleFoam for Pressure Driven Flow
Hello everyone,
I am running rhoSimpleFoam for a pressure driven flow model. The model is a tank with fixed wall temperature and cooler air with room temperature is blown into the tank. The inlet and outlet pressure are 9 and 6 bar. I use kEpsilon model and wallfunction for this model. The mesh was generated by snappyHexMesh. But I got the following error in 11th iteration. Does anyone have idea on what this message refer to? The BCs and fvScheme and fvSolution are shown below. Thank you in advance for your help! Time = 11 GAMG: Solving for Ux, Initial residual = 0.04648656, Final residual = 7.246233e-05, No Iterations 1 GAMG: Solving for Uy, Initial residual = 0.04807173, Final residual = 5.169749e-05, No Iterations 1 GAMG: Solving for Uz, Initial residual = 0.02602888, Final residual = 1.604139e-05, No Iterations 1 GAMG: Solving for e, Initial residual = 0.02056888, Final residual = 0.0001085386, No Iterations 1 #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::sutherlandTransport<Foam:: species::thermo<Foam::hConstThermo<Foam::perfectGa s<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::calculate() at ??:? #4 Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::sutherlandTransport<Foam:: species::thermo<Foam::hConstThermo<Foam::perfectGa s<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::correct() at ??:? #5 ? in "/opt/openfoam5/platforms/linux64GccDPInt32Opt/bin/rhoSimpleFoam" #6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #7 ? in "/opt/openfoam5/platforms/linux64GccDPInt32Opt/bin/rhoSimpleFoam" ~ Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ |
Hi,
I am not quite sure you can simulate a pressure driven flow in OF using fixedValue bc on both inlet and outlet. At least in incompressible cases, this will result in very unstable runs and you don't get the desired effect. Pl. try totalPressure for the inlet and fixedValue for the outlet and see how the calculation proceeds. -kumar |
Hi Kumar,
Thanks for your iinput. rhoSimpleFoam is for compressible flow only. I tried replacing fixedValue by totalPressure but still got the same error. |
From my experiences, using two pressure levels as b.c. is not a good idea. It sounds physical plausible but leads to numerical problems. The most stable b.c. are a flow inlet and a zero gradient pressure for outflow. You may try this and adjust the inflow until the indented pressure difference will be reached.
|
Hi Uwe - you are right that the most stable inlet/outlet combination is a velocity inlet (or mass flow inlet in compressible flows) and a fixedValue pressure for outlet. The inflow can be adjusted till it matches the desired pressure drop.
Works perfectly fine for single inlet/outlet geometries. What if the configuration has, say, a single outlet and multiple inlets where only the pressure is known? |
Dear Yijiu Jiang,
The error message is a floating point exception in your thermodynamic model, most probably at some location your temperature or density is zero or below zero. This could be due to a negative pressure at this location. And this should be due to incorrect boundary conditions (or divergence due to wrong solver settings). For compressible flow it is possible to set a fixed or total pressure boundary conditions in rhoCentralFoam, however, rhoCentralFoam is not very suitable for turbulence. rhoSimpleFoam and rhoPimpleFoam are just extensions of the incompressible solver and normally not used with fixed inlet and oulet pressures at the same time. So the first questions would be whether you use the correct solver: 1. Which Mach number do you expect in your flow? Do you expect shocks? Do you expect transsonic flow? 2. Which Reynolds number do you expect? From your pressure ratio I would expect Mach number below 1, but that depends also on the geometry. In that case it is better to use rhoSimpleFoam or rhoPimpleFoam and as the others already pointed out to have one zeroGradient pressure condition either at the inlet or outlet. The solvers are for compressible flow, but they are still based on the SIMPLE pressure-velocity coupling, which comes from incompressible flow and yields that not the value of the pressure, but the pressure gradient determines the flow field. One fixed pressure is ok, but if you have two fixed pressure values, it destroys the solution of your pressure gradient field. It could also be that you have Mach numbers below 0.3, in which case it would be even better to try buoyantPimpleFoam. |
Quote:
Hello Uwe, Thank you so much for your reply and idea. By following your advice, I changed the BCs to the combination of flowRateInletVelocity inlet and zeroGradient pressure for inlet and fixedValue for the outlet which is same as the BCs used in the sample case named 'squareBend'. But I still got the same error after 13 iterations. Is there any other thing you think I should check in oder to solve the problem? Meanwhile, I went back to check my mesh again and found that 2 failures happened in checking geometry. One is: Max skewness = 6.588719, 6 highly skew faces detected which may impair the quality of the results The other is: Concave cells found, number of cells:65141 Based on my understanding, these failure will affect the stability of the model, but would not crash the simulation if appropriate ralaxationFactors are used in fvSolution. What do you think about the mesh issue? I would like to share the case with you via the following link. Could you please take a look at it if you have time. https://drive.google.com/file/d/15eZ...ew?usp=sharing Just go -blockMesh -surfaceFeatureExtract -snappyHexMesh -transformPoints -scale '(0.001 0.001 0.001)' Then, run rhoSimpleFoam Thank you. |
1 Attachment(s)
Hi Ano,
I do not have much experience in modeling compressible flow. So, I do appreciate your explanations and response. Actually, the purpose of this model is to predict the heat transfer coefficient distribution inside the tank during cooler air is blown under certain inlet and outlet pressure in order to evaluate the performance of the blow needle. Like to know how much heat would be take away at different locations insider the tank. That's why I would like run a steady state model for it. Seeing from the picture I attached below. You have a simplified tank with a needle inserted, the air in room temperature is supposed to blow from the red surface into the tank through those small holes and flow out through the large hole out of the tank (green is the outlet). The Mach number inside the tank should be much smaller than 1. I guess it is in the range of 0.01 ~ 0.1. But the air speed at those hole should be much greater. The diameter of the holes is about 4 mm. The diameter of the needle is about 55 mm. The estimated inlet flow rate is 0.5 m^3/s. I tried to change the BCs to a flowRateInletVelocity with zeroGradient pressure for inlet and fixedValue for outlet, but the simulation still failed with the same error after a few iterations. I shared my case via the link in my response to Uwe above. You can take a look at it if you do not mind. Thank you~ |
First I recommend to simplify the geometric model. Probably it is not necessary to reproduce the needle with all its details. You may simulate this as a detail, but I assume that the flow equalizes in a distance of one or two needle diameters. The details of the flow are unimportant to what happens at the walls. The only thing what counts may be the flow rate.
The case seems to be symmetric, so you may use only a half or a quarter of the region and set simply an inflow with the size of the permeable part of the needle. Therewith all problems with the Mach number are gone. |
Hi Yijiu Jiang,
Your checkMesh log indicates large numerical figures for the overall bounding box and cell volumes: Overall domain bounding box (-218.2296 -157.6943 -173.1005) (181.7704 142.3057 126.9) Minimum face area = 0.003092119. Maximum face area = 262.5519. Face area magnitudes OK. Min volume = 0.002335076. Max volume = 3179.623. Total volume = 2.924592e+07. Cell volumes OK. Now I would assume that, in your case, these are in mm. All other field quantities (p, U etc.) are in MKS units so the solver assumes the mesh dimensions are in m. May be that's the reason for your solver difficulty? |
Sorry, didn't see that you used transformPoints after snappy.
|
2 Attachment(s)
Hello Uwe,
Thank you for your suggestions. I was working on a different things in the past days. Now I am back to this problem. I created a very simple case to test my boundary conditions. Basically the case is cylinder container (L=D=500mm) with one inlet and one outlet on the two side (D_inlet=55 mm, D_outlet=30 mm). Mesh was still generated by snappyHexMesh. And I changed the boundary conditions to zeroGradient for pressure at inlet and fixedValue for the outlet, flowRate at the inlet for velocity. But unfortunately, it still failed in 128 iterations when solving the energy equation. Here are my boundary conditions and the log files of checkMesh and calculation. Could you please take a look at them and let me know what you think? Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ |
All times are GMT -4. The time now is 19:22. |