Difference between revisions of "Howto adding a new solver to foamX"
m (Reverted edit of Qsolre, changed back to last version by Bgschaid) |
m (added OF1.4 template) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{VersionInfo}}{{Version1.4}} | |
− | + | FoamX at start-up will look through through a predefined set of directories to find directories with a FoamX subdirectory. These directories are taken to be utilities or solvers which need to be added to FoamX. | |
+ | For solvers it looks through directories | ||
+ | * <tt>$WM_PROJECT_DIR</tt>/applications/solvers | ||
+ | * <tt>$WM_PROJECT_USER_DIR</tt>/applications/solvers, | ||
− | + | for utilities it looks through directories | |
+ | * <tt>$WM_PROJECT_DIR</tt>/applications/utilities | ||
+ | * <tt>$WM_PROJECT_USER_DIR</tt>/applications/utilities. | ||
+ | |||
+ | The easiest way is to copy the <tt>FoamX</tt> directory of an existing solver/utility and rename the top <tt>.cfg</tt> file to your solver. Make sure that the | ||
+ | * directory name | ||
+ | * top level solver name | ||
+ | * .cfg file in the FoamX directory | ||
+ | are all consistent. | ||
For example, if your application is similar to icoFoam, take | For example, if your application is similar to icoFoam, take | ||
− | <tt>$ | + | <tt>$WM_PROJECT_DIR/applications/solvers/incompressible/icoFoam/FoamX</tt> |
and copy it to | and copy it to | ||
− | <tt>$ | + | <tt>$WM_PROJECT_USER_DIR/applications/solvers/myFoam</tt> |
− | where <tt>myFoam</tt> is the name of your new solver. | + | where <tt>myFoam</tt> is the name of your new solver and move |
+ | |||
+ | <tt>FoamX/icoFoam.cfg</tt> | ||
+ | |||
+ | to | ||
+ | |||
+ | <tt>FoamX/myFoam.cfg</tt> | ||
Adapt the configuration file and the dictionaries to your needs and change <tt>/Make/files</tt> to match your application name. | Adapt the configuration file and the dictionaries to your needs and change <tt>/Make/files</tt> to match your application name. | ||
Create a case (right click on the root directory in the case browser) and you will have <tt>myFoam</tt> to choose from. | Create a case (right click on the root directory in the case browser) and you will have <tt>myFoam</tt> to choose from. | ||
− | |||
− |
Latest revision as of 10:01, 17 January 2011
FoamX at start-up will look through through a predefined set of directories to find directories with a FoamX subdirectory. These directories are taken to be utilities or solvers which need to be added to FoamX. For solvers it looks through directories
- $WM_PROJECT_DIR/applications/solvers
- $WM_PROJECT_USER_DIR/applications/solvers,
for utilities it looks through directories
- $WM_PROJECT_DIR/applications/utilities
- $WM_PROJECT_USER_DIR/applications/utilities.
The easiest way is to copy the FoamX directory of an existing solver/utility and rename the top .cfg file to your solver. Make sure that the
- directory name
- top level solver name
- .cfg file in the FoamX directory
are all consistent.
For example, if your application is similar to icoFoam, take
$WM_PROJECT_DIR/applications/solvers/incompressible/icoFoam/FoamX
and copy it to
$WM_PROJECT_USER_DIR/applications/solvers/myFoam
where myFoam is the name of your new solver and move
FoamX/icoFoam.cfg
to
FoamX/myFoam.cfg
Adapt the configuration file and the dictionaries to your needs and change /Make/files to match your application name.
Create a case (right click on the root directory in the case browser) and you will have myFoam to choose from.