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

Are same schemes available using 2 differents fvc::div() constructors ?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 8, 2021, 00:32
Default Are same schemes available using 2 differents fvc::div() constructors ?
  #1
Member
 
Join Date: Jun 2019
Posts: 41
Rep Power: 6
Voulet is on a distinguished road
Hi there. I use openfoam V8.


I've my own solver with some custom volVectorField.


According to the banana method and https://cfd.direct/openfoam/user-guide/v8-fvSchemes/ for divergences schemes I can use some schemes with some limitors in order to make the divergence not to numerically explode. I'm interested with these schemes.


In my simulation the classical velocity advection terme use this scheme, which is fine:


Code:
div(phi,U)      bounded Gauss upwind;
When i copy/paste this scheme with my field :



Code:
 div((gradPt*1))  bounded Gauss upwind;
Code:
--> FOAM FATAL IO ERROR: 
unknown div scheme bounded

Valid div schemes are :
1(Gauss)
I also try

Code:
div((gradPt*1))  Gauss limitedLinear 1;
and I got
Code:
wrong token type - expected word, found on line 84 the doubleScalar 1
But I'm sure this is the good grammar since when I grep -ri Gauss I can found for exemple:
Code:
div(phi,k)      Gauss limitedLinear 1;
in combustion/fireFoam/LES/smallPoolFire2D/system/fvSchemes


What is the issue ? Are some schemes which are not available when explicitly calculating fvc::div(volVectorfield) instead of the more classical constructor fvc::div(surfacePhield,volVectorfield) ?


For information my volVectorField is defined like this :
Code:
 volVectorField gradPt(fvc::grad(p)+0.5*fvc::grad(U&U));


 
volVectorField directionGradPt(
    gradPt*dimensionedScalar(pow(dimLength,-1)*pow(dimTime,2),1)
);
forAll(directionGradPt,celli){
    directionGradPt[celli] = (mag(gradPt[celli]) == 0)? vector::zero : directionGradPt[celli]/mag(gradPt[celli]);
};

Thanks a lot.
__________________
« Debugging is what CFD is about. 5 minutes to modify your code, 5 months to find why it does not work anymore. »
Voulet is offline   Reply With Quote

Old   August 10, 2021, 04:43
Default
  #2
Member
 
Join Date: Jun 2019
Posts: 41
Rep Power: 6
Voulet is on a distinguished road
In fact, looking in the whole tutorial folder with :


Code:
tut
grep -ri div > tmp
sed -i '/fvSchemes/!d' tmp
sed -i '/divSchemes/d' tmp
sed -i '/default/d' tmp
sed -i '/,/d' tmp
I'm looking for all the schemes with div() withouth any comma inside in order to remove all the div(whatever,whatever) and have only the constructor i'm interested in.



I got a 264 lines file with containes 264 times the Gauss linear scheme according to grep -ri "Gauss linear;" tmp | wc -l


Thus why is there only this scheme available for a fvc::div() wich is not convective ? i.e not fvc::div(phi,thing) ?


How can i limit such a divergence using another scheme ?
__________________
« Debugging is what CFD is about. 5 minutes to modify your code, 5 months to find why it does not work anymore. »
Voulet 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
Interested in programming your own schemes? Jesper_Roland OpenFOAM Programming & Development 16 January 8, 2024 06:32
OF div schemes greatly influence the result Samuel Twain OpenFOAM Running, Solving & CFD 4 August 2, 2021 10:38
Fundamental questions about numerical schemes Obad OpenFOAM Running, Solving & CFD 1 May 10, 2021 10:40
Influence of schemes on mesh size, orientation and type in a convective flow field Tobi OpenFOAM Verification & Validation 8 July 16, 2017 08:01
time stepping schemes for compressible DNS/LES shyamdsundar Main CFD Forum 0 January 14, 2010 23:15


All times are GMT -4. The time now is 09:58.