|
[Sponsors] |
October 11, 2024, 07:19 |
Problem defining the pressure inlet
|
#1 |
New Member
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2 |
Hi,
I'm trying to simulate the flow into a gas cell using buoyantPimpleFoam. I choose this solver to compute the heat transfer from walls to the gas. The cell has two inlets on the top and two outlets on the sides as shown in the picture attached. Before t=0, there should be no gas inside the cell. I sat the inlet pressure to 1000mbar and the initial pressure inside the cell to be 100mbar. It saw 1000mbar near the inlet, but it didn't evolve at all. The density inside the cell stays at 100mbar. I wish to know how to properly set the inlet and outlet conditions, if I want the simulation box to start with a relatively low density (vacuum). I've attached my input files down below. Thanks in advance for the help. geo.JPG foam.zip |
|
October 25, 2024, 05:16 |
|
#2 |
New Member
Join Date: Oct 2024
Posts: 5
Rep Power: 2 |
Hi fellow,
I don't know the solution, but I have some suggestions: I'm honestly not familiar at all with the usage of the BC pressureInletVelocity, but I'd assume that this BC is causing the mistake. To me it feels like the system is underdetermined. Have you tried setting a fixed pressure (p and p_rgh) at the outlets (eg. 100mbar)? Does the simulation run stable (with a constant, reasonable Co number)? Maybe you can post your logfile here. I guess that you have used checkMesh. Was the mesh OK? In general, refining the mesh near the inlets might help, as you have set a high pressure gradient of 0.9 bar along a very short distance (from inlet to internalField). Greetings, Timo |
|
October 25, 2024, 07:16 |
|
#3 |
New Member
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2 |
Thanks for the reply.
The Co number seems a bit weird. I could not upload the log file as the file size is too large. I was using adaptive time step. The timestep size was changing a lot and the Co number was changing by a few orders of magnitudes. I also tried fixed timestep. For dt=5e-7 the max Co number was around unity, but for dt=4.9e-7 this dropped to 1e-11. There must be something wrong. I have attached the updated input files. I sat the inlet pressure to 100mbar, and the initial pressure inside the simulation box to be 10mbar. I also changed the zeroGradient pressure conditions at the outlets be fixed at 10mbar. foam2.zip You mentioned that I have a high pressure gradient of 0.9 bar along a very short distance. If I wish to simulate flow into the vacuum, the initial pressure is going to be orders of magnitudes smaller than the inlet pressure. How do people handle with the extreme pressure change? Do I just refine the mesh at the inlet? This is the checkMesh results, and the mesh quality seems fine. checkMesh_output.JPG |
|
October 25, 2024, 07:39 |
|
#4 |
New Member
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2 |
The problem with the Co number seems to be resolved by fixed value U conditions for the inlet. However, the pressure distribution stays the same. The gas doesn't flow into the simulation box via the inlet. The pressure distribution doesn't evolve at all.
|
|
October 25, 2024, 08:34 |
|
#5 | |||
New Member
Join Date: Oct 2024
Posts: 5
Rep Power: 2 |
Quote:
Quote:
Quote:
With those pictures it might be easier to evaluate if a refinement of the mesh can help. Last edited by Timo L.; October 25, 2024 at 09:50. |
||||
October 25, 2024, 10:24 |
|
#6 |
New Member
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2 |
The density profile didn't evolve at all. I tried to plot the pressure lineout along the inlet. It didn't change at all. The plots here shows the distributions at 0.01s. [ATTACH]U 0.01s.jpg[/ATTACH]
The zip file I uploaded contains all the files needed to run buoyantPimpleFoam. I cut the outputs due to the file size limit. This shows how the Co number evolve with pressureInletVelocity. It was initially stable but then exploded to larger than unity. Co.JPG |
|
October 25, 2024, 11:24 |
|
#8 |
New Member
Join Date: Oct 2024
Posts: 5
Rep Power: 2 |
Well, you will need WAY more cells to calculate the flow. I suggest ~50.000 to start with, increasing the number if necessary, especially near walls. Otherwise the simulation will crash (i.e. Co number becomes very small).
Furthermore, near the corners you should use an unstructured mesh. Which meshing tool did you use? I'm only familiar with openfoam. Can you also post a section of the logfile which you think is ok? Or even better the transition where the simulation crashes. When observing the data in Paraview I recommend using the cell values, not the averaged ones. Then you can more easily visually identify too coarse sections of the mesh. |
|
October 25, 2024, 12:20 |
|
#9 |
New Member
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2 |
I increased the number of cell. The orthogonality gone up to 78, but the Co became more stable. However, the pressure still does not evolve.
P cell data.jpg This is a plot of the P cell data. It is essentially saying the pressure stayed at it's initial value. (I changed initial pressure to 10Pa) logf2.zip This is the log file with the refined mesh. BTW I'm using gmsh to generate the msh, then using gmshToFoam to convert the file. |
|
October 28, 2024, 03:11 |
|
#10 |
New Member
Join Date: Oct 2024
Posts: 5
Rep Power: 2 |
You should definitely increase the dt or the Co to save wall time. Right now it's like this:
3 seconds to simulate 1e-7 seconds --> ~1 year to simulate 1 second In your image you show the behaviour after 2e-5 seconds, which is very short. Maybe that's why nothing has happend. You can start e.g. with a max. Co number of 0.5. Also, I assume that you are still using too few cells. Can you post your number of cells and the same picture again with the cells (surface with edges)? Another question: Is this a 2d or 3d case? It looked like a 2d case to me, but in your image you created a slice, which would only be necessary for a 3d case. If your domain is 3d, you'll have to increase the number of cells even more or reduce it to 2d. |
|
October 28, 2024, 06:33 |
|
#11 |
New Member
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2 |
This is the mesh input. This is meant to be a 2D simulation. openfoam only accepts 3D elements, so the 2D mesh was extruded in the third direction. (only one cell in the third direction) mesh.jpg
If I increase dt, the solution is no longer stable. That is why I used a small dt. |
|
October 28, 2024, 07:13 |
|
#12 |
New Member
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2 |
Also, based on the simulations I ran using a different code the gas is starting to fill the chamber at about 0.05ms. It is strange that there is no change observed in openfoam at 0.02ms. I kind of fell like there is something wrong with the inlet BCs, but this was also observed with a fixed value velocity inlet.
|
|
October 28, 2024, 07:37 |
|
#13 | |
New Member
Join Date: Oct 2024
Posts: 5
Rep Power: 2 |
For a 2d case, you need an empty face for front and back. In your 0 files, is this "tb"?
Quote:
Your Co numbers do look stable, but with Co≈10e-5 the simulation will last for ages. Thus, set e.g. maxCo=0.5. Openfoam will adjust dt accordingly on the run. If this doesn't work, there are some last resorts: -Further increase mesh resolution, especially locally near corners -Try a more basic solver and increase the complexity step by step, for example: pimpleFoam-->rhoPimpleFoam-->buoyantBoussinesqPimpleFoam-->buoyantPimpleFoam Doing this, you can easier detect where the error is located. -I have noticed in your logfile that the simulation does not solve for rho. Maybe this is an error source, on which you can do some research. |
||
October 28, 2024, 08:21 |
|
#14 |
New Member
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2 |
Yep, tb are the empty faces.
I don't think buoyantPimpleFoam solves for rho. I modified the inputs under the 0/ folder based on openfoam/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom. I don't think a rho input is defined. I guess I'll try different solvers. I think I've tried a similar flow into vacuum with sonicfoam, and that did work. I guess I'll try with simpler solvers and see what happens. |
|
Tags |
boundary condition, inlet and outlet, vacuum |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to solve the problem with simulating a pipe with pressure inlet and outflow BC fo | mostafa.sh | FLUENT | 4 | August 13, 2018 12:29 |
"Pressure Inlet" Boundary Setup | Wijaya | FLUENT | 15 | May 18, 2016 11:08 |
Pressure inlet problem | Laci | FLUENT | 2 | October 5, 2010 05:51 |
Pressure Inlet yields wrong velocities | Ben | FLUENT | 0 | November 21, 2004 02:47 |
what the result is negatif pressure at inlet | chong chee nan | FLUENT | 0 | December 29, 2001 06:13 |