CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Differencing each derivative component of an equation with different accuracies

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By FMDenaro

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 24, 2016, 19:23
Default Differencing each derivative component of an equation with different accuracies
  #1
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 12
soes is on a distinguished road
For instance in a Laplace equation is it generally possible to difference one component central difference in space and the other 1st order accurate forward/backward difference?

Generally, if an equation is sum of derivative components should all components be differenced with similar method (i.e. central, or backward ..) or should all be differenced with same order of accuracy (1st order, 2nd order ...), or there is no specific limitation on the schemes?

Finite difference
soes is offline   Reply With Quote

Old   March 25, 2016, 04:06
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Soheil.esmaeilzadeh View Post
For instance in a Laplace equation is it generally possible to difference one component central difference in space and the other 1st order accurate forward/backward difference?

Generally, if an equation is sum of derivative components should all components be differenced with similar method (i.e. central, or backward ..) or should all be differenced with same order of accuracy (1st order, 2nd order ...), or there is no specific limitation on the schemes?

Finite difference

there is no theoretical reason to create a non-homogeneous discretization for elliptical equation
FMDenaro is offline   Reply With Quote

Old   March 25, 2016, 13:13
Default
  #3
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 12
soes is on a distinguished road
Consider a 2d rectangular domain, for example in the far right edge I do backward in x and central in y, is this allowed? or on the left edge forward in x and central in y for instance.
soes is offline   Reply With Quote

Old   March 25, 2016, 13:16
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Soheil.esmaeilzadeh View Post
Consider a 2d rectangular domain, for example in the far right edge I do backward in x and central in y, is this allowed? or on the left edge forward in x and central in y for instance.
I do not see a reason for doing that...
FMDenaro is offline   Reply With Quote

Old   March 25, 2016, 13:37
Default
  #5
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 12
soes is on a distinguished road
I do not want to use ghost cells to treat the boundary for instance, so I prefer to write a backward in x at the far right edge for example. I mean I am just asking about the possibility of this to do from numerical aspect.
soes is offline   Reply With Quote

Old   March 25, 2016, 13:45
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Soheil.esmaeilzadeh View Post
I do not want to use ghost cells to treat the boundary for instance, so I prefer to write a backward in x at the far right edge for example. I mean I am just asking about the possibility of this to do from numerical aspect.

but the treatment of the BC.s for the Laplace equation is a different issue from the discretization of the operator....

If you have Neumann BC.s you can work in several way, for example using the Div Grad operators so that at a boundary you can directly set n.Grad.
Alternatively, you can discretize the d/dn derivative with backward/forward formula (but at second order of accuracy) and insert the expression in the central discretization of the Lap operator.
soes likes this.
FMDenaro is offline   Reply With Quote

Old   March 25, 2016, 13:59
Default
  #7
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 12
soes is on a distinguished road
Thanks for you reply.

Actually, in reality I have a boundary condition at the bottom as:
w=(p_x/p_xx)*w_x+w_z*(2*p_x/p_xx-p)-p_x*w_zx
assuming that p is like a profile function such as p=sin(k*x) and w is velocity in vertical direction (let's call it z)

Actually when I want to discretize this equation at the bottom grid line, I think of using central in x and forward in z(vertical direction) for the points inside domain; and forward and backward at bottom left and bottom right respectively for both x and z.

That's how I came up with my question.
soes is offline   Reply With Quote

Old   March 25, 2016, 14:03
Default
  #8
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Soheil.esmaeilzadeh View Post
Thanks for you reply.

Actually, in reality I have a boundary condition at the bottom as:
w=(p_x/p_xx)*w_x+w_z*(2*p_x/p_xx-p)-p_x*w_zx
assuming that p is like a profile function such as p=sin(k*x) and w is velocity in vertical direction (let's call it z)

Actually when I want to discretize this equation at the bottom grid line, I think of using central in x and forward in z(vertical direction) for the points inside domain; and forward and backward at bottom left and bottom right respectively for both x and z.

That's how I came up with my question.


well, that's not clear ... you write a BC.s for w in terms of a (mixed) second derivative of w ??? That sounds strange...

of course I imagine the the function p is known and does not need a discretization of its derivatives.
FMDenaro is offline   Reply With Quote

Old   March 25, 2016, 14:05
Default
  #9
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 12
soes is on a distinguished road
Yes yes, p is known like a sin function so it's derivative is also known at each x location, no problem with that.

Yes, basically the no penetration condition at a corrugated bottom I change it to this complex function. But that's how it is but my question is regarding the discretisation mainly
soes is offline   Reply With Quote

Old   March 25, 2016, 14:16
Default
  #10
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Soheil.esmaeilzadeh View Post
Yes yes, p is known like a sin function so it's derivative is also known at each x location, no problem with that.

Yes, basically the no penetration condition at a corrugated bottom I change it to this complex function. But that's how it is but my question is regarding the discretisation mainly

Honestly, I don't know if your mathematical problem would be properly closed this way, you should check for elliptic problems with oblique/degenerate oblique BC.s.

I am supposing some compatibility constraint must be satisfied
FMDenaro is offline   Reply With Quote

Old   March 25, 2016, 14:22
Default
  #11
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 12
soes is on a distinguished road
I will write a description of my formulation in a few hours
soes is offline   Reply With Quote

Reply

Tags
differencing scheme, finite difference method, order of accuracy


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting the height of the stream in the free channel kevinmccartin CFX 12 October 13, 2022 22:43
Porous Modeling of Energy equation in OpenFOAM mohammad_kordo OpenFOAM Running, Solving & CFD 9 November 22, 2020 08:18
Governing derivative equation mojtaba283 Fluent UDF and Scheme Programming 1 January 23, 2016 02:58
Pressure distribution on a wall darazsbence CFX 17 October 6, 2015 11:38
Diffusion Equation izardy amiruddin Main CFD Forum 2 July 4, 2002 09:14


All times are GMT -4. The time now is 16:25.