|
[Sponsors] |
November 21, 2018, 08:27 |
Source term for axisymmetric problems
|
#1 |
Member
Saurabh Das
Join Date: Jul 2018
Posts: 43
Rep Power: 8 |
Hello, I am solving a 2D-axisymmetrical laser heating problem.
The laser radius is 0.4mm and it has a profile I = I0*exp(-del*x), where x is the x co-ordinate of the cell and del is the absorptivity coefficient in m^-1 . I wrote the following macro for heat source: Code:
DEFINE_SOURCE(top_hat,c,t,dS,eqn) { real x[ND_ND],time; real x0,y0,source; real I0 = 1e5; real del = 1; time=RP_Get_Real("flow-time"); C_CENTROID(x,c,t); x0 = x[0]; y0 = x[1]; if (y0 > 0 && y0 < 0.4e-3) { source = I0*exp(-del*x); dS[eqn] = 0; } else { source = 0; dS[eqn] = 0; } return source; } Is the source term macro correctly defined? Thanks Last edited by Sorabh; November 21, 2018 at 23:50. |
|
November 22, 2018, 21:01 |
|
#2 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Quote:
You should add additional condition to specify only the first column cells near the left wall. Or another method, do not use DEFINE_SOURCE, just use DEFINE_PROFILE to specify the heat flux on left wall. |
||
November 23, 2018, 23:56 |
|
#3 | |
Member
Saurabh Das
Join Date: Jul 2018
Posts: 43
Rep Power: 8 |
Quote:
Will that not be enough to constraint along x axis? I also considered using the DEFINE_PROFILE to specify heat flux on the wall.. but it is supposed to be a volumetric heat source, hence both x and y (not just y) co-ordinates should be involved. |
||
November 24, 2018, 07:03 |
|
#4 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
Hi Sorabh,
Here are a few thoughts: ++ It is a mistake to write "exp(-del*x)", since x is an array. A helpful compiler would have issued a warning about this. Instead, try "exp(-del*x0)". ++ If you make this correction, the source looks correctly defined. The test for "if(y>0)" is pointless (since y<0, and on this occasion even y==0 are impossible). ++ I do not remember the details of source terms in 2D-axisymmetric simulations, but I do remember that you need to check the details. Is the source really "per m3", or is it in fact "per angle of rotation" (hence missing a factor of 2*M_PI)? You need to check this -- and I would not trust my understanding of the manuals (and I would not assume that UDFs and GUI-defined values use the same rules), so you need to check this in a test model. I cannot stress this too much. If you do not do this check, you should regard your results as doubtful to within a factor of 2*M_PI. ++ If your model's extent in the x-direction is small compared to the lengthscale "(1./del)", then the rate of source will be approximately constant in the x-direction. In that sense, I do not see your results as obviously wrong. Good luck! Ed |
|
November 28, 2018, 10:58 |
|
#5 |
Member
Saurabh Das
Join Date: Jul 2018
Posts: 43
Rep Power: 8 |
Yeah, I did what you said.. the 'x' in the equation was actually x[0], and the heat generation is defined in W/m^3, so that is sorted out.
I noticed that whenever the point of heat generation is at one of the boundaries, the solution is borked.. but it works when the heat is generated 'within' the doman... |
|
Tags |
laser-heating, source term |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 19:13 |
[Other] How to use finite area method in official OpenFOAM 2.2.0? | Detian Liu | OpenFOAM Meshing & Mesh Conversion | 4 | November 3, 2015 04:04 |
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error | FerdiFuchs | OpenFOAM Community Contributions | 27 | April 16, 2014 16:14 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 11:57 |
pisoFoam compiling error with OF 1.7.1 on MAC OSX | Greg Givogue | OpenFOAM Programming & Development | 3 | March 4, 2011 18:18 |