Adding a problem¶
The easiest way to add a problem is to copy an existing problem setup in the solver you wish to use (in its problems/ sub-directory). Three different files will need to be copied (created):
problem.py: this is the main initialization routine. The functioninit_data()is called at runtime by theSimulationobject’sinitialize()method. Two arguments are passed in, the simulation’sCellCenterData2dobject and theRuntimeParametersobject. The job ofinit_data()is to fill all of the variables defined in theCellCenterData2dobject._problem.defaults: this contains the runtime parameters and their defaults for your problem. They should be placed in a block with the heading[problem](whereproblemis your problem’s name). Anything listed here will be available through theRuntimeParametersobject at runtime.inputs.problem: this is the inputs file that is used at runtime to set the parameters for your problem. Any of the general parameters (like the grid size, boundary conditions, etc.) as well as the problem-specific parameters can be set here. Once the problem is defined, you need to add the problem name to the__all__list in the__init__.pyfile in theproblems/sub-directory. This lets python know about the problem.