|
[Sponsors] |
How to calculate laplacian of a scalar in cfx? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 1, 2010, 13:55 |
How to calculate laplacian of a scalar in cfx?
|
#1 |
New Member
Jun
Join Date: Aug 2010
Posts: 12
Rep Power: 16 |
Hi all:
I am trying to calculate a laplacian of a scalar (for example, temperature) to be used in a source term. The CFX manual shows how to get value of gradient through user fortran, but not laplacian. Has anyone done this calculation before? Thanks. Jun Last edited by Jun; October 3, 2010 at 22:44. |
|
October 3, 2010, 15:28 |
|
#2 | |
New Member
Jun
Join Date: Aug 2010
Posts: 12
Rep Power: 16 |
Quote:
Thanks. Last edited by Jun; October 3, 2010 at 22:54. Reason: delete |
||
October 3, 2010, 22:45 |
|
#3 | |
New Member
Jun
Join Date: Aug 2010
Posts: 12
Rep Power: 16 |
Quote:
Thanks. |
||
October 4, 2010, 19:10 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
In CFX V12 you should be able to get the gradients in CEL rather than fortran. Not sure if you are going to be able to get the Laplacian from that, I have never tried. Give it a go and see if it works. Otherwise I would discuss with CFX support, there probably is a way and it might not be documented.
|
|
October 5, 2010, 11:07 |
|
#5 |
New Member
Jun
Join Date: Aug 2010
Posts: 12
Rep Power: 16 |
USER_GETVAR is the function can be used to get the gradient of a variable. But I can not find the explanation of the meaning of "gradient" of a vector variable.
I tried to use USER_GETVAR with option "gradient" on a vector variable, say "phase.velocity.gradient", USER_GETVAR did not give error message and there were outputs. But I dont know the meaning of the outputs and dont know how to use them. I am waiting the response from ANSYS support team, but hope somebody here can help. One other option of the USER_GETVAR function is "curl", which is easy to understand for a vector variable. |
|
October 5, 2010, 14:50 |
|
#6 |
New Member
Jun
Join Date: Aug 2010
Posts: 12
Rep Power: 16 |
Finally, I have figured out one way.
First, three scalar additional variables are defined to represent x, y, z gradient of Temprerature. Then, selected components from the gradients of those three additional varialbes are combined to get the laplacian of the temperature. Hope it will be helpful for others. Or please let me know there is any problem. Jun Last edited by Jun; October 5, 2010 at 16:42. |
|
October 5, 2010, 21:14 |
|
#7 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
As I said, you don't need fortran to do this. In V12 you can get gradients from CEL.
It sounds like you have no idea about gradients of vector fields - I recommend you do some reading into gradients of vector fields before proceeding or you will be wasting your time. |
|
October 5, 2010, 21:32 |
|
#8 | |
New Member
Jun
Join Date: Aug 2010
Posts: 12
Rep Power: 16 |
Quote:
Thank you for your input. Could you explain more how to use cel to get the gradient? I am using v12 and the CEL #2 example in the HELP shows how to define a cel function to call a UDF, in which USER_GETVAR is called to get the gradient of a variable. Can you do it in a simpler way? About gradient, I have done enough reading I think. My understanding is that gradient operator is a vector. So when the gradient of a vector variable is called, there are only two possible ways: one is divergence of the vector variable, the other one is curl of the vector variable. Laplacian of a scalar variable, is the divergence of the gradient of that scalar variable and the laplacian is a scalar. Is there any thing wrong? |
||
October 5, 2010, 21:39 |
|
#9 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
Try Temperature.Gradient_x. I think that should do it - all discussed in the CFX documentation.
|
|
October 5, 2010, 21:51 |
|
#10 | |
New Member
Jun
Join Date: Aug 2010
Posts: 12
Rep Power: 16 |
Quote:
Temperature.Gradient_x.Gradient_x is unrecognised name. You know what, I tried Temperature.Laplacian, and there is no error message, so maybe it is defined already in the system. But it is not very comfortable, just to assume Laplacian is indeed calculated. I think it can be tested. Thank you, Glenn, for all these discussion. Last edited by Jun; October 5, 2010 at 22:13. |
||
October 5, 2010, 22:17 |
|
#11 | |
New Member
Jun
Join Date: Aug 2010
Posts: 12
Rep Power: 16 |
Quote:
Temperature.Laplacian does not work. Solver quits after a bunch of message: ##,MASSOU_CALVAR,VEL ## is number from 1 to several hundreds. |
||
October 6, 2010, 07:13 |
|
#12 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
Sorry, yes, you are right - the built in functions will not do second order derivatives like this. Maybe you will need fortran after all.
|
|
June 20, 2013, 23:21 |
|
#13 |
New Member
Join Date: Mar 2012
Posts: 18
Rep Power: 14 |
You can use “USER_GETVAR” to get the Laplacian by User Fortran in CFX14.0. But laplacian is not available in CFX of lower edition
Last edited by hustxinxin; June 23, 2013 at 23:23. |
|
October 17, 2013, 08:54 |
|
#14 | |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
Quote:
UPDATE: Segmentation violation error was due to some other reason. Actually when I try to get variable laplacian USER_GETVAR sets CRESLT = OPER. Anyone knows what does OPER mean? Last edited by Antanas; October 21, 2013 at 04:57. |
||
October 24, 2013, 18:16 |
|
#15 | |
New Member
Join Date: Mar 2012
Posts: 18
Rep Power: 14 |
Unfortunately, I came across the same problem with you, so I gave up. I think it's a terrible bug in CFX.
Quote:
|
||
October 24, 2013, 18:18 |
|
#16 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
You will probably have to talk to ANSYS support to get this working. And if it is a bug you definitely should report it so it can be fixed for the next version.
|
|
October 24, 2013, 18:21 |
|
#17 | |
New Member
Join Date: Mar 2012
Posts: 18
Rep Power: 14 |
By the way, CRESLT = OPER means that there is some wrong with your operater. I think that there is no other possibility for this error except the inner bug!
Quote:
|
||
March 2, 2018, 05:30 |
|
#18 |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
I know this's old post, but I have some obvious idea. Let Phi be our scalar field. To calculate laplacian we create two additional variables gradPhi (vector) and laplPhi (scalar). Then we set components of gradPhi to be Phi.Gradient X, Phi.Gradient Y, Phi.Gradient Z and laplPhi = gradPhi_x.Gradient X + gradPhi_y.Gradient Y + gradPhi_z.Gradient Z.
|
|
March 2, 2018, 08:30 |
|
#19 |
Senior Member
Join Date: Jun 2009
Posts: 1,873
Rep Power: 33 |
You can also try the Laplacian operation, ie.
Temperature.Laplacian or Velocity u.Laplacian |
|
March 2, 2018, 09:07 |
|
#20 |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
||
Tags |
laplacian, user fortran |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
using CFX to calculate NPSHR for pump | sandy | CFX | 0 | March 19, 2008 13:52 |
How CFX calculate TKE and Epsilon from intensity? | David | CFX | 0 | November 24, 2005 05:53 |
Laplacian of a scalar value | J. Park | FLUENT | 0 | September 17, 2003 13:39 |
CFX 4.4 installation problem | Pandu Sattvika | CFX | 1 | December 1, 2001 05:07 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 14, 2000 00:03 |