# terms with the second derivative

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 14, 2013, 12:26 terms with the second derivative #1 Senior Member   Mieszko Młody Join Date: Mar 2009 Location: POLAND, USA Posts: 139 Rep Power: 10 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) then term 1. is: HTML Code: gradgradf1.component(1); \\ f_xy term 2. is: HTML Code: gradgradf0.component(0) - gradgradf1.component(1); \\ (f_xx - f_yy) term 3. is: HTML Code: gradf.component(0)*gradf.component(0) - gradf.component(1)*gradf.component(1); \\ (f_x)^2- (f_y)^2 but unfortunately second derivative calculated as above gives me non-smooth results... 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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post fevi84 Fluent UDF and Scheme Programming 7 February 3, 2015 22:39 nikosb Main CFD Forum 0 January 17, 2010 17:07 jsm Main CFD Forum 4 August 20, 2009 06:44 titio OpenFOAM Running, Solving & CFD 0 March 19, 2009 17:02 Brindaban Ghosh Main CFD Forum 2 June 24, 2000 04:22

All times are GMT -4. The time now is 09:13.