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

Pulsatile Womersley velocity profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 5, 2011, 07:53
Default Pulsatile Womersley velocity profile
  #1
Member
 
Join Date: Apr 2010
Posts: 51
Rep Power: 16
bephi is on a distinguished road
Hello everybody,
as the topic says I would like to set up a pulsatile womersley velocity profile for my inlet BC!
of course first of all I searched and read a lot about possibilities but I just found something about
- OscillatingFixedValue
- timeVaryingUniform
- Contrib_groovyBC

The Womersley velocity profile is changing in time and space I would say, so what will be a possibility to set it for my inlet? Is it possible with groovyBC from Bernhard and if yes, how and where can I put this complicated formula for the velocity?

thank you so much!
bephi is offline   Reply With Quote

Old   April 3, 2011, 22:53
Default
  #2
New Member
 
Abhro
Join Date: Jun 2010
Posts: 5
Rep Power: 15
abhro is on a distinguished road
Hi,
Were you able to set womersley velocity profile as inlet for your problem?
abhro is offline   Reply With Quote

Old   April 4, 2011, 11:25
Default
  #3
Member
 
Join Date: Apr 2010
Posts: 51
Rep Power: 16
bephi is on a distinguished road
Hi!
Yes I used the groovyBC from Bernhard! Works quite well!
Greets!
Philipp
bephi is offline   Reply With Quote

Old   April 4, 2011, 11:33
Default
  #4
New Member
 
Abhro
Join Date: Jun 2010
Posts: 5
Rep Power: 15
abhro is on a distinguished road
Hi
Could you tell me how did you implement it using groovyBC? Even i need to get a womersley profile for my inlet condition..
Thanks !
abhro is offline   Reply With Quote

Old   April 4, 2011, 12:41
Default
  #5
Member
 
Join Date: Apr 2010
Posts: 51
Rep Power: 16
bephi is on a distinguished road
You have to compile the bc as described and add the libs-line in the controlDict. Afterwards you are able to use the womerley-equation. But be aware of the fact that sinh and cosh are not known in groovyBC. but you can easiy convert them with the exp()-function!
bephi is offline   Reply With Quote

Old   April 5, 2011, 18:07
Default
  #6
New Member
 
Abhro
Join Date: Jun 2010
Posts: 5
Rep Power: 15
abhro is on a distinguished road
Thanks for your help philip! i`ll try out what you suggested.
abhro is offline   Reply With Quote

Old   April 5, 2011, 18:57
Default
  #7
New Member
 
Abhro
Join Date: Jun 2010
Posts: 5
Rep Power: 15
abhro is on a distinguished road
Hi Philip,
Can you tell me the extact expression you entered in the variables part of the groovyBC inlet condition? I am not very sure about what to do with the Bessel function that comes into the inlet profile ..
Thanks a lot for your time.
abhro is offline   Reply With Quote

Old   April 6, 2011, 02:22
Default
  #8
Member
 
Join Date: Apr 2010
Posts: 51
Rep Power: 16
bephi is on a distinguished road
Good morning!
I have no access to the files right now but I used the real part of the complex function which is:


As I said just take care of the sinh and cosh!
I hope that helps!
Greets!
bephi is offline   Reply With Quote

Old   April 6, 2011, 04:41
Default
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by bephi View Post
You have to compile the bc as described and add the libs-line in the controlDict. Afterwards you are able to use the womerley-equation. But be aware of the fact that sinh and cosh are not known in groovyBC. but you can easiy convert them with the exp()-function!
I just checked in the current version of swak4Foam and sinh etc are there. Not sure since when and not sure whether it is also there in the last version of "pure" groovyBC (probably the Wiki-page never got updated)
gschaider is offline   Reply With Quote

Old   July 20, 2011, 11:09
Default Womersley profile - oscillatory pipe flow - complex bessel
  #10
New Member
 
Daniel
Join Date: Nov 2009
Posts: 10
Rep Power: 16
nihil is on a distinguished road
Hi there,

I also want to use the Womersley profile as a Dirichlet velocity BC and decided to implement my own BC starting from parabolicVelocity and oscillating fixedValue...

Since I need the Womersley profile for a pipe (3d) and not for a channel (2d), I have to deal with the complex Bessel function J0(z) instead of cosh.

Therefore, I started to implement the functions j0(z), exp(z), pow(z,n), sqrt(z,n) etc for complex numbers (z), which are, as far as I know, not implemented in OF yet, right?

My C++ is very poor, so I have some questions and could use some help here.

1.) Is src/OpenFOAM/primitives/complex/complexI.H the right place to implement these functions like this?
.
.
.
#include <complex>
.
.
.
// *************** Friend Functions ************** //
inline complex exp(const complex& c)
{
std::complex<double> z(c.re, c.im);
z = std::exp(z);
return complex(z.real(), z.imag());
}

.
.
.

3.) Or is there a better way / place to do that?

4.) Where should I implement such a function like factorial(Foam::scalar), which is also needed to evaluate complex J0? In src/OpeanFOAM/primiteves/Scalar/Scalar.H or is there a better place to do that?

5.) How do implement the Bessel function not only for a single scalar but for a scalarField, because I need this for the BC. I couldn't find an example how this is done for other functions, to start with.

6.) How do I implement the BC that it will work in parallel with maybe one or more processor boundaries on the patch? Is there somthing special to consider?

Thanks for any comments and suggestions

Cheers
Daniel
nihil is offline   Reply With Quote

Old   July 20, 2011, 12:38
Default
  #11
Member
 
Join Date: Apr 2010
Posts: 51
Rep Power: 16
bephi is on a distinguished road
hi daniel,
its great that you want to implement the complete womersley profile in 3D! i would like to improve my BC as well but i am in cambodia on vacation until the 1st of august and the internet is pretty slow!
but in the first week of august i am back at work.

it would be nice if we can make some progress with the BC in openfoam!
best regards!
philipp
bephi is offline   Reply With Quote

Old   July 20, 2011, 17:58
Default
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by nihil View Post
Therefore, I started to implement the functions j0(z), exp(z), pow(z,n), sqrt(z,n) etc for complex numbers (z), which are, as far as I know, not implemented in OF yet, right?
Bessel functions are (see the Programmers guide), but not for complex numbers.

If you manage to get your formula to pure real functions (you'll need one in the end anyway) you might as well use groovyBC again (Bessel functions are there under the names besselJ0 etc)
gschaider is offline   Reply With Quote

Old   July 21, 2011, 10:35
Default
  #13
New Member
 
Daniel
Join Date: Nov 2009
Posts: 10
Rep Power: 16
nihil is on a distinguished road
Hej and thanks for replying!

Quote:
Originally Posted by gschaider View Post
Bessel functions are (see the Programmers guide), but not for complex numbers.
Yes I know that, and I allready used it. As far as I understood, the standard <cmath> Bessel is loaded in
src/OpenFOAM/primitives/Scalar/Scalar.H, right?

Quote:
Originally Posted by gschaider View Post
If you manage to get your formula to pure real functions (you'll need one in the end anyway) you might as well use groovyBC again (Bessel functions are there under the names besselJ0 etc)


I don't know if this is possible. I might be wrong but the formular reads somthing like

u(r,t) = exp(z*t) * (1 - J0(z*r) / J0(z) ) with z = complex number,

so one have to take u.Re() as physically relevant part in the very end...!?!



However, I allready implemented all the necessary formulas in C-Code (or lets better say I copy-pasted all the stuff from elsewhere, just put it together in the right order and slightly modified it ). It works fine, it's veryfied and
I get nice oscillating Womersley profiles...

Furthermore, I allready implemented all the functions for complex scalars in OF, that works fine too. (see question 1, 3, 4)

But now I have problems to make all the operators and functions work also for "complexScalarFields". How do I do that? (see question 5, 6 )

Cheers
Daniel
nihil is offline   Reply With Quote

Old   August 2, 2011, 07:51
Default
  #14
Member
 
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 15
liguifan is on a distinguished road
Quote:
Originally Posted by bephi View Post
Good morning!
I have no access to the files right now but I used the real part of the complex function which is:


As I said just take care of the sinh and cosh!
I hope that helps!
Greets!
Hi Bephi,

I am very interested your post about the expression of Womersley. But I can not open the photo you post. Can you please let me know how you implement the Womersley expression? Thanks a lot.
liguifan is offline   Reply With Quote

Old   August 3, 2011, 00:12
Default
  #15
Member
 
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 15
liguifan is on a distinguished road
Quote:
Originally Posted by nihil View Post
Hej and thanks for replying!



Yes I know that, and I allready used it. As far as I understood, the standard <cmath> Bessel is loaded in
src/OpenFOAM/primitives/Scalar/Scalar.H, right?



I don't know if this is possible. I might be wrong but the formular reads somthing like

u(r,t) = exp(z*t) * (1 - J0(z*r) / J0(z) ) with z = complex number,

so one have to take u.Re() as physically relevant part in the very end...!?!



However, I allready implemented all the necessary formulas in C-Code (or lets better say I copy-pasted all the stuff from elsewhere, just put it together in the right order and slightly modified it ). It works fine, it's veryfied and
I get nice oscillating Womersley profiles...

Furthermore, I allready implemented all the functions for complex scalars in OF, that works fine too. (see question 1, 3, 4)

But now I have problems to make all the operators and functions work also for "complexScalarFields". How do I do that? (see question 5, 6 )

Cheers
Daniel
Hi nihil,

Did you successfully implement the Womersley pulsatile inlet flow using u(r,t) = exp(z*t) * (1 - J0(z*r) / J0(z) ) where z is complex number?

I am working on the same thing as well. Where is the A/z*rho*w term gone?

Very interested!
liguifan is offline   Reply With Quote

Old   August 10, 2011, 03:42
Default
  #16
Member
 
Join Date: Apr 2010
Posts: 51
Rep Power: 16
bephi is on a distinguished road
Quote:
Originally Posted by liguifan View Post
Hi Bephi,

I am very interested your post about the expression of Womersley. But I can not open the photo you post. Can you please let me know how you implement the Womersley expression? Thanks a lot.
Hi and sorry for the late answer. Well, I implemented the following version of the real part of the Womersley solution:


For this I used groovyBC from Bernhard (thanks again!) which worked quite well.
First I tested with a standard parabolic velocity profile and then changed to the formula above.
greets!
bephi is offline   Reply With Quote

Old   August 10, 2011, 04:11
Default
  #17
Member
 
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 15
liguifan is on a distinguished road
Quote:
Originally Posted by bephi View Post
Hi and sorry for the late answer. Well, I implemented the following version of the real part of the Womersley solution:


For this I used groovyBC from Bernhard (thanks again!) which worked quite well.
First I tested with a standard parabolic velocity profile and then changed to the formula above.
greets!
Thanks for replying!

But how do you decide the value of A. eg, How do you find the mean velocity of the flow? or I know the mean velocity at different t, how can I find A in this formula?

Any ideas?

Thanks a lot!
liguifan is offline   Reply With Quote

Old   August 10, 2011, 05:00
Default
  #18
Member
 
Join Date: Apr 2010
Posts: 51
Rep Power: 16
bephi is on a distinguished road
Quote:
Originally Posted by liguifan View Post
Thanks for replying!

But how do you decide the value of A. eg, How do you find the mean velocity of the flow? or I know the mean velocity at different t, how can I find A in this formula?

Any ideas?

Thanks a lot!
This depends on the amplitude and mean velocity you like to have. I don't know for what you are needing this profile. In my case it was a model of the basilar arterie in the Circle of Willis so I got the values from literature....
bephi is offline   Reply With Quote

Old   August 11, 2011, 03:40
Default
  #19
Member
 
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 15
liguifan is on a distinguished road
Quote:
Originally Posted by bephi View Post
This depends on the amplitude and mean velocity you like to have. I don't know for what you are needing this profile. In my case it was a model of the basilar arterie in the Circle of Willis so I got the values from literature....
Hi bephi,

Thanks for showing the formula.

I may not explain it properly in last post. Sorry for that.

Here is a mean velocity vs time figure from a journal paper. We can see the mean velocity profile is asymmetric across 1s.

They use womersley inlet condition with womersley number 7, they give the property of the blood and geometry of the artery. So I can easily find the frequency w. Then substitute w( which is n in your formula ). I got a parabolic velocity profile pulse with time. But the velocity profile seem to be symmetrical, which like a sin function across 1s ( time period ). You may notice that in your simulation. If so, please let me know how would you make an asymmetric velocity profile and find the A in your formula?

I appreciate!
Attached Images
File Type: png Screenshot.png (20.2 KB, 124 views)
liguifan is offline   Reply With Quote

Old   August 22, 2011, 05:51
Default Womersley profile - oscillatory pipe flow - complex fields
  #20
New Member
 
Daniel
Join Date: Nov 2009
Posts: 10
Rep Power: 16
nihil is on a distinguished road
Hi,

I was very busy with other stuff the last weeks, but now I try to finish my Womersley profile BC...

Can someone tell me how and where to overload the operators for complexFields? For example, my problem is:

Why does this work?


scalarField stf1 = scalarField(7);
scalarField stf2 = 5 + stf1 ;


But this does not?

complex c = complex( 3, 9 ) ;
complexField ctf1 = ReComplexField( 7 ) ;
complexField ctf2 = c + ctf1 ;


error: no match for ‘operator+’ in ‘c + ctf2’
...

Thanks for any helpful hints
Daniel

nihil is offline   Reply With Quote

Reply


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
UDF error - parabolic velocity profile - 3D turbine Zaqie Fluent UDF and Scheme Programming 9 June 25, 2016 19:08
[swak4Foam] Scale discrete inlet velocity profile with groovyBC cboss OpenFOAM Community Contributions 1 June 20, 2010 13:02
FSI- Pipe- uniform velocity profile inlet Absy Main CFD Forum 0 April 6, 2010 03:01
Velocity Profile Jeff FLUENT 1 November 24, 2008 08:21
problem with velocity inlet profile file Duncan FLUENT 3 November 21, 2005 07:28


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