CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Problem defining the pressure inlet

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Timo L.
  • 1 Post By Timo L.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 11, 2024, 07:19
Default Problem defining the pressure inlet
  #1
New Member
 
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2
rl3418 is on a distinguished road
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
rl3418 is offline   Reply With Quote

Old   October 25, 2024, 05:16
Default
  #2
New Member
 
Join Date: Oct 2024
Posts: 5
Rep Power: 2
Timo L. is on a distinguished road
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
Timo L. is offline   Reply With Quote

Old   October 25, 2024, 07:16
Default
  #3
New Member
 
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2
rl3418 is on a distinguished road
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
rl3418 is offline   Reply With Quote

Old   October 25, 2024, 07:39
Default
  #4
New Member
 
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2
rl3418 is on a distinguished road
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.
rl3418 is offline   Reply With Quote

Old   October 25, 2024, 08:34
Default
  #5
New Member
 
Join Date: Oct 2024
Posts: 5
Rep Power: 2
Timo L. is on a distinguished road
Quote:
However, the pressure distribution stays the same.
Does the pressure profile evolve a little or not at all?

Quote:
The timestep size was changing a lot and the Co number was changing by a few orders of magnitudes
Indeed, this seems weird. I personally prefer fixing the Co number. If dt becomes very small, the simulation is unstable. Can you provide fractions of the logfile, so I can see the Co and dt behaviour?

Quote:
How do people handle with the extreme pressure change? Do I just refine the mesh at the inlet?
A snapshot or your mesh and your results (p and U) in Paraview would be nice, as well as the number of cells (you sadly cut them off when posting the checkMesh results).
With those pictures it might be easier to evaluate if a refinement of the mesh can help.
Elvis_M likes this.

Last edited by Timo L.; October 25, 2024 at 09:50.
Timo L. is offline   Reply With Quote

Old   October 25, 2024, 10:24
Default
  #6
New Member
 
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2
rl3418 is on a distinguished road
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
Attached Images
File Type: jpg P 0.01s.jpg (21.4 KB, 5 views)
rl3418 is offline   Reply With Quote

Old   October 25, 2024, 10:32
Default
  #7
New Member
 
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2
rl3418 is on a distinguished road
The mesh was kind of rough. I only had about 500 hexahedrals. [ATTACH]mesh.txt[/ATTACH]
Attached Images
File Type: jpg mesh.jpg (69.5 KB, 13 views)
rl3418 is offline   Reply With Quote

Old   October 25, 2024, 11:24
Default
  #8
New Member
 
Join Date: Oct 2024
Posts: 5
Rep Power: 2
Timo L. is on a distinguished road
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.
Elvis_M likes this.
Timo L. is offline   Reply With Quote

Old   October 25, 2024, 12:20
Default
  #9
New Member
 
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2
rl3418 is on a distinguished road
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.
rl3418 is offline   Reply With Quote

Old   October 28, 2024, 03:11
Default
  #10
New Member
 
Join Date: Oct 2024
Posts: 5
Rep Power: 2
Timo L. is on a distinguished road
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.
Timo L. is offline   Reply With Quote

Old   October 28, 2024, 06:33
Default
  #11
New Member
 
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2
rl3418 is on a distinguished road
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.
rl3418 is offline   Reply With Quote

Old   October 28, 2024, 07:13
Default
  #12
New Member
 
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2
rl3418 is on a distinguished road
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.
rl3418 is offline   Reply With Quote

Old   October 28, 2024, 07:37
Default
  #13
New Member
 
Join Date: Oct 2024
Posts: 5
Rep Power: 2
Timo L. is on a distinguished road
For a 2d case, you need an empty face for front and back. In your 0 files, is this "tb"?

Quote:
If I increase dt, the solution is no longer stable. That is why I used a small dt.
You should increase dt or Co in a way that Co<≈1, not Co<<1. If your simulation setup (mesh/BC/solvers etc.) is fine, both will lead to stable behaviour.
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.
Timo L. is offline   Reply With Quote

Old   October 28, 2024, 08:21
Default
  #14
New Member
 
Runfeng
Join Date: Sep 2024
Posts: 13
Rep Power: 2
rl3418 is on a distinguished road
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.
rl3418 is offline   Reply With Quote

Reply

Tags
boundary condition, inlet and outlet, vacuum


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 14:20.