CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Boundary condition to simulate X meters of pipe (https://www.cfd-online.com/Forums/openfoam-solving/249854-boundary-condition-simulate-x-meters-pipe.html)

ERodriguez May 11, 2023 16:05

Boundary condition to simulate X meters of pipe
 
1 Attachment(s)
Hello,

I have an open question about a relatively simple problem, but with different potential solutions.

I am trying to solve the flow in a couple of manifolds distributing water. The water comes into one of the manifolds from a single pipe with a prescribed mass flow rate. The flowrate is relatively high therefore imposing a high discharge velocity in the inlet pipe. The first manifold is connected to the second manifold by a series of different-length pipes. These are several pipes (say 60-80 different pipes) each of them with different geometries. Some of them are long, some are short, a few of them are thinner and some others are thicker. The second manifold may be considered as large enough as to assume that all the connecting pipes are discharging into a constant-pressure volume. In order to make it harder, the first manifold has a relatively complex geometry with several elements crossing it and generating a highly turbulent flow. On the other hand, the pipes, despite being different to each other, are relatively simple (mostly straight lines or smooth curvature) so the flow inside them may be assumed to be quasi-1D. I attach a very simplified sketch of the flow problem to this post.

The objective of the analysis is to resolve the flowrate crossing each of the pipes connecting both manifolds. A secondary objective is to find the pressure drop across each of these channels. However, once the mass flow rate is known, it is very easy to obtain a reasonable estimation of the pressure drop by using simple 1D approximations.

I have (at least) three possible options to solve this problem:


Quote:

Option A
Brute force approach. I generate a CFD mesh of the whole flow domain (not including manifold 2) but I do include the flow inside the pipes.
Advantages:
  • Boundary conditions are straightforward: inlet velocity and p=0 at the outlet of each pipe
  • We resolve the whole flow at once obtaining flowrate and pressure drop across each pipe
Disadvantage:
  • I need to invest a considerable amount of computational power (almost half of the mesh size) in resolving a problem which, despite being the subject of many PhDs (mine amongst them) is rather boring from an engineering perspective: 1D Pipe flow.

I would rather model the flow inside the pipes as a simpler 1D flow without the need to invest that much mesh in solving it. This leads me to option B:

Quote:

Opention B: Iterative B.C.
Ideally, I would like to solve the flow within the first manifold only by imposing a pressure boundary condition in each pipe entrance. However, this is not straightforward because the pressure at these points is a function of the mass flow rate through each pipe. We could solve this in an iterative approach. First we set a constant pressure for all the pipe outlets, then we obtain the flowrate across them. By knowing the flowrates we can update the pressure at the pipe entrance (by using simple 1D correlations) and knowing they all discharge into a constant-pressure manifold. I hope that, with a few iterations, the problem converges and I obtain a consistent entrance-pressure / flowrate through the pipes.

Advantages:
  • CFD mesh is focused where the real problem happens (manifold 1) and the pipes are solved by simple engineering correlations
Disadvantages:
  • I don’t know whether it will converge in a few iterations
  • Even if it does, it may be a rather tedious problem with a few try-and-error iterations

This lead me to think that something may already exist. Which is what I call option C:

Quote:

Option C: pipe-outlet-BC
First of all, I do now know whether this option exists and that is the main question of this post: Is this possible?
If we analyse the problem, this is rather simple I would like to impose a pressure boundary condition at the pipe entrances which is a simple 1D function (\Delta P = 1/2 \rho U^2 \xi L/D) of the flowrate crossing the pipe. Then it could be (theoretically) possible to impose a pressure boundary condition equivalent to telling the flow “from now on, you will have X meters of straight pipe with diameter D and then you will discharge in a P=0 manifold”. The boundary condition would need to integrate the flowrate across the outlet patches, then compute what would be the pressure and impose it. Of course, this implies the outlet pressure may be changing along time (or along simpleFoam iterations) until it converges into a stable value. Perhaps this imposes stability problems in the flow (too many changes in the pressure BCs), but perhaps this is manageable by imposing a reasonable starting point.

So my question is: Does option C exist in OpenFOAM? I am currently using OF v2212 but I do have access to other versions if needed.

My secondary question is: does anyone know other alternative to options A, B and C above?


I hope the problem is clearly described, but if anyone has any question, please let me know.

Best regards and thanks for your time foamers!

ERodriguez May 23, 2023 09:14

Nobody? I thought this would be possible...


All times are GMT -4. The time now is 11:51.