|
[Sponsors] |
April 30, 2020, 10:49 |
Writing Integral with Bessel Function
|
#1 |
Member
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12 |
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! |
|
April 30, 2020, 12:10 |
|
#2 |
Member
CFD USER
Join Date: May 2019
Posts: 40
Rep Power: 6 |
Try the following:
Code:
Foam::jn(0, s) Foam::jn(1, s) // or Foam::j0(s) Foam::j1(s) Last edited by CFD_10; April 30, 2020 at 15:34. |
|
May 4, 2020, 13:36 |
|
#3 |
Member
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12 |
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! |
|
May 4, 2020, 15:30 |
|
#4 | |
Member
CFD USER
Join Date: May 2019
Posts: 40
Rep Power: 6 |
Quote:
What is the reference of that equation? |
||
May 4, 2020, 16:25 |
|
#5 |
Member
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12 |
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, |
|
May 5, 2020, 07:16 |
|
#6 | |
Member
CFD USER
Join Date: May 2019
Posts: 40
Rep Power: 6 |
Quote:
My guess is that 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. |
||
May 5, 2020, 10:06 |
|
#7 | |
Member
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12 |
Quote:
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, |
||
May 5, 2020, 14:09 |
|
#8 |
Member
CFD USER
Join Date: May 2019
Posts: 40
Rep Power: 6 |
You can use your favorite numerical integration method to compute that integral (Simpson, Romberg, Gauss quadratures, etc.).
You have: You can change the limits of the integral to make it easy (over a finite interval): 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. |
|
June 24, 2020, 12:32 |
|
#9 |
Member
James
Join Date: Jan 2014
Posts: 38
Rep Power: 12 |
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, |
|
May 4, 2022, 05:37 |
help
|
#10 | |
New Member
Join Date: Jan 2021
Posts: 12
Rep Power: 5 |
Quote:
How many intervals did you use to integrate with the Trapezoid rule? Last edited by Schmidtgen; May 13, 2022 at 07:47. |
||
|
|
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 |