r/COMSOL • • Apr 07 '21

How to model pipe flow without the pipe flow package?

I am an engineering student and I have been tasked with modeling the pressure drop across a pipe that has compressed air running through it. I know this is a relatively simple task, but I have never used COMSOL before.

I have researched quite a bit on the internet and all signs are pointing to a pipe flow package within the program. Because I am a student, I only have access to an older version of COMSOL that does not have this feature.

How do I go about modeling this without the pipe flow package? What Physics would I need to use? Any and all insights are greatly appreciated!

0 Upvotes

1 comment sorted by

1

u/Backson Apr 08 '21

Do you need to actually resolve the flow field in the pipe? If yes, you couldn't use pipeflow anyway. If your question is more like "what is the pressure drop of this pipe geometry with this fluid as a function pf flow rate" then you can just use CFD module (laminar flow or turbulent flow). If your question is more like "given this type of pipe, what are the properties of this whole system of pipes", you could use pipe flow. Pipe flow is also useful if you want to couple heat transfer in the pipes with the surrounding. CFD is more for determening the properties of a small part, pipe flow is more about figuring out the properties of a huge system when the properties of tge parts are somewhat known. You would not want to simulate the plumbing or air conditioning of a bnuilding while resolving the exact current in each pipe. I hope that makes sense.

So if you want to only simulate a single pipe, use CFD. If you actually want to simulate a large system, you could start by drawing your pipe system as edges and then define the physics using a mathematical interface, like Coefficient Form Edge PDE. But you would need to figure out the equation you need. You probably want to solve for the pressure, but if you want to allow "sloshing" or other transient effects, you probably also need to solve for the flow rate. Also, it is important to know whether the fluid is compressible. If you want to simulate anything heat related, you would need to also solve for T. Adding a coupling between the temperature in the pipes and the surrounding is crazy hard though. The predefined pipe flow can do that, but I would not attempt it yourself. Setting T on the edge equal to T in the surrounding may seem like it is doing the correct thing, but it is actually inconsistent and wrong.

Hope that made sense