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

Where is the grad computed in SIMPLE source code?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2019, 06:07
Default Where is the grad computed in SIMPLE source code?
  #1
New Member
 
zizhou huang
Join Date: Jul 2019
Posts: 18
Rep Power: 7
zizhou is on a distinguished road
I have been trying to figure out how SIMPLE algorithm is implemented, but here: https://openfoamwiki.net/index.php/O...hm_in_OpenFOAM
it never mentions how the gradient of scalars is computed on an irregular mesh, and I haven't found where it is computed in source code. Is there anyone could tell me where is the function of grad computation? Thank you so much!
zizhou is offline   Reply With Quote

Old   September 16, 2019, 12:19
Default
  #2
New Member
 
Join Date: Dec 2015
Posts: 24
Rep Power: 11
metalfox is on a distinguished road
The explicit calculation of gradients in OpenFOAM usually involve invoking Gauss theorem:

\int_{V}\nabla\phi\approx\frac{\sum_{f}\mathbf{S}_{f}\phi_{f}}{V}

where \mathbf{S}_{f} is the surface normal facing outwards, and \mathbf{S}_{f}\phi_{f} represents the outer product of \mathbf{S}_{f} with the tensor \phi_{f} (for example, a rank 0 tensor, i.e. an scalar).

This calculation is valid for arbitrary polyhedrons.

The relevant piece of code is in gaussGrad.C (https://cpp.openfoam.org/v6/gaussGrad_8C_source.html).
metalfox 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
Custom Thermophysical Properties wsmith02 OpenFOAM 4 June 1, 2023 15:30
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 Seroga OpenFOAM Community Contributions 9 June 12, 2015 18:18
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 07:42
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51


All times are GMT -4. The time now is 21:05.