CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   MRFZone.C compiling (

majkl June 29, 2012 05:30

MRFZone.C compiling

I've changed the file MRFZone.C and I would like to compile the edited file.

The make files and options are located several directories up:

So I compile in this directory in this way:
wmake all

It compiles all dependent file in the finiteVolume, but my question is: Is it some easier way?(only compile the MRFZone.C)



tomislav_maric July 10, 2012 06:00

You should write your own code in libraries/applications that are separate from the main code tree.

The usual way to do this is as follows:

Copy the .C and .H file into your own directory.
Rename the files : myMRFzone.C, myMRFzone.C (think of better names :))
Rename the classes: use an editor with automatic name change executed on mutliple files
Create a Make/{files, options} in this directory (you can see how this looks like for, you need to only copy the lines from Make/files that pertain to myMRFzone, change the LIB to your name, and the options stay the same).

At the end, you have your own library compiled and ready to use. To use it, go into system/controlDict of a case you are running and put:

libs ("");

at the top of the file.

majkl July 10, 2012 08:13

Dear Tomislav,

thanks. I'll try it.


tomislav_maric July 10, 2012 08:15


Originally Posted by majkl (Post 370632)
Dear Tomislav,

thanks. I'll try it.


No prob, just ask if you run into trouble, if I catch some time, I'll help you compile it...

All times are GMT -4. The time now is 06:11.