|
[Sponsors] |
How to calculate the gradient in the boundary cells |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 15, 2011, 18:04 |
How to calculate the gradient in the boundary cells
|
#1 |
Member
Yong Wang
Join Date: Apr 2009
Posts: 34
Rep Power: 17 |
Hi, everyone.
I want to calculate the gradients of a volScalarField parameter F in the boundary cells. Now, I am using fvc::grad(F,gradF) to calculate the gradients in all cells, and then look up the values in the boundary cells. Is there any other more efficient method? I just want to reduce the time used for calculating. Thanks. Yong |
|
August 18, 2011, 15:56 |
|
#2 |
Senior Member
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 16 |
Maybe take a look at the wallGradU utility?
Is that helpful for you? |
|
August 18, 2011, 17:50 |
|
#3 | |
Member
Yong Wang
Join Date: Apr 2009
Posts: 34
Rep Power: 17 |
Quote:
Thanks. wallGradU is using wallGradU.boundaryField()[patchi] =-U.boundaryField()[patchi].snGrad();. Based on the Programmers Guide, snGrad still calculate all cells in the computational region. Right? I am also reading the code about grad and check if it's helpful. |
||
August 19, 2011, 02:55 |
|
#4 |
Senior Member
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 16 |
because u use:
U.boundaryField()[patchi] only the faces on this patch are calculated |
|
August 19, 2011, 05:27 |
|
#5 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21 |
snGrad in this context only calculates the wall normal gradient. It does so in a completely local and efficient way though. If you want to calculate the cell centred gradient for a subset of cells, I suggest you look at the code in finiteVolume/lnInclude/gaussGrad.C. This will show you the steps to calculate a gradient on a cell-by-cell basis.
|
|
August 19, 2011, 05:56 |
|
#6 | |
Senior Member
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 16 |
Quote:
|
||
August 19, 2011, 15:27 |
|
#7 | |
Member
Yong Wang
Join Date: Apr 2009
Posts: 34
Rep Power: 17 |
Quote:
|
||
August 19, 2011, 15:30 |
|
#8 |
Member
Yong Wang
Join Date: Apr 2009
Posts: 34
Rep Power: 17 |
||
August 30, 2011, 04:39 |
|
#9 |
Member
Yong Wang
Join Date: Apr 2009
Posts: 34
Rep Power: 17 |
Hi, everyone. As I want to calculate the gradient at the cells close to the boundaries. I checked the code in the gaussGrad.C:
PHP Code:
However, in the first loop, all internal faces are calculated. So, I changed the code as: PHP Code:
Thanks in advance. Yong |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 60 | July 17, 2024 06:45 |
Domain Imbalance | HMR | CFX | 5 | October 10, 2016 06:57 |
[mesh manipulation] How to delete selected cells from mesh and update boundary patches | kaka | OpenFOAM Meshing & Mesh Conversion | 2 | November 26, 2009 05:17 |
Ignore cells on partition boundary | Karl | FLUENT | 7 | May 11, 2002 23:12 |
Restriction on number of boundary cells !!! | Haris Maharana | Siemens | 1 | August 2, 2000 20:31 |