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

Writing Integral with Bessel Function

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By CFD_10

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 30, 2020, 10:49
Default Writing Integral with Bessel Function
  #1
Member
 
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12
Madeinspace is on a distinguished road
Hi,


Bessel function seem to have been implemented in OpenFOAM library. As mentioned in the programmer's guide, Type 1 Bessel function of zeroth order in OF is j0(S) and first order is j1(S). Then how do I write to calculate this bessel function. Can someone please help?


All the notations are known but I don't know how to write it in OF.


Thanks in advance!











Attached Images
File Type: jpg 2020-04-29_161317.jpg (55.4 KB, 55 views)
Madeinspace is offline   Reply With Quote

Old   April 30, 2020, 12:10
Default
  #2
Member
 
CFD USER
Join Date: May 2019
Posts: 40
Rep Power: 6
CFD_10 is on a distinguished road
Try the following:


Code:
Foam::jn(0, s) 
Foam::jn(1, s) 

// or
Foam::j0(s)
Foam::j1(s)
Madeinspace likes this.

Last edited by CFD_10; April 30, 2020 at 15:34.
CFD_10 is offline   Reply With Quote

Old   May 4, 2020, 13:36
Default
  #3
Member
 
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12
Madeinspace is on a distinguished road
Hi CFD_10,


Thanks. Do you know what is lambda in the equation? All the other notations are process parameters but lambda must come from Bessel function. It is not mentioned in the literature what is lambda. I am completely new to this equation.



Thanks again!
Madeinspace is offline   Reply With Quote

Old   May 4, 2020, 15:30
Default
  #4
Member
 
CFD USER
Join Date: May 2019
Posts: 40
Rep Power: 6
CFD_10 is on a distinguished road
Quote:
Originally Posted by Madeinspace View Post
Hi CFD_10,


Thanks. Do you know what is lambda in the equation? All the other notations are process parameters but lambda must come from Bessel function. It is not mentioned in the literature what is lambda. I am completely new to this equation.



Thanks again!

What is the reference of that equation?
CFD_10 is offline   Reply With Quote

Old   May 4, 2020, 16:25
Default
  #5
Member
 
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12
Madeinspace is on a distinguished road
Initially developed by the authors in reference
https://link.springer.com/content/pd...BF02815302.pdf


It has since been used by several authors like
Eq. 32 in https://www.sciencedirect.com/scienc...17931019319295
Eq. 3a in https://www.researchgate.net/publica...ng_arc_welding


Regards,
Madeinspace is offline   Reply With Quote

Old   May 5, 2020, 07:16
Default
  #6
Member
 
CFD USER
Join Date: May 2019
Posts: 40
Rep Power: 6
CFD_10 is on a distinguished road
Quote:
Originally Posted by Madeinspace View Post
Initially developed by the authors in reference
https://link.springer.com/content/pd...BF02815302.pdf


It has since been used by several authors like
Eq. 32 in https://www.sciencedirect.com/scienc...17931019319295
Eq. 3a in https://www.researchgate.net/publica...ng_arc_welding


Regards,

My guess is that \lambda is an eigenvalue of the Laplacian operator. In this case, it looks like it has dimension of 1/length.


But I think you don't have to care about it since it is just an integration variable.
CFD_10 is offline   Reply With Quote

Old   May 5, 2020, 10:06
Default
  #7
Member
 
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12
Madeinspace is on a distinguished road
Quote:
Originally Posted by CFD_10 View Post
My guess is that \lambda is an eigenvalue of the Laplacian operator. In this case, it looks like it has dimension of 1/length.


But I think you don't have to care about it since it is just an integration variable.

Hi CFD_10,
Appereciate your help. Yes, It should have the dimension of 1/length so that the exponential term is dimensionless. So I defined a dimensionedScalar variable named lambda and gave it value of one with dimension (1/length). It compiles and runs however the computed values are way off. How do I compute the integration from 0 to infinity. Does Foam::J0 take care of that part?



Code:
volScalarField Jz = I_A/(2*pi)*lambda*Foam::j0(lambda*r_local)*Foam::exp(-Foam::sqr(lambda*SigmaQ)/2)*(Foam::sinh(lambda*(L0-cellCentre.component(vector::Y))))/(Foam::sinh(lambda*L0));

regards,
Madeinspace is offline   Reply With Quote

Old   May 5, 2020, 14:09
Default
  #8
Member
 
CFD USER
Join Date: May 2019
Posts: 40
Rep Power: 6
CFD_10 is on a distinguished road
You can use your favorite numerical integration method to compute that integral (Simpson, Romberg, Gauss quadratures, etc.).


You have:

J_{ze} = \int_0^\infty{f\left(\lambda; \cdots\right) \mathrm d\lambda}

You can change the limits of the integral to make it easy (over a finite interval):



\lambda = {t\over 1-t}
J_{ze}  = \int_0^1{f\left({t\over 1-t}; \cdots\right){1\over (1-t)^2} \mathrm dt}


I think you can declare Jze as volScalarField and loop over all the cells, and compute the integral for each cell.


That's my opinion take it with a grain of salt.
CFD_10 is offline   Reply With Quote

Old   June 24, 2020, 12:32
Default
  #9
Member
 
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12
Madeinspace is on a distinguished road
Thank You CFD_10. I was able to do it by computing the integral using Trapezoid rule and looping over the entire cell in the domain.


Regards,
Madeinspace is offline   Reply With Quote

Old   May 4, 2022, 05:37
Default help
  #10
New Member
 
Join Date: Jan 2021
Posts: 12
Rep Power: 5
Schmidtgen is on a distinguished road
Quote:
Originally Posted by Madeinspace View Post
Thank You CFD_10. I was able to do it by computing the integral using Trapezoid rule and looping over the entire cell in the domain.


Regards,

How many intervals did you use to integrate with the Trapezoid rule?

Last edited by Schmidtgen; May 13, 2022 at 07:47.
Schmidtgen 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
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 13 March 24, 2021 07:15
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 10:51
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


All times are GMT -4. The time now is 23:54.