CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Prescribing Fully Developed Flow as an Inlet in the Aorta (https://www.cfd-online.com/Forums/fluent/169153-prescribing-fully-developed-flow-inlet-aorta.html)

T_Dinky April 4, 2016 07:44

Prescribing Fully Developed Flow as an Inlet in the Aorta
 
Dear users,

I am using Fluent V16.2 to carry out blood flow simulations in a model of the thoracic aorta with two inlets, one is the aortic valve and the other is an inflow cannula from a left ventricle assist device (LVAD).

At the moment I am trying to prescribe a fully developed velocity profile across both of these inlets, but I'm having quite a bit of trouble.

From what I understand the only way to achieve this in Fluent it by using a compiled user defined function (UDF). I've read up on how to do this but I still don't have a clue on how to proceed.

Any help or advice would be much appreciated!

`e` April 4, 2016 17:06

Use the DEFINE_PROFILE macro and you can either use an equation (if one exists for your inlet velocity, probably some sinusoidal time-dependent function of Poiseuille flow) or read values from a data file.

LuckyTran April 5, 2016 09:50

Well first you need to have a velocity profile, use a profile from some paper or generate your own. Then, assuming you already know the velocity profile.

Look into prescribing a velocity profile using a PROFILE. There's a Fluent tutorial on how to do this if you need step by step instructions. I think it's much simpler than UDF and does exactly what you're trying to do.

T_Dinky April 6, 2016 08:03

Dear Lucky and e,

I have looked up how to define a profile and I think I have two options:

1. Create a simple 3D pipe with the same geometry and boundary conditions as my inlets. Then extract the velocity profile where it becomes fully developed using a plane surface and the "write profile" function.

2. Define the inlet profile using the equation Ux=UMax[1-(y^2+z^2)^0.5/r^2], which defines a 3D parabolic velocity profile using a UDF.

Option 1 seems easier, but would it work?

LuckyTran April 6, 2016 08:41

Quote:

Originally Posted by T_Dinky (Post 593652)
Dear Lucky and e,

I have looked up how to define a profile and I think I have two options:

1. Create a simple 3D pipe with the same geometry and boundary conditions as my inlets. Then extract the velocity profile where it becomes fully developed using a plane surface and the "write profile" function.

2. Define the inlet profile using the equation Ux=UMax[1-(y^2+z^2)^0.5/r^2], which defines a 3D parabolic velocity profile using a UDF.

Option 1 seems easier, but would it work?

2 is actually not as good an idea as it would seem because the analytical solution is not discretized and will be inconsistent with your grid. Also, this solution is for the canonical fully developed flow in a pipe with constant properties. Is that appropriate for your blood flow problem?

1 normally works and is much better. The problem is you need to make sure that you get the right profile with 1. For example, periodic BC's can only be used for constant property flows. To get fully developed flow without using periodic BC's requires very long lengths. This computational expense might not be something you want to waste, considering you're only doing this to get an inlet profile. And, this method is best when your grids are the same so that the profile is perfectly mapping the solution without any interpolation. If the grids are the same then the solution that you map over will be consistent with your discretization schemes and satisfy the mass & momentum balances. If the grids are not the same, then the solution will be inconsistent when it is mapped over, and then this method has the same problem as method 2.

T_Dinky April 6, 2016 09:10

Quote:

Originally Posted by LuckyTran (Post 593658)
2 is actually not as good an idea as it would seem because the analytical solution is not discretized and will be inconsistent with your grid. Also, this solution is for the canonical fully developed flow in a pipe with constant properties. Is that appropriate for your blood flow problem?

1 normally works and is much better. The problem is you need to make sure that you get the right profile with 1. For example, periodic BC's can only be used for constant property flows. To get fully developed flow without using periodic BC's requires very long lengths. This computational expense might not be something you want to waste, considering you're only doing this to get an inlet profile. And, this method is best when your grids are the same so that the profile is perfectly mapping the solution without any interpolation. If the grids are the same then the solution that you map over will be consistent with your discretization schemes and satisfy the mass & momentum balances. If the grids are not the same, then the solution will be inconsistent when it is mapped over, and then this method has the same problem as method 2.

Lucky,

Thank you for your feedback. Per your recommendation I'll most likely go with option 2.

Thank you and 'e' for your help with this. It's greatly appreciated :)

T_Dinky April 6, 2016 11:47

As it turns out you were right Lucky, option 2 requires incredibly long pipes in order for the velocity profile to fully develop.

So I've tried my hand at a UDF based on the equation:

Ux=UMax[1-(y^2+z^2)^0.5/r^2]

This is the code I've written up, I'd greatly appreciate anyone checking over it (I'm no expert). The code was originally from another Thread in the Forums, but I've changed things round to suit my needs (I think).

#include "udf.h"

#define PIPE_DIAMETER 12.e-3 //Defining the pipe diameter in meters

#define VELOCITY ??. //Defining the maximum velocity in m/s

DEFINE_PROFILE(paraboloid_velocity, thread, position) { real x[ND_ND];

real r,v_max;

face_t f;

r=PIPE_DIAMETER/2.; //Calculating Pipe radius

v_max=VELOCITY; //Defining the maximum velocity

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

F_PROFILE(F, thread, position)=v_max(1.-(pow(pow(x[0],2.)+pow(x[1],2.)),0.5)/pow(r,2.));

} end_F_loop(f, thread) }

I've not defined a initial velocity yet. Additionally, for some background info my inlet lies in the Z axis at the origin of both X and Y.

Thanks again!

`e` April 15, 2016 06:37

Have you tried using this UDF and compared it against a fully developed pipe flow profile? I also use this approach for generating inlet velocity profiles for fully developed flows where an analytical solution exists. As LuckyTran has said, this analytical equation is not discretised for your mesh (consider a coarse mesh; the defined profile is either over- or under-predicting the true flow). Ensure you have performed a mesh independence study (as normal) to mitigate this problem.


All times are GMT -4. The time now is 18:07.