CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Commercial meshers] star-ccm mesh to O\/F (https://www.cfd-online.com/Forums/openfoam-meshing/73356-star-ccm-mesh-o-f.html)

DLC March 5, 2010 07:01

star-ccm mesh to O\/F
 
Hi Foamers,

I'm trying to convert a mesh made with star-ccm, in order to use OpenFOAM, using starToFoam, but continues to error... my mesh is called test.ccm and the converter keeps asking a .vrt file....

I've converted several meshes form .msh without any problems, but this time I can't do it...

can anyone help me?

thanks!

linnemann March 5, 2010 08:05

Hi

I think you need to use the star4ToFoam command to convert the ccm file.

starToFoam is based on StarCD cases which where different from ccm+.

DLC March 5, 2010 08:52

Hi,

I already tried... same result...

any other ideas?

wyldckat March 5, 2010 10:03

Greetings DLC,

Although I'm still to get a successful conversion from ccm+ to foam (hadn't had the time to do it yet), you're trying to use the wrong utility! For ccm you need ccm26ToFoam. You'll have to build ccm26ToFoam:
Code:

$FOAM_APP/utilities/mesh/conversion/Optional/Allwmake
And you'll need to visit and read this thread (well, just the 1st post or the 21st post on it) before trying to build ccm26ToFoam ;)

Best regards,
Bruno

DLC March 7, 2010 10:30

Thank you for your illuminating post, I'll try next days to convert this mesh... I'll let know if I'll make it!

Thanks again!

lbordier March 8, 2010 07:24

if you use OF1.6 then you need to compile 1.6.x version of ccm26ToFoam available from git repository. Otherwise compilation will fail.

wyldckat March 8, 2010 12:27

Quote:

Originally Posted by lbordier (Post 248964)
if you use OF1.6 then you need to compile 1.6.x version of ccm26ToFoam available from git repository. Otherwise compilation will fail.

Good catch! I had it in mind, but completely forgot to mention about it :(

And yes, copying the source folder ccm26ToFoam from the 1.6.x to the 1.6 version, and then building with the OpenFOAM 1.6 version will do the trick! Thus not needing to build a full OpenFOAM 1.6.x version :)

fiona March 10, 2010 02:09

Quote:

Originally Posted by wyldckat (Post 248999)
Good catch! I had it in mind, but completely forgot to mention about it :(

And yes, copying the source folder ccm26ToFoam from the 1.6.x to the 1.6 version, and then building with the OpenFOAM 1.6 version will do the trick! Thus not needing to build a full OpenFOAM 1.6.x version :)

Hi Luc and Bruno,

Following your instructions, I was able to make ccm26ToFoam and test the sample ccm files in OpenFOAM/ThirdParty-1.6/libccmio-2.6.1/data. Do you know where I can find tutorials/explanation of these sample cases? How can I load and visualize the generated mesh?

thanks,

Fiona

wyldckat March 10, 2010 06:31

Greetings Fiona,

Sweet, I didn't even know there was a case sample with the ccmio library! Sadly, I don't know of any tutorials for ccm to foam :(

As for loading and visualizing the generated mesh (the foam version), you just use paraFoam as you normally would with any other OpenFOAM simulation case! Additionally, some days ago I found what starts in this post, has a solution a few posts later on how to visually debug the mesh in Paraview, because cutting the mesh will triangulate the mesh where it is cut.

Oh, if paraFoam is unwilling to work, use foamToVTK to export the mesh to VTK and then use Paraview to open the exported .vtk files directly!

So at least one question is still unanswered: does anyone know of any tutorials for ccm to foam?

Best regards,
Bruno

fiona March 10, 2010 12:58

Hi Bruno,

Thank you! ParaFoam works.

From what I've got, it seems that ccm26ToFoam can capture the interface boundary patches. Does this mean the MRF or sliding mesh created in Star-CCM+ can be preserved and imported into OpenFoam? The User Manual says utilities such as fluentMeshToFoam and starToFoam can't.

Fiona

wyldckat March 10, 2010 13:10

Quote:

Originally Posted by fiona (Post 249399)
Thank you! ParaFoam works.

You're welcome :)

Quote:

Originally Posted by fiona (Post 249399)
Does this mean the MRF or sliding mesh created in Star-CCM+ can be preserved and imported into OpenFoam?

I honestly have got no clue. My best guess is that the mesh itself is converted, but the additional definitions will have to be done by hand. I suggest looking at the OpenFOAM tutorial cases that have MRF and sliding meshes and see what might be missing in the conversion process.

By what I estimate, ccm26ToFoam won't be seeing updates/upgrades in the near future, but I might be wrong :rolleyes:

Best regards,
Bruno

olesen March 11, 2010 02:27

Quote:

Originally Posted by fiona (Post 249399)
Hi Bruno,

Thank you! ParaFoam works.

From what I've got, it seems that ccm26ToFoam can capture the interface boundary patches. Does this mean the MRF or sliding mesh created in Star-CCM+ can be preserved and imported into OpenFoam? The User Manual says utilities such as fluentMeshToFoam and starToFoam can't.

How are the Star-CCM+ MRF and sliding mesh case actually saved?
The ccm->Foam conversion only handles stuff that is in the ccm geometry file.
AFAIK ccm->Foam either takes the first one or States/default.
Which other states are there states in the ccm geometry file?

navnair87 April 1, 2010 16:25

Hi Fiona and Bruno, I have just install OF1.6.x and I have done what Bruno posted in post #4 but I still can't get ccm26ToFoam to work. Can you please help me as I am really desperate to get this to work.

Thank you in advance.

Kind Regards,
Navein

wyldckat April 1, 2010 17:40

Greetings Navein,

Give me a step by step of what you've done so far. My guess is that you didn't follow the link to the other thread!

Best regards,
Bruno

navnair87 April 1, 2010 17:56

Hi Bruno,

Thank you for the quick reply.

I installed ubuntu 9.10 and installed OpenFOAM 1.6.x, following the instructions created by Mads Reck and revised by yourself. After that, I typed in the command that you posted in post #4 and you are right, I did not follow the link to the other thread. To be perfectly honest, I'm brand new to Linux and I don't really understand what you meant in the other thread. Would you mind giving me a step by step guide on how I have to go about doing this?

wyldckat April 1, 2010 18:08

OK, lets do this step by step then :)
  1. Got to the --> #21 <-- ;) post on the dedicated thread to libccmio
  2. Download the attached file and move it to the folder ~/OpenFOAM
  3. Now run:
    Code:

    cd ~/OpenFOAM/ThirdParty-1.6.x
    tar -xzf ../awlibccmio.tar.gz
    chmod +x AllwmakeLibccmio
    ./AllwmakeLibccmio

    These will unpack the files, make the script executable and build the ccm library for OpenFOAM to use.
  4. Finally run:
    Code:

    $FOAM_APP/utilities/mesh/conversion/Optional/Allwmake
And voilá, your brand new ccm26ToFoam is ready to go :) Ironically, I no experience using it :(

navnair87 April 1, 2010 18:16

Thanks Bruno, I really appreciate your help.
Stupid question here: Do I just move the file in the OpenFOAM folder and not in the OpenFoam-1.6.x folder?
I am currently in the midst of reinstalling OpenFOAM as I messed with the files too much over the past couple of days trying to figure this out. Once that is done, I'll be giving this a go and hopefully I'll do the right thing this time around.

wyldckat April 1, 2010 18:31

Uhm... OK, look at the two first code lines on step 3:
  • The first line makes the bash go to the ThirdParty folder:
    Code:

    cd ~/OpenFOAM/ThirdParty-1.6.x
  • The second line unpacks the file that is in the parent folder, namely "~/OpenFOAM":
    Code:

    tar -xzf ../awlibccmio.tar.gz
This way, all of the downloaded OpenFOAM packages will be in the base folder of OpenFOAM :cool:

Well you got lucky that I visited the forum so soon ;) I'm glad I could help :)

Best regards,
Bruno

navnair87 April 1, 2010 18:49

Thanks Bruno :)

Kind Regards,
Navein

navnair87 April 1, 2010 21:07

Hi Bruno,

I've managed to get it working! Thanks again for your assistance. Have a good Easter weekend!

Kind Regards,
Navein

wyldckat April 1, 2010 21:20

Hello Navein,

Congrats :) You're welcome and a good Easter weekend to you too :)

Best regards,
Bruno

toxo October 22, 2010 13:10

Problem
 
Dear all,
I was trying to follow the above steps in OpenFoam 1.7
and something was wrong
Iḿ new with linux and OpenFoam; could someone help me?

wyldckat October 22, 2010 13:13

Greetings Jano and welcome to the forum!

For OpenFOAM 1.7.0 and above, all you have to do to build ccm26ToFoam is:
Code:

$FOAM_APP/utilities/mesh/conversion/Optional/Allwmake
Best regards,
Bruno

toxo October 22, 2010 19:16

Many thanks for your fast reply Bruno!
when I have tried:

/opt/openfoam171/applications$ utilities/mesh/conversion/Optional/Allwmake
cd
+ ./AllwmakeLibccmio
utilities/mesh/conversion/Optional/Allwmake: 1: ./AllwmakeLibccmio: not found
+ [ -e /libccmio.so ]


Do you know where the problem could be?
Again many thanks!
Jano

wyldckat October 22, 2010 22:35

1 Attachment(s)
Hi Jano,

I forgot about asking you which version you were using :(...
OK, you're using the Debian packages for Ubuntu that OpenCFD made available. Unfortunately, they've made the packages without taking into account those who wish to build ccm26ToFoam.

Therefore, here it is the step-by-step mini-guide for getting your own ccm26ToFoam built with your installed version of OpenFOAM:
  1. Run these commands in the terminal:
    Code:

    mkdir -p $WM_PROJECT_USER_DIR
    cd $WM_PROJECT_USER_DIR
    cp -r /opt/openfoam171/applications/utilities/mesh/conversion/Optional .
    cd Optional
    sed -i -e 's=cd $WM_THIRD_PARTY_DIR && ==' -e 's=FOAM_LIBBIN=FOAM_USER_LIBBIN=' Allwmake
    sed -i -e 's=FOAM_APPBIN=FOAM_USER_APPBIN=' ccm26ToFoam/Make/files
    sed -i -e 's=${WM_THIRD_PARTY_DIR}=${WM_PROJECT_USER_DIR}/Optional=' ccm26ToFoam/Make/options
    sed -i -e 's=-lccmio=-L${FOAM_USER_LIBBIN} -lccmio=' ccm26ToFoam/Make/options

    Don't close this terminal window.
  2. Download the attached file "ccmio_maker.tar.gz" and copy/move it to the folder "$WM_PROJECT_USER_DIR/Optional" (the path shown in the terminal window).
  3. Now run in the previous terminal:
    Code:

    tar -xzf ccmio_maker.tar.gz
    ./Allwmake | tee build.log 2>&1

    The build process will be shown to you and saved in the file "build.log".
  4. Wait a few minutes and if no error message is outputed (check the log, just in case), then you have a shiny new ccm26ToFoam ready to be used :)
  5. The built files will be available in these folders (so you know where they went, in case you need to know ;)):
    Code:

    echo $FOAM_USER_APPBIN
    echo $FOAM_USER_LIBBIN

edit: these steps have been simplified in my next post #27.

Good luck! Best regards,
Bruno

toxo October 23, 2010 09:55

This is quite complicated!
I think that there is some problem with the third party folder

sudo sed -i -e 's=cd $WM_THIRD_PARTY_DIR && ==' -e 's=FOAM_LIBBIN=FOAM_USER_LIBBIN=' Allwmake
sed: non se puido ler Allwmake: No such file or directory

Ifeel I'm heavy with this theme, but do not know what to do?
Best regards

wyldckat October 23, 2010 13:13

1 Attachment(s)
Hi Jano,

Sorry about that :( I forgot that you were new to this.

OK, new instructions, simplified:
  1. Download the attached file and move it to a folder you feel comfortable with. For example, to a new folder in your Desktop folder.
  2. Open a terminal window and go to the folder where you placed the downloaded file. For example:
    Code:

    cd "~/Desktop/New Folder"
  3. Run these two commands:
    Code:

    tar -xzf ccm26local.tar.gz
    ./ccm26local

  4. If all goes well, it will do all of the code steps I posted about in the previous post.
By the way, you've already done at least the first tutorial explained in the OpenFOAM's User Guide, correct?

Good luck!
Bruno

lth May 21, 2011 10:17

ccm26ToFoam working
 
Thank you, this was a very helpful and straight forward solution. Appreciated greatly by forum members.


-Lori

wyldckat July 21, 2011 17:23

1 Attachment(s)
Greetings to all!

Since the deb packages for OpenFOAM 2.0.0 have been changed considerably, here's a modified package for 2.0.0. Keep in mind that this modification will not work for 1.7.0 nor 1.7.1.

Instructions are the same as the ones from the before-previous post ;)

Best regards,
Bruno

ghindi July 22, 2011 05:58

Hi Bruno,

thanks once again. Excellent.

Best regards,

Gustavo.

fferroni February 19, 2012 14:21

Hello.

I get this error when running the script. I am running OF 2.0.0 on a Mac.
Anyone know what I can do? Thank you :)

Francesco-Ferronis-MacBook-Pro:Desktop MacbookPro$ ./ccm26local
sed: -e: No such file or directory
+ /Users/MacbookPro/OpenFOAM/ThirdParty-2.0.x/AllwmakeLibccmio
downloading libccmio-2.6.1.tar.gz from https://wci.llnl.gov/codes/visit/3rd...o-2.6.1.tar.gz
etc/tools/ThirdPartyFunctions: line 72: wget: command not found
no download/libccmio-2.6.1.tar.gz to unpack
+ cd libccmio-2.6.1
/Users/MacbookPro/OpenFOAM/ThirdParty-2.0.x/AllwmakeLibccmio: line 67: cd: libccmio-2.6.1: No such file or directory
+ exit 1
+ '[' -e /Users/MacbookPro/OpenFOAM/ThirdParty-2.0.x/platforms/darwinIntel64Gcc45DPOpt/lib/libccmio.so ']'

wyldckat February 19, 2012 14:51

Hi fferroni,

:eek: Apparently you don't have GNU shell tools installed or whatever it's called on Mac... and possibly is available on Mac ports. I say this because sed doesn't seem to work the same way it does on Linux and you don't even have wget installed either.

It will probably be faster to manually do the commands shown in the script, instead of simply running the script. sed acts a fast text editor and wget acts as a downloader.

The two scripts that need some steps done manually are:
  • the one you wrote about;
  • and the AllwmakeLibccmio one.
Best regards,
Bruno

fferroni February 19, 2012 15:26

Hi,

Thanks for the really quick response.

I did the commands manually, substituting WM_THIRD_PARTY_DIR with . and FOAM_EXT_LIBBIN with FOAM_USER_LIBBIN in the appropriate files.
Then I downloaded libccmio-2.6.1, ran the scripts etc. but I get these errors with

MacBook-Pro:Optional MacbookPro$ ./AllwmakeLibccmio

+ cd libccmio-2.6.1
+ mkdir Make
mkdir: Make: File exists
+ cp -n ../wmakeFiles/libccmio/files ../wmakeFiles/libccmio/options Make/
+ wmake libso
/bin/sh: g++-mp-4.5: command not found
make: *** [libNULL.dylib] Error 127

So far, I have a folder Optional in $WM_PROJECT_USER_DIR with Allwmake, AllwmakeLibccmio, build.log, cc26ToFoam folder, tools folder, wmakeFiles folder and libccmio-2.6.1 folder. Not sure what the problem is! Any help is appreciated :)

Thank you again.

Best,

Francesco

wyldckat February 19, 2012 17:49

Hi Francesco,

Well, you're missing g++-mp-4.5, one of the parts of the gcc 4.5 compiler toolkit... which is another big indication that you are missing several tools.

On the following post is a recent guide on how to install OpenFOAM 2.1.x on Macs: http://www.cfd-online.com/Forums/ope...tml#post343833 post #22 - there you should find a lot of instructions that are needed for both 2.0.0 and 2.1.x ;)
I don't have a Mac myself, so I can't help much more than this :(

Good luck!
Bruno

fferroni February 19, 2012 19:10

Hmm this is very strange.

I have gcc45 installed. I checked in Macports and I have:

gcc45 @4.5.3_1 (active)

Furthermore, just today I compiled an openfoam solver, and in the messages there was:
... g++-mp-4.5 -m64 -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2 ... etc.

So perhaps the Allwmake file is somehow not compatible with a Mac? :S
I really have no idea.. my knowledge of these things is far from enough :confused:

Thanks wyldckat for helping me so far though! :D

Anyone?

wyldckat February 20, 2012 04:36

Hi Francesco,

Have you tried doing the following commands manually, from where AllwmakeLibccmio is being executed?
Code:

cd libccmio-2.6.1
wmake libso

If this works, then something strange occurred when running the script :confused:

Good luck!
Bruno

ziad June 10, 2012 10:59

1 Attachment(s)
Hi everybody,

Finished compiled the stock version of ccm26ToFoam on 2.1.x and I thought I'd share it, just in case anyone could use it:
  1. Execute the attached AllwmakeLibccmio file in the ThirdParty-xxx directory
  2. cd $WM_PROJECT_DIR/applications/utilities/mesh/conversion/Optional/ccm26ToFoam
  3. wmake
That's it, you're done. It's important that the library location from $WM_PROJECT_DIR/ThirdParty-2.1.x/libccmio-2.6.1/Make/files (in my case "LIB = $(FOAM_USER_LIBBIN)/libccmio") be included under the "EXE_LIBS = \" section in $WM_PROJECT_DIR/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options. This is the last line in the code below:
Code:

EXE_LIBS = \
    -lfiniteVolume \
    -lmeshTools \
    -lccmio \
    -L$(FOAM_EXT_LIBBIN) \
    -L$(FOAM_USER_LIBBIN) <--- this line right here

Of course you can change this location to whatever works for you as long as it matches what's in $WM_PROJECT_DIR/ThirdParty-2.1.x/libccmio-2.6.1/Make/files


Happy foaming...
Z.

ashish.mexpert September 18, 2012 08:08

Hi Bruno ,
I have done same as you have given the second instructions but its giving the error like...

unpack download/libccmio-2.6.1.tar.gz
+ cd libccmio-2.6.1
+ mkdir Make
+ cp -n ../wmakeFiles/libccmio/files ../wmakeFiles/libccmio/options Make/
+ wmake libso
/opt/OpenFOAM-2.1.0/wmake/wmake: Zeile 222: make: Kommando nicht gefunden.
/opt/OpenFOAM-2.1.0/wmake/wmake: Zeile 223: make: Kommando nicht gefunden.
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created in /home/student12/OpenFOAM/student12-2.1.0/Optional/libccmio-2.6.1
+ '[' -e /home/student12/OpenFOAM/student12-2.1.0/platforms/linux64GccDPOpt/lib/libccmio.so ']'
student12@rela-d1:~/Convertor>

I dont know what to do now , i have actually .CCM file and i want to convert it into OpenFoam 2.1 please help me out of this as i am new too in OpenFoam. Your help will be appreciable.

wyldckat September 18, 2012 08:27

Greetings Ashish,

Looks like you haven't built any source code yet, because this message:
Quote:

make: Kommando nicht gefunden.
means that you don't have make installed.

Install the missing packages. I'm guessing you'll need to tun this before trying again:
Code:

sudo apt-get install build-essential flex bison zlib1g-dev
The command above was taken from here: http://www.openfoam.org/download/source.php

Best regards,
Bruno

ashish.mexpert September 18, 2012 09:25

Hi Bruno
 
Thanx for your reply,
I have tried it out as what u said , actually its Opensuse linux so i m trying it what the commands given now i have installed the both packages into the Openfoam installation folder and then tried with Opensuse Installation code given but still its giving smthing like this ---------
Zum Installieren oder Deinstallieren von Paketen werden Root-Rechte benötigt.

Can u tell me whts happening ??


All times are GMT -4. The time now is 01:36.