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

Adding Courant Number dependency in limited schemes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 8, 2019, 07:10
Default Adding Courant Number dependency in limited schemes
  #1
Member
 
Paul Palladium
Join Date: Jan 2016
Posts: 93
Rep Power: 10
Fauster is on a distinguished road
Dear Foamers,

I am working on the implementation of a new limited scheme in OpenFOAM. I am not very good in C++ and I almost try to work by adpating existing files of OpenFOAM. In my case I started with the QUICK.H file located in
Quote:
/opt/OpenFOAM-v1806/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/QUICK
The limiter is calculated using the centre and gradient values of neighboring node P and N of the face f.
Quote:
scalar phiCD = cdWeight*phiP + (1 - cdWeight)*phiN;

scalar phiU, phif;

if (faceFlux > 0)
{
phiU = phiP;
phif = 0.5*(phiCD + phiP + (1 - cdWeight)*(d & gradcP));
}
else
{
phiU = phiN;
phif = 0.5*(phiCD + phiN - cdWeight*(d & gradcN));
}
// Calculate the effective limiter for the QUICK interpolation
scalar QLimiter = (phif - phiU)/stabilise(phiCD - phiU, SMALL);
// Limit the limiter between upwind and downwind
return max(min(QLimiter, 2), 0);
I would like to add a Courant number dependency in the calculation of the returned limiter. If I am correct I need to call :
Quote:
const fvMesh& mesh = this->mesh();
because I will need to access to the time step mesh.time().deltaT(), the cell volume mesh.V() and the flux magnitude fvc::surfaceSum(mag(this->faceFlux_))()(). I also guess that I need to add #include "fvMesh.H" and #include "surfaceFields.H".

The problem is that I obtain various errors when I try to use
const fvMesh& mesh = this->mesh() in the scalar limiter function :
Quote:
‘const class Foam::mHRIC2Limiter<Foam::NVDTVD>’ has no member named ‘mesh’
const fvMesh& mesh = this->mesh();
Is there any smart way to do such a thing without changing all the limiter function and/or the NVDTVD.H file ?
Thanks in advance for helping me !
Fauster is offline   Reply With Quote

Old   January 8, 2019, 13:03
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
Maybe the courant number blended scheme can give you some hints of how to access the variables you want:

https://www.openfoam.com/documentati...8H_source.html
mAlletto 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
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 08:56
LES, Courant Number, Crash, Sudden Alhasan OpenFOAM Running, Solving & CFD 5 November 22, 2019 03:05
[blockMesh] --> foam fatal error: lillo763 OpenFOAM Meshing & Mesh Conversion 0 March 5, 2014 11:27
AMI interDyMFoam for mixer danny123 OpenFOAM Running, Solving & CFD 4 June 19, 2013 05:49
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15


All times are GMT -4. The time now is 00:48.