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

next to wall gradient correction for SGS-model BC

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2018, 05:20
Default next to wall gradient correction for SGS-model BC
  #1
New Member
 
Thomas Hultsch
Join Date: Apr 2018
Posts: 3
Rep Power: 8
ThomasHultsch is on a distinguished road
Dear FOAMers,

I am implementing a sub-grid scale model for convection dominated scalar transport (of a volume fraction of soil).
I am using the scalarTransportFoam solver with given velocity field.
With the SGS-model I calculate wall-normal gradients of the transported scalar to get realistic diffusive flux on a coarse mesh.
I already wrote a new boundary condition derived from the fixedGradientBC to correct the gradient at the wall and its working pretty well.

Now I also have to correct the gradient at the "next to wall" faces, i. e. at the faces between the wall cells and the 2nd row of cells. Here the standard linear interpolation creates way to high diffusive flux.

I already found out how to get the cellIDs via fvPatch.faceCells() and mesh().cellCells(). But I dont know how I should implement the correction of the gradient or diffusive flux for these cells.
My plan was to use an deferred correction of the diffusive flux, that is calculated explicitly (from old timestep and SGS-model) and added to the source vector (b vector) at field calculation. But I dont know how to achieve this.

Question: What is the best or easiest way to correct a gradient or diffusive flux at faces that are not member of an patch, but internal faces? The cell values should not be changed, because they are needed for advection.

All hints are appreciated.

Thanks in advance

Thomas
ThomasHultsch is offline   Reply With Quote

Old   April 6, 2018, 05:03
Default error: const labelUList has no member named 'found'
  #2
New Member
 
Thomas Hultsch
Join Date: Apr 2018
Posts: 3
Rep Power: 8
ThomasHultsch is on a distinguished road
Hello FOAMers,

a little update from my side:

I am trying to use the fvOptions to correct the flux in the near wall cells.
I use my boundary condition to write a cellSet with the cellIDs of the patch cells and the adjacent cell row.

Now a problem occured in the function that sets the cellSet. The compiler tells me labelUList not having a member named "found". But it has one. I also tried the find() function with find() == -1. Its the same with that.

My code where this happens:
Code:
const labelUList& fC = this->patch().faceCells();

forAll(fC, fCi)
{
    const labelList& nC = this->patch().boundaryMesh().mesh().cellCells(fC[fCi]);
    forAll(nC, nCi)
    {
        if (!fC.found(nC[nCi])) corrCellSet.insert((fC[fCi], nc[nCi])));
    }
}
I really dont know, why the compiler complains about the found() function.

Maybe one of you has a idea, where the mistake is.
ThomasHultsch is offline   Reply With Quote

Old   April 6, 2018, 11:55
Default
  #3
New Member
 
Thomas Hultsch
Join Date: Apr 2018
Posts: 3
Rep Power: 8
ThomasHultsch is on a distinguished road
Hi,

I found out, the troubling functions find() and found() where just added in v1712. Since I use 5.0, they are obviously not available.

The correct code is:
Code:
if (findIndex(fC, nC[nCi]) == -1) {...}
ThomasHultsch is offline   Reply With Quote

Reply

Tags
boundary condition, correction, gradient

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Divergence in AMG solver! marina FLUENT 20 August 1, 2020 11:30
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 07:30
Wrong multiphase flow at rotating interface Sanyo CFX 14 February 7, 2017 17:19
Overflow Error in Multiphase Modelling with Two Continuous Fluids ashtonJ CFX 6 August 11, 2014 14:32
Wall functions Abhijit Tilak Main CFD Forum 6 February 5, 1999 01:16


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