Difference between revisions of "OpenFOAM guide/Use bananas"

From OpenFOAMWiki
(added optional keywords and added section headers)
 
Line 1: Line 1:
 +
__TOC__
 +
 +
== What options can I use? ==
 +
 
A disadvantage of the [[snip runtime selection mechanism|runTimeSelection mechanism]] in [[OpenFOAM]] is it makes it difficult to determine what all the available [[RTS derived class|RTS derived classes]] are.  To make this easier, use a random word in the setting file and run the solver.  Most [[RTS base class|RTS base classes]], when given an invalid word, will fail by displaying all valid words to the console.
 
A disadvantage of the [[snip runtime selection mechanism|runTimeSelection mechanism]] in [[OpenFOAM]] is it makes it difficult to determine what all the available [[RTS derived class|RTS derived classes]] are.  To make this easier, use a random word in the setting file and run the solver.  Most [[RTS base class|RTS base classes]], when given an invalid word, will fail by displaying all valid words to the console.
  
For example, in the icoFoam tutorial, "cavity", the pressure matrix solver is set in fvSolution:
+
For example, in the [[icoFoam]] tutorial, "cavity", the pressure matrix solver is set in fvSolution:
 
     p PCG
 
     p PCG
 
     {
 
     {
Line 47: Line 51:
  
 
Some [[RTS base class|RTS base classes]] do not exhibit this behaviour.  For example, the fvPatchField (boundary field) will accept unknown boundary conditions and create a "generic boundary condition".  This is to prevent post-processors from crashing when viewing a custom boundary condition.
 
Some [[RTS base class|RTS base classes]] do not exhibit this behaviour.  For example, the fvPatchField (boundary field) will accept unknown boundary conditions and create a "generic boundary condition".  This is to prevent post-processors from crashing when viewing a custom boundary condition.
 +
 +
 +
== What about optional keywords? ==
 +
 +
{{VersionInfo}}{{Version2.3.x}}{{Version2.4}}{{Version3.0}}{{Version4}}{{Version3.0+}}{{Version1606+}}{{Version1612+}}
 +
 +
The switch {{tt|writeOptionalEnties}} was added to {{tt|InfoSwitches}} in OpenFOAM 2.3.x in commit [https://github.com/OpenFOAM/OpenFOAM-2.3.x/commit/97c56ba71c141c8265d4a24455758f065491467d 97c56ba71c1] (before the release of OpenFOAM 2.4.0).
 +
 +
For more details on how set or add this entry, see [[HowTo_debugging#Getting_built-in_feedback_from_OpenFOAM|Getting built-in feedback from OpenFOAM]] at [[HowTo_debugging]], although keep in mind that the block for this entry is {{tt|InfoSwitches}} and not {{tt|DebugSwitches}}.
 +
 
[[Category:OpenFOAM tips]]
 
[[Category:OpenFOAM tips]]

Latest revision as of 01:08, 27 December 2016

1 What options can I use?

A disadvantage of the runTimeSelection mechanism in OpenFOAM is it makes it difficult to determine what all the available RTS derived classes are. To make this easier, use a random word in the setting file and run the solver. Most RTS base classes, when given an invalid word, will fail by displaying all valid words to the console.

For example, in the icoFoam tutorial, "cavity", the pressure matrix solver is set in fvSolution:

   p PCG
   {
       preconditioner   DIC;
       tolerance        1e-06;
       relTol           0;
   };

Changing this to:

   p banana
   {
       preconditioner   DIC;
       tolerance        1e-06;
       relTol           0;
   };

will produce the following output:

Unknown symmetric matrix solver banana

Valid symmetric matrix solvers are :

13
(
ICCG
RREAMG
MPEAMG
GMRES
FPEAMG
smoothSolver
deflation
BICCG
PCG
amgSolver
CG
GAMG
BiCGStab
)


file: /TUTORIAL DIRECTORY/icoFoam/cavity/system/fvSolution::p at line 19.

    From function lduMatrix::solver::New
    in file matrices/lduMatrix/lduMatrix/lduMatrixSolver.C at line 84.

 FOAM exiting

Any of the displayed options can be used in place of "banana".

Some RTS base classes do not exhibit this behaviour. For example, the fvPatchField (boundary field) will accept unknown boundary conditions and create a "generic boundary condition". This is to prevent post-processors from crashing when viewing a custom boundary condition.


2 What about optional keywords?

Valid versions: OF Version 23x.png OF Version 24.png OF Version 30.png OF Version 4.png OF Version 30plus.png OF Version 1606plus.png OF Version 1612plus.png

The switch writeOptionalEnties was added to InfoSwitches in OpenFOAM 2.3.x in commit 97c56ba71c1 (before the release of OpenFOAM 2.4.0).

For more details on how set or add this entry, see Getting built-in feedback from OpenFOAM at HowTo_debugging, although keep in mind that the block for this entry is InfoSwitches and not DebugSwitches.