CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Installation on Windows, Mac and other Unsupported Platforms

Patches for OpenFOAM 1.7 on MacOS X

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 21, 2010, 20:11
Default
  #81
Senior Member
 
Join Date: Mar 2009
Posts: 225
Rep Power: 9
paka is on a distinguished road
Many very thanks for your reply and assistance!

Best!
K
paka is offline   Reply With Quote

Old   November 16, 2010, 11:55
Default
  #82
New Member
 
Joseph Urich
Join Date: Mar 2009
Location: Pittsburgh, PA
Posts: 8
Rep Power: 8
jurich is on a distinguished road
First of all, thanks Bernhard for the patch.

Does the FOAM_SIGFPE environment setting work with this patch on OS X?

It doesn't for my installation. Having it set or unset makes no difference, the signal seems to be ignored. If mess up a run and get a NaN in a variable, the solver keeps right on ticking.

I don't see any changes made by the patch in the sigFpe source files, so I don't think it should work, but I thought I'd ask, in case I'm missing something.

Thanks.

JU
jurich is offline   Reply With Quote

Old   November 16, 2010, 12:56
Default
  #83
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by jurich View Post
First of all, thanks Bernhard for the patch.

Does the FOAM_SIGFPE environment setting work with this patch on OS X?

It doesn't for my installation. Having it set or unset makes no difference, the signal seems to be ignored. If mess up a run and get a NaN in a variable, the solver keeps right on ticking.

I don't see any changes made by the patch in the sigFpe source files, so I don't think it should work, but I thought I'd ask, in case I'm missing something.

Thanks.

JU
Doesn't work for me either. Didn't investigate the matter too closely. One reason could be that the sigFpe is never raised (this might be a matter of compiler-switches or it has got to be enabled by some system call). But I never investigated it too closely

Bernhard
gschaider is offline   Reply With Quote

Old   November 16, 2010, 18:23
Default
  #84
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

Quote:
Originally Posted by gschaider View Post
Doesn't work for me either. Didn't investigate the matter too closely. One reason could be that the sigFpe is never raised (this might be a matter of compiler-switches or it has got to be enabled by some system call). But I never investigated it too closely
I believe this is something that has also been fixed in Symscape's patches, as well as in FreeFOAM.

If I'm not mistaken, check the patches for the file "src/OpenFOAM/primitives/Scalar/doubleFloat.H", right after the "#include <cmath>":
  • Symscape's modifications:
    Code:
    if defined(DARWIN)
    #define j0f j0
    #define j1f j1
    #define jnf jn
    #define y0f y0
    #define y1f y1
    #define ynf yn
    #endif
  • FreeFOAM's modifications:
    Code:
    #ifdef darwin
    #ifndef DUMMY_SCALAR_FUNCTIONS
    #define DUMMY_SCALAR_FUNCTIONS
    inline float j0f(float x) { return float(j0(double(x)));}
    inline float j1f(float x) { return float(j1(double(x)));}
    inline float y0f(float x) { return float(y0(double(x)));}
    inline float y1f(float x) { return float(y1(double(x)));}
    inline float jnf(const int n, const float s) { return float(jn(n, double(s))); }
    inline float ynf(const int n, const float s) { return float(yn(n, double(s))); }
    #endif
    #endif

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   November 17, 2010, 06:24
Default
  #85
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by wyldckat View Post
Greetings to all!


I believe this is something that has also been fixed in Symscape's patches, as well as in FreeFOAM.

If I'm not mistaken, check the patches for the file "src/OpenFOAM/primitives/Scalar/doubleFloat.H", right after the "#include <cmath>":
  • Symscape's modifications:
    Code:
    if defined(DARWIN)
    #define j0f j0
    #define j1f j1
    #define jnf jn
    #define y0f y0
    #define y1f y1
    #define ynf yn
    #endif
  • FreeFOAM's modifications:
    Code:
    #ifdef darwin
    #ifndef DUMMY_SCALAR_FUNCTIONS
    #define DUMMY_SCALAR_FUNCTIONS
    inline float j0f(float x) { return float(j0(double(x)));}
    inline float j1f(float x) { return float(j1(double(x)));}
    inline float y0f(float x) { return float(y0(double(x)));}
    inline float y1f(float x) { return float(y1(double(x)));}
    inline float jnf(const int n, const float s) { return float(jn(n, double(s))); }
    inline float ynf(const int n, const float s) { return float(yn(n, double(s))); }
    #endif
    #endif

Best regards,
Bruno
I don't think that that's it. My patches do something similar. Basically the "problem" that is fixed here is that Apple in its infintie wisdom thought that j0f et al are not necessary for single precision and these patches provide dummy-implementations to those functions (basically they call the double-precision implementation). But I don't see how this would affect the FPE

Bernhard
gschaider is offline   Reply With Quote

Old   November 17, 2010, 23:16
Default
  #86
New Member
 
Joseph Urich
Join Date: Mar 2009
Location: Pittsburgh, PA
Posts: 8
Rep Power: 8
jurich is on a distinguished road
Thanks Bernhard.

Floating point exceptions seem to be handled in sigFpe.C, and there are some Linux calls in there (feenableexcept() for example) that aren't implemented in OS X. Don't know the corresponding functions in OSX, but I can keep looking.

Thanks for the pointer to FreeFoam, Bruno. It doesn't seem like they implemented this functionality, but I haven't been through it completely yet.

Regards,

Joe
jurich is offline   Reply With Quote

Old   November 18, 2010, 07:35
Default
  #87
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Bernhard and Joe,

I'm sorry, but I assumed this issue was resolved already, due to this post on Symscape's blog. My deduction was that since the patches already had this fixed for MinGW, it would only be reasonable that a POSIX respecting Darwin system would have this more than solved... but I guessed it wrong
Also a bad assumption was that FreeFOAM (which does have support for Mac OS X for a while now) would already have this fixed as well.

By the way Joe, you might want to see the pu branch of FreeFOAM, which is the bleeding edge of FreeFOAM.

Best regards and good luck!
Bruno

PS: I've tried having a look at GNU-Darwin, OpenDarwin and PureDarwin, but they currently seem to be dead ends Too bad there still isn't a RHEL/CentOS like thing with Mac OS X... oh well.
wyldckat is offline   Reply With Quote

Old   December 8, 2010, 09:40
Default Troubles with MPI
  #88
New Member
 
Daniele Trimarchi
Join Date: Mar 2010
Location: Southampton, Uk
Posts: 11
Rep Power: 7
Daniele Trimarchi is on a distinguished road
Hi foamers,
I successifully installed OF, but I'm getting troubles with MPI. I'm following the wiki: http://openfoamwiki.net/index.php/Ho...enFOAM_v17_Mac

Point 3 states that one should make some links in /Volumes/OpenFOAM/1.7.0/ThirdParty-1.7.0/platforms/darwinIntel64/openmpi-1.4.1/lib
However, this directory does not exist in my case.

I have another version of mpi on my computer (MacBook Pro with Snow leopard), which runs well if the OpenFOAM.dmg is not linked. I try then to link this direcly, making a ln -s to the location where the libmpi.dylib is.

In any case, as the OpenFOAM.dmg disk is linked I get:

> mpirun
--------------------------------------------------------------------------
Sorry! You were supposed to get help about:
orterun:usage
from the file:
help-orterun.txt
But I couldn't find any file matching that name. Sorry!
--------------------------------------------------------------------------

Any guess..?

Thanks,
Daniele
Daniele Trimarchi is offline   Reply With Quote

Old   December 9, 2010, 16:02
Default Solved!
  #89
New Member
 
Daniele Trimarchi
Join Date: Mar 2010
Location: Southampton, Uk
Posts: 11
Rep Power: 7
Daniele Trimarchi is on a distinguished road
Hi Foamers,
I found the solution, and I thought it would be nice to post it, perhaps it will be useful.
During the compilation of MPI, a series of files are created and sequentially used for the continuation of the compilation. For some reason (if anyone has guesses...let me know..!) these files are created with the .loT extension, whereas the compiler searches for .lo files.
The solution I found is then recompile by hand MPI:
HTML Code:
cd ThirdParty-1.7.x/openmpi-1.4.1/
./autogen.sh
./configure --prefix=~/OpenFOAM/ThirdParty-1.7.x/platforms/darwinintel64/openmpi-1.4.1
make all
The compiler will crash as a .lo file is not found. The good news is that the compiler reports the missing file name. The extension can be then changed using (from the directory where .loT file is) a command such:

HTML Code:
  for file in *.loT; do mv "$file" "`echo $file | sed -e 's/\.loT/.lo/g'`" ; done
This takes quite a while, but at the end it successfully compiles the libraries in the specified path [/OpenFOAM/ThirdParty-1.7.x/platforms/darwinintel64/openmpi-1.4.1].

Furtermore, for some reasons the wrappers are not well named (mpi at the place of openmpi). So it is necessary to create links in the dir:
HTML Code:
 /OpenFOAM/ThirdParty-1.7.x/platforms/darwinintel64/openmpi-1.4.1/share/openmpi
as ( should this be done for all files..? ):

HTML Code:
ln -s mpic++-wrapper-data.txt openmpic++-wrapper-data.txt
ln -s mpicxx-wrapper-data.txt openmpicxx-wrapper-data.txt
However, I'm sure that there's the way to modify a makeFile to solve the problem 'automatically'. I'd be really happy to get any advice about this

Regards,
Daniele

Last edited by Daniele Trimarchi; December 10, 2010 at 06:39.
Daniele Trimarchi is offline   Reply With Quote

Old   December 25, 2010, 09:43
Default Prebuilt disk image of OpenFOAM 1.7.x for OS X 10.6.5
  #90
Member
 
sushant's Avatar
 
Join Date: Mar 2009
Location: Switzerland
Posts: 42
Rep Power: 8
sushant is on a distinguished road
Hi Foamers,

Thanks to gschaider's ingenious patches I have a fully working (sans Tecplot360) installation of OF 1.7.x on Snow Leopard 10.6.5 (DPOpt on 64-bit).

By deleting the build files, wmake files, documentation, sources, tutorials and other miscellany, I could bring down the used space on the disk image to just about 280mb. It only has the binaries now.

Compressing this dmg made it 104MB. I hope it's okay to post a link to this, in case someone wants a prebuilt image of OF1.7.x for OS X. You can get it at http://macof17x.blogspot.com.

It has all the standard solvers and utilities except Tecplot360 conversion. You can decompose (including w/ metis) and run cases in parallel.

Thank you gschaider for a massive effort. Thanks to chrisb for a great and crisp explanation on his blog.
sushant is offline   Reply With Quote

Old   December 26, 2010, 18:00
Default
  #91
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by sushant View Post
Hi Foamers,

Thanks to gschaider's ingenious patches I have a fully working (sans Tecplot360) installation of OF 1.7.x on Snow Leopard 10.6.5 (DPOpt on 64-bit).

By deleting the build files, wmake files, documentation, sources, tutorials and other miscellany, I could bring down the used space on the disk image to just about 280mb. It only has the binaries now.

Compressing this dmg made it 104MB. I hope it's okay to post a link to this, in case someone wants a prebuilt image of OF1.7.x for OS X. You can get it at http://macof17x.blogspot.com.

It has all the standard solvers and utilities except Tecplot360 conversion. You can decompose (including w/ metis) and run cases in parallel.

Thank you gschaider for a massive effort. Thanks to chrisb for a great and crisp explanation on his blog.
Hi!

Nice that somebody takes it upon him to support a binary release of 1.7 on the Mac.

Using the attached patch (inspired by the symscape-patches) I managed to compile the tecplot-converter. When running it fails with an unresolved reference in the tecio-library. I didn't have a deeper look as I don't use Tecplot anyway.

Bernhard
tecPlotOnMac.patch
gschaider is offline   Reply With Quote

Old   March 2, 2011, 21:33
Default Problem (Probably Stupid) Using Precompiled Distribution
  #92
New Member
 
Theron
Join Date: Mar 2011
Posts: 1
Rep Power: 0
Mathematicus is on a distinguished road
Hi everyone,

I'm brand new to OpenFOAM and relatively to heavy command line work in Unix systems. I've installed successfully using the tutorial on Sushant's website (thanks again!), but I'm having issues running the tutorials. So far I've tried running blockMesh and paraFoam. They seem to run correctly but both return an error along the lines of "file does not exist: './system/controlDict'". Should I have a system directory in my OpenFOAM installation, or do I need to change some environment variables somewhere?

Thanks,
Theron
Mathematicus is offline   Reply With Quote

Old   March 3, 2011, 10:33
Default
  #93
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Mathematicus View Post
Hi everyone,

I'm brand new to OpenFOAM and relatively to heavy command line work in Unix systems. I've installed successfully using the tutorial on Sushant's website (thanks again!), but I'm having issues running the tutorials. So far I've tried running blockMesh and paraFoam. They seem to run correctly but both return an error along the lines of "file does not exist: './system/controlDict'". Should I have a system directory in my OpenFOAM installation, or do I need to change some environment variables somewhere?
No. The commands expect your current directory to be a valid OF-case (and a valid OF-case always has a file system/controlDict). I don't know the mentioned tutorial, but I guess you forgot a "cd" somewhere

Bernhard
gschaider is offline   Reply With Quote

Old   April 27, 2011, 00:42
Default
  #94
Member
 
Charlie
Join Date: Dec 2010
Location: 415 Kinross Dr. Newark, DE 19711
Posts: 78
Rep Power: 6
cheng1988sjtu is on a distinguished road
Quote:
Originally Posted by chrisb View Post
Chris,

Can you tell me how to use this?

hdiutil attach "/path/to/your/disk_image.dmg" -mountpoint "$HOME/OpenFOAM" > /dev/null

I just used "Disk Utility" to create a case-sensitive disk named OpenFOAM. the path to it is /Volumes/OpenFOAM

I tried to create a file ~/.bashrc, and edit it as:


hdiutil attach "/Volumes/OpenFOAM/" -mountpoint "$HOME/OpenFOAM" > /dev/null

. $HOME/OpenFOAM/OpenFOAM-1.7.1/etc/bashrc


Then when I try to source it by command line ". ~/.bashrc", I get the following error messages:

hdiutil: attach failed - not recognized
-bash: /Users/zcheng/OpenFOAM/OpenFOAM-1.7.1/etc/bashrc: No such file or directory

So how Can I point the $HOME/OpenFOAM to /Volumes/OpenFOAM ?

I get confused at this step. Thank you for any help!
cheng1988sjtu is offline   Reply With Quote

Old   April 27, 2011, 01:33
Default
  #95
Member
 
sushant's Avatar
 
Join Date: Mar 2009
Location: Switzerland
Posts: 42
Rep Power: 8
sushant is on a distinguished road
Charlie,

Did you use Disk Utility to create a disk image or did you create a partition on your existing hard disk for use with OpenFOAM?

You need to use
hdiutil only if you have a disk image (.dmg or .sparseimage) file. If you have a partition that mounts automatically to /Volumes/OpenFOAM (i.e. the volume is always accessible, you don't have to manually mount it) then just do:

(make sure you haven't already created a $HOME/OpenFOAM folder; or else move it)

cd
ln -sf /Volumes/OpenFOAM OpenFOAM


__________________
If you only have a hammer, you tend to see every problem as a nail.

Last edited by sushant; April 28, 2011 at 02:38. Reason: wrongly addressed Chris instead of Charlie ... should learn to read :)
sushant is offline   Reply With Quote

Old   April 27, 2011, 14:06
Red face Thank you
  #96
Member
 
Charlie
Join Date: Dec 2010
Location: 415 Kinross Dr. Newark, DE 19711
Posts: 78
Rep Power: 6
cheng1988sjtu is on a distinguished road
Thank you for your prompt reply!

Right now, I'm trying to use Prebuilt OpenFOAM-1.7.x which is in your signature.

However, after I install it, I found that there is no tutorials folder, so where can we find these files? can I just copy the tutorials from the other places?

Thank you again !
cheng1988sjtu is offline   Reply With Quote

Old   April 28, 2011, 02:37
Default
  #97
Member
 
sushant's Avatar
 
Join Date: Mar 2009
Location: Switzerland
Posts: 42
Rep Power: 8
sushant is on a distinguished road
Yep - sorry about that - there is no tutorials folder in the prebuilt image.

The source is also kept out - you won't find the src folder either. I figured if someone wants the source, they'd be the kind who would compile it (and thus not need a binary). In other words, those who need a binary don't usually need source, if they did, they would probably be able to compile it themselves. An exception is someone who wants the code just to study and understand it and not necessarily compile.

The tutorials folder was a gray area - probably a (silly) reason to decide on keeping it out was that it made the final disk image less than 100MB (99MB) but with the tutorials it was about 25% more.

I used to have a ~ 25MB zip file with the tutorials - just the tutorials - on the sourceforge page for this (hmm, I realize I have a sourceforge page on which I have uploaded just a binary and no source - violation of their TOS) but later removed that file because I felt it was redundant (OpenFOAM-1.7.1.gtgz provides the tutorials and it is around 50MB itself)

So coming back to the point ( ) the best place for now to get the tutorials would be OpenFOAM-1.7.1.gtgz from the OpenCFD website.
__________________
If you only have a hammer, you tend to see every problem as a nail.
sushant is offline   Reply With Quote

Old   June 13, 2011, 23:28
Default
  #98
Member
 
桂莹
Join Date: Apr 2011
Posts: 36
Rep Power: 6
yingkun is on a distinguished road
hi,leo
I use coalChemistryFoam of OF1.7.1 to deal with my case which is about coal injection combustion,I run the simplifiedSiwek case,it work well,but for my case,it "out of temperature range",can you help me to solve it?
best regards
ying
yingkun is offline   Reply With Quote

Old   June 14, 2011, 01:28
Lightbulb
  #99
Member
 
sushant's Avatar
 
Join Date: Mar 2009
Location: Switzerland
Posts: 42
Rep Power: 8
sushant is on a distinguished road
Quote:
Originally Posted by yingkun View Post
hi,leo
I use coalChemistryFoam of OF1.7.1 to deal with my case which is about coal injection combustion,I run the simplifiedSiwek case,it work well,but for my case,it "out of temperature range",can you help me to solve it?
best regards
ying
Is this a specific issue you face only on the MacOS build?

In general when I get out of temperature range errors I modify the solver to bound temperatures between the working range. This may happen in hypersonic flows or combustion simulations. For example, just after the energy equation is solved, do (use h or e as appropriate):

Code:
h = max(h, hMin);
h = min(h, hMax);
where hMin and hMax are dimensionedScalars created in createFields.h in the solver directory. You can create them by reading from the fvSolution dict. See the rhoPorousSimpleFoam or rhoSimpleFoam solver, I'm not sure which, it reads a pMin value from the fvSolution dict and places a lower-bound on the pressure accordingly.

Obviously, the bounds you set must be realistic and must allow for some leg space, and your converged solution field must not have this bounding. (To be sure, just print out a message to the screen when you bound; such messages are often spit out for k and epsilon for example).

AND/OR try lowering your relaxation factors way down. A combination of both usually works for me.

Again, do not trust bounding unless your temperature limits are realistically set, and your converged solution is well within bounds. Setting limits is not always easy; h=Cp*T and you are trying to limit T by limiting h, but Cp may or may not be constant depending on your modelling. It's worse when you're dealing with e.

(This may have been better off in another thread?)

Hope this helps,
Sushant
__________________
If you only have a hammer, you tend to see every problem as a nail.
sushant is offline   Reply With Quote

Old   June 14, 2011, 02:50
Default
  #100
Member
 
桂莹
Join Date: Apr 2011
Posts: 36
Rep Power: 6
yingkun is on a distinguished road
1.
Quote:
Is this a specific issue you face only on the MacOS build?
I'm work on ubuntu10.04.
2.
Quote:
In general when I get out of temperature range errors I modify the solver to bound temperatures between the working range. This may happen in hypersonic flows or combustion simulations. For example, just after the energy equation is solved, do (use h or e as appropriate):

Code:
h = max(h, hMin);
h = min(h, hMax);
where hMin and hMax are dimensionedScalars created in createFields.h in the solver directory. You can create them by reading from the fvSolution dict. See the rhoPorousSimpleFoam or rhoSimpleFoam solver, I'm not sure which, it reads a pMin value from the fvSolution dict and places a lower-bound on the pressure accordingly.
how to do these?can you paste the changed file?
3.
Quote:
AND/OR try lowering your relaxation factors way down. A combination of both usually works for me.
which relaxation factors do you mean?
Another question:can I just change the temperature bound?--I just think of it,but I don't know where to set the temperature bound
yingkun is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default patches not appearing in paraview ozzythewise OpenFOAM Native Meshers: blockMesh 6 January 31, 2011 10:41
internal faces between patches created with snappyHexMesh romant OpenFOAM Mesh Utilities 0 August 17, 2009 08:40
Courant number, patches, etc oort OpenFOAM 1 July 24, 2009 18:05
SnappyHexMesh large number of patches written prapanj OpenFOAM Mesh Utilities 0 July 15, 2009 08:11
radiation patches, viewfactors beams CD-adapco 1 March 12, 2009 08:39


All times are GMT -4. The time now is 12:08.