|
[Sponsors] |
February 14, 2013, 12:26 |
terms with the second derivative
|
#1 |
Senior Member
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 145
Rep Power: 17 |
Dear Foamers,
I need to discretize/calculate terms which contain second derivative (not Laplacian), as follows: 1. 2. 3. and non-linear term with first derivative: For now the only way which works for me is to calculate twice the gradient of the function: HTML Code:
gradf = fvc::grad(f); \\ it gives (f_x, f_y) gradgradf0 = fvc::grad(gradf.component(0)); \\it gives (f_xx, f_yx) gradgradf1 = fvc::grad(gradf.component(1)); \\it gives (f_xy, f_yy) HTML Code:
gradgradf1.component(1); \\ f_xy HTML Code:
gradgradf0.component(0) - gradgradf1.component(1); \\ (f_xx - f_yy) HTML Code:
gradf.component(0)*gradf.component(0) - gradf.component(1)*gradf.component(1); \\ (f_x)^2- (f_y)^2 Is there any other/better way to compute terms like the one above ? Thanks ZZM Last edited by ziemowitzima; February 14, 2013 at 12:46. Reason: post was not finished |
|
Tags |
double gradient, nonlinear terms, second derivative |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Derivative of a scalar or a variable through UDF | fevi84 | Fluent UDF and Scheme Programming | 7 | February 3, 2015 22:39 |
Implicit treatment of advection terms and pressure correction | nikosb | Main CFD Forum | 0 | January 17, 2010 17:07 |
Using source terms | jsm | Main CFD Forum | 4 | August 20, 2009 07:44 |
Question in definition of terms in solve | titio | OpenFOAM Running, Solving & CFD | 0 | March 19, 2009 17:02 |
K-Epsilon model? | Brindaban Ghosh | Main CFD Forum | 2 | June 24, 2000 05:22 |