CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   void Foam::multiphaseSystem::solve() of multiphaseEulerFoam solver (https://www.cfd-online.com/Forums/openfoam-programming-development/127640-void-foam-multiphasesystem-solve-multiphaseeulerfoam-solver.html)

maybee December 16, 2013 13:13

void Foam::multiphaseSystem::solve() of multiphaseEulerFoam solver
 
hi,

within method solve() can be found:

Code:

...
const dictionary& pimpleDict = mesh_.solutionDict().subDict("PIMPLE");
...

where mesh_ is
Code:

const fvMesh& mesh_
, a reference to the fvMesh object mesh

and solutionDict() [Return the selected sub-dictionary of solvers if the "select"
keyword is given, otherwise return the complete dictionary.] :

Code:

const Foam::dictionary& Foam::solution::solutionDict() const
  344 {
  345    if (found("select"))
  346    {
  347        return subDict(word(lookup("select")));
  348    }
  349    else
  350    {
  351        return *this;
  352    }
  353 }

with method found("select") -> ?

and

subDict("PIMPLE") [Find and return a sub-dictionary for manipulation.]

Code:

Foam::dictionary& Foam::dictionary::subDict(const word& keyword)
  617 {
//lookupEntryPtr(...):
//Find and return an entry data stream pointer for manipulation if present otherwise return //NULL. If recursive, search parent dictionaries. If patternMatch, use regular expressions.
  618    entry* entryPtr = lookupEntryPtr(keyword, false, true);
  619
  620    if (entryPtr == NULL)
  621    {
  622        FatalIOErrorIn
  623        (
  624            "dictionary::subDict(const word& keyword)",
  625            *this
  626        )  << "keyword " << keyword << " is undefined in dictionary "
  627            << name()
  628            << exit(FatalIOError);
  629    }
  630    return entryPtr->dict();
  631 }

I have several quesiton about this:

1A. mesh_ is a reference to the fvMesh which consists of many subobjects. When calling method solutionDict() on mesh_ what is method found("select") actually doing and if it is searching for the word "select" where in fvMesh mesh it is searching for it?

1B. Method solutionDict() : What is exactly meant by the "select" keyword? solutionDict() does not get any input parameters and therefore I assume it is really searched for a dictionary called "select"...

2. Assumed method solutionDict() returns the reference to mesh, hence mesh_ (see line 349 to 351 second code snippet) method subDict("PIMPLE") afterwards searches for a dictionary called "PIMPLE" in fvMesh mesh?

Perhaps I am misinterpreting something here? I hope someone enlightens me :).

greetings
maybee

Houthuys November 5, 2017 09:11

Hello Maybee,

Did you find answers for your questions here?

maybee November 5, 2017 11:30

Hi,

I am not sure since I worked with the solver a long time ago, but I don t think I could get any answers to these questions.

Best Regards


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