|
[Sponsors] |
Calculate derivatives in a non-uniform grid |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 1, 2019, 08:08 |
Calculate derivatives in a non-uniform grid
|
#1 |
Senior Member
Join Date: Jan 2018
Posts: 121
Rep Power: 8 |
I have a non-uniform 2D grid (non-equal intervals between nodes). [x,y]
I also have the data (U) calculated on this grid. I want to calculate the derivatives of U with respect to y and then x. How can I do this? (Specially using MATLAB) |
|
August 1, 2019, 08:17 |
|
#2 |
Senior Member
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 416
Rep Power: 15 |
Is it rectangular grid?
You could just use matrix operations ie dmyfdx = (myf(2:end)-myf(1:end-1)) / (coordx(2:end)-coordx(1:end-1)) where myf is your variable and coordx is the x coordinate in the grid. If this is not sufficiently helpful then please create a small test case demonstrating the data format in a small example. Thanks. |
|
August 1, 2019, 08:45 |
|
#3 | |
Senior Member
Join Date: Jan 2018
Posts: 121
Rep Power: 8 |
Quote:
|
||
August 1, 2019, 18:17 |
|
#4 |
Senior Member
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 416
Rep Power: 15 |
I think you can view the formulas here
http://web.media.mit.edu/~crtaylor/calculator.html Vary the number of input points to get the desired order of accuracy. |
|
August 1, 2019, 18:39 |
|
#5 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73 |
Quote:
For example, you have the value f1,f2,f3 at x1,x2,x3. Then you can define a lagrangian second degree polynomial and compute analytically the derivative. More nodes allow you to increase the degree of the polynomial and the accuracy of the derivative. Have also a look to the textbook of Peric & Ferziger |
||
August 2, 2019, 02:23 |
|
#6 | |
Senior Member
Join Date: Jan 2018
Posts: 121
Rep Power: 8 |
Quote:
Last edited by Moreza7; August 2, 2019 at 04:37. |
||
Tags |
derivatives, non-uniform grid |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
dsmcFoam setup | hherbol | OpenFOAM Pre-Processing | 1 | November 19, 2021 02:52 |
Inlet patch problems | martyn88 | OpenFOAM Running, Solving & CFD | 6 | April 21, 2017 19:34 |
LES supersonic free jet | martyn88 | OpenFOAM | 22 | April 17, 2015 07:00 |
Divergent temperature in chtMultiRegion(Simple)Foam | akrasemann | OpenFOAM Running, Solving & CFD | 13 | March 24, 2014 03:54 |
Combustion Convergence problems | Art Stretton | Phoenics | 5 | April 2, 2002 06:59 |