Difference between revisions of "Contrib multiSolver/programming"

From OpenFOAMWiki
(Migrated to github)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Programming with multiSolver ==
+
This project has migrated over to '''github'''.
  
=== solverDomains ===
+
'''''[http://github.com/Marupio/multiSolver/wiki Click here for the new website.]'''''
A [[TestMarupio/glossary#solverDomain|solverDomain]] is an individual solver loop. It is assigned a name, and the list of names is static.  All [[TestMarupio/glossary#solverDomain|solverDomains]] must appear in the <tt>case/system/multiControlDict</tt> file.
+
  
=== Order of execution ===
+
http://github.com/Marupio/multiSolver/wiki
In the [[TestMarupio#simpleExample|simple example]] on the main page, all the [[TestMarupio/glossary#solverDomain|solverDomains]] execute in sequence, once per [[TestMarupio/glossary#superLoop|superLoop]].  This is not necessary: you can enclose them in conditionals; they can execute in any order; they can miss entire [[TestMarupio/glossary#superLoop|superLoops]]; however, they cannot execute more than once per [[TestMarupio/glossary#superLoop|superLoop]]. Use: <tt>multiRun++</tt> between solvers to increment the [[TestMarupio/glossary#superLoop|superLoop]] number if necessary.
+
 
+
=== runTime must go out of scope ===
+
Looking at the include files specified in the [[TestMarupio#simpleExample|simple example]] on the main page, you will notice that the entire solver loop is enclosed in its own set of braces { }, starting at <tt>#include "createTime.H"</tt>.  This is necessary because '''runTime''', the mesh, and all fields must go out of scope before '''multiSolver''' initializes another [[TestMarupio/glossary#solverDomain|solverDomain]].
+
 
+
=== Support classes ===
+
There are a few additional classes that were written to support '''multiSolver'''.  These include:
+
 
+
* <tt>tuple2List</tt> class;
+
* <tt>timeCluster</tt> class;
+
* <tt>timeClusterList</tt> class; and
+
* <tt>dummyControlDict</tt> class.
+
 
+
'''tuple2List'''<BR>
+
This is a sortable list of paired values was created.  It is sortable by first or second value, and currently can be any combination of <tt>scalar</tt> or <tt>label</tt>.
+
 
+
'''timeCluster'''<BR>
+
<tt>timeCluster</tt> is to '''multiSolver''' what <tt>instant</tt> is to '''runTime'''.  Basically an object that can catalogue all the time data within a '''multiSolver'''-enabled application.
+
 
+
'''timeClusterList'''<BR>
+
Again, similar to <tt>instantList</tt>, for '''multiSolver'''.
+
 
+
'''dummyControlDict'''<BR>
+
In order to allow ''runTimeModification'' of '''multiSolver''''s [[TestMarupio/glossary#multiDict|multiDicts]], '''multiSolver''' required an [[snip objectRegistry|objectRegistry]] that doesn't dissappear between [[TestMarupio/glossary#solverDomain|solverDomains]], when '''runTime''' goes out of scope.  Therefore it needed its own [[objectRegistry]].  Hence, <tt>multiDictRegistry_</tt> is a <tt>Time</tt> object.  <tt>Time</tt> was never intended to be a member variable, therefore its constructors do not allow initialization without a <tt>controlDict</tt>.  The object <tt>dummyControlDict</tt> was introduced as a self-initializing, minimal <tt>controlDict</tt>.  Ultimately it was necessary for global ''runTimeModification''.
+
 
+
== Implementation of multiSolver ==
+
 
+
=== storeFields ===
+
Some solverDomains may not need to use all the fields required by other solverDomains.  Rather than carry the unused fields in memory and write them out at every output point, storeFields can be declared.  storeFields works by copying the fields into the ''first'' time directory of that solverDomain for every superLoop.  When the next solverDomain is initialized, the stored field is retrieved and pasted into the starting time directory for that superLoop.
+
 
+
storeFields is a wordList defined in multiSolverDict, under each solverDomain.  One problem arises if the initial solverDomain has store fields - '''multiSolver''' would have no idea where to look for the storeFields.  Therefore, the initial solverDomain must have all storeFields defined in its 0/0 directory.
+

Latest revision as of 21:46, 6 September 2013

This project has migrated over to github.

Click here for the new website.

http://github.com/Marupio/multiSolver/wiki