CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Difference between grad and div on boundaries?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By tschenkel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 8, 2022, 09:28
Default Difference between grad and div on boundaries?
  #1
Member
 
Torsten Schenkel
Join Date: Jan 2014
Posts: 69
Rep Power: 12
tschenkel is on a distinguished road
Hi,



I am trying to implement a source term for a transport equation (shear stress driven particle migration).


The original term is implemented using fvc::laplacian, but I need to move to an anisotropic model (multiply with a nonisotropic diagonal matrix).

I have implemented the following:


sourceCorig = fvc::laplacian(linKc*Kc*sqr(a)*H, H*gammaDot);
sourceCHgamma = fvc::div(linKc*Kc*sqr(a)*H*fvc::grad(H*gammaDot));
sourceCHgammaZ = fvc::div(linKc*Kc*sqr(a)*H*fvc::div(H*gammaDot*Z)) ;



where Z is for the moment the identity matrix.

If my maths is right, these should all be identical.

However, while there are some discrepencies between laplacian() and div(grad()), the div(div( *I) does not behave at the wall (right side in the graph).

Am I missing something here? Do I need to treat the wall separately?
Attached Images
File Type: png sourceZdiscrepancy.png (28.2 KB, 13 views)
tschenkel is offline   Reply With Quote

Old   August 22, 2022, 14:07
Default
  #2
Senior Member
 
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 6
Tibo99 is on a distinguished road
Maybe this could help?

discrepancy in fvc::grad(U)
Tibo99 is offline   Reply With Quote

Old   August 24, 2022, 04:55
Default
  #3
Member
 
Torsten Schenkel
Join Date: Jan 2014
Posts: 69
Rep Power: 12
tschenkel is on a distinguished road
Quote:
Originally Posted by Tibo99 View Post
Maybe this could help?

discrepancy in fvc::grad(U)

Thanks. I'll need to look into that. But it seems to be something different (to do with BCs?).
Tibo99 likes this.
tschenkel is offline   Reply With Quote

Old   August 24, 2022, 08:26
Default
  #4
Senior Member
 
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 6
Tibo99 is on a distinguished road
Because you use the Laplacian and grad in the calculation of the BC, I just pointed this thing out in case that could may affect the results....

I didn't want to lead you toward something that could waste your energy in the wrong path....


It's really subtle and people using openfoam may be surprised when they find out about this information.

Good luck with your work!
Tibo99 is offline   Reply With Quote

Reply


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
upwind scheme for grad and div Yujuan OpenFOAM Running, Solving & CFD 0 June 26, 2020 04:55
A simple question about adding Div and Grad of a source term to the momentum equation adkar Main CFD Forum 5 May 23, 2016 17:31
Numerical schemes for grad and div Tobi OpenFOAM 6 March 11, 2013 21:24
calclulate div and grad just on specified cells -Local Time stepping mm.abdollahzadeh OpenFOAM Programming & Development 0 January 25, 2013 06:32
Possible Incompressible Turbulence Model Bugs gocarts OpenFOAM Bugs 12 November 26, 2009 14:58


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