CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   MRFZone.C compiling (http://www.cfd-online.com/Forums/openfoam-programming-development/103923-mrfzone-c-compiling.html)

majkl June 29, 2012 05:30

MRFZone.C compiling
 
Hi,

I've changed the file MRFZone.C and I would like to compile the edited file.
~/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/cfdTools/general/MRF

The make files and options are located several directories up:
~/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume

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)

Thanks.

Michal

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 libfiniteVolume.so, 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 ("libMyNewLibrary.so");

at the top of the file.

majkl July 10, 2012 08:13

Dear Tomislav,

thanks. I'll try it.

Michal

tomislav_maric July 10, 2012 08:15

Quote:

Originally Posted by majkl (Post 370632)
Dear Tomislav,

thanks. I'll try it.

Michal

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 17:01.