CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.com] How to compile ccmToFoam on precompiled v2406 for Ubuntu (in WSL) ?

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

Like Tree8Likes
  • 5 Post By Yann
  • 1 Post By hernanrmz
  • 1 Post By Yann
  • 1 Post By juancfd

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 27, 2024, 08:11
Lightbulb How to compile ccmToFoam on precompiled v2406 for Ubuntu (in WSL)
  #1
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,243
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello all,

I'm running OpenFOAM-v2406 on WSL/Ubuntu.
I installed the precompiled openfoam2406-default package.

I need to use ccmToFoam, which requires to be compiled after building the libccmio library, but I fail to do so.

EDIT: I solved my issue, so I'm going to turn this post into a tutorial.

Here is the process:
  1. Start a WSL session. In order to have write permission in the default OpenFOAM installation directory, you will need to start a shell with root privilege: sudo -s
  2. Load the OpenFOAM environment: source /usr/lib/openfoam/openfoam2406/etc/bashrc
  3. Move to the OpenFOAM install directory: foam
  4. Download the ThirdParty-v2406.tgz archive: wget https://dl.openfoam.com/source/v2406...arty-v2406.tgz
  5. Unpack the archive: tar -xzf ThirdParty-v2406.tgz
  6. Rename the extracted directory: rm ThirdParty && mv ThirdParty-v2406 ThirdParty
  7. Move to ThirdParty/sources directory and download the libccmio-2.6.1.tar.gz archive: cd ThirdParty/sources/ && wget https://sourceforge.net/projects/foa...o-2.6.1.tar.gz
  8. Unpack the archive: tar -xzf libccmio-2.6.1.tar.gz
  9. Get back to the ThirdParty directory and reload the OpenFOAM environment: cd .. && source /usr/lib/openfoam/openfoam2406/etc/bashrc
  10. Compile the libccmio library: ./makeCCMIO
  11. Move to: cd $FOAM_SRC/conversion/ccm
  12. Build the libccm library: ./Allwmake
  13. Move to: cd $FOAM_UTILITIES/mesh/conversion/ccm/
  14. Build the ccm utilities: ./Allwmake
  15. All done, exit the root shell and reload the OpenFOAM environment: exit && source /usr/lib/openfoam/openfoam2406/etc/bashrc

Here you go, you should now be able to use ccmToFoam and foamToCcm

If anyone more competent than me knows a better way to do this, let me know!
Yann

Last edited by Yann; June 27, 2024 at 11:03.
Yann is offline   Reply With Quote

Old   December 5, 2024, 14:23
Default
  #2
New Member
 
Hernan
Join Date: Jul 2015
Posts: 5
Rep Power: 11
hernanrmz is on a distinguished road
Hello Yann,

Great tutorial, it works for me!

I haven´t use this application (ccmToFoam), I have use the ccm26ToFoam application from the Foundation version sometimes

Do you use ccmToFoam regularly? What kind of meshes had you use?

This case attached was composed for two regions so I use the "-merge" option and works fine.

OpenFOAM-Mesh.jpg

StarCCM-Mesh.jpg

Best regards

Hernán Ramírez
Yann likes this.
hernanrmz is offline   Reply With Quote

Old   December 6, 2024, 04:47
Default
  #3
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,243
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello Hernán,

Thank you, I'm glad this has been useful for you!

I needed ccmToFoam for a specific case so I did not have many opportunities to use it, but I've been able to convert hex and poly meshes. It also worked to convert a multi region mesh for a CHT case, with some extra step required after conversion to deal with region interfaces.

I don't know the exact differences, but according to these release notes, ccm26ToFoam has been deprecated and replaced by ccmToFoam since OpenFOAM-v1612+ in the OpenCFD branch.

Cheers,
Yann
Yann is offline   Reply With Quote

Old   December 6, 2024, 12:55
Default
  #4
New Member
 
Hernan
Join Date: Jul 2015
Posts: 5
Rep Power: 11
hernanrmz is on a distinguished road
Hello Yann,

Thank you for your answer. In the company I work, we use Star-CCM+ (I've been using it for the last 7 years), but I want to implement OpenFOAM as an option to solve some cases.

My next step (in a few weeks) is to convert a mesh of a CHT case. Could you explain what extra steps are requiered after conversion?

Cheers,

Hernán
hernanrmz is offline   Reply With Quote

Old   December 9, 2024, 06:09
Default
  #5
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,243
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello Hernán,

For CHT cases in OpenFOAM, we usually use splitMeshRegions to split the mesh and create the coupled interfaces between regions.

You can use ccmToFoam to convert a CHT mesh using the -solids option, but you end up with disconnected regions.
I used stitchMesh to reconnect the regions together, and then used splitMeshRegions to split the mesh and create the interfaces.

It's probably possible to use splitMeshRegions first and then deal with the interfaces using something like createPatch, but I'm lazy and I'd rather let splitMeshRegions do the job for me

I couldn't find a way to avoid disconnected regions after running ccmToFoam (-merge does not seem to change anything in this case).
Let me know if you find another way to achieve it without having to stitch the mesh!

Cheers,
Yann
Yann is offline   Reply With Quote

Old   January 8, 2025, 05:43
Default
  #6
New Member
 
Juan
Join Date: Jun 2024
Posts: 3
Rep Power: 2
juancfd is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello all,

I'm running OpenFOAM-v2406 on WSL/Ubuntu.
I installed the precompiled openfoam2406-default package.

I need to use ccmToFoam, which requires to be compiled after building the libccmio library, but I fail to do so.

EDIT: I solved my issue, so I'm going to turn this post into a tutorial.

Here is the process:
  1. Start a WSL session. In order to have write permission in the default OpenFOAM installation directory, you will need to start a shell with root privilege: sudo -s
  2. Load the OpenFOAM environment: source /usr/lib/openfoam/openfoam2406/etc/bashrc
  3. Move to the OpenFOAM install directory: foam
  4. Download the ThirdParty-v2406.tgz archive: wget https://dl.openfoam.com/source/v2406...arty-v2406.tgz
  5. Unpack the archive: tar -xzf ThirdParty-v2406.tgz
  6. Rename the extracted directory: rm ThirdParty && mv ThirdParty-v2406 ThirdParty
  7. Move to ThirdParty/sources directory and download the libccmio-2.6.1.tar.gz archive: cd ThirdParty/sources/ && wget https://sourceforge.net/projects/foa...o-2.6.1.tar.gz
  8. Unpack the archive: tar -xzf libccmio-2.6.1.tar.gz
  9. Get back to the ThirdParty directory and reload the OpenFOAM environment: cd .. && source /usr/lib/openfoam/openfoam2406/etc/bashrc
  10. Compile the libccmio library: ./makeCCMIO
  11. Move to: cd $FOAM_SRC/conversion/ccm
  12. Build the libccm library: ./Allwmake
  13. Move to: cd $FOAM_UTILITIES/mesh/conversion/ccm/
  14. Build the ccm utilities: ./Allwmake
  15. All done, exit the root shell and reload the OpenFOAM environment: exit && source /usr/lib/openfoam/openfoam2406/etc/bashrc

Here you go, you should now be able to use ccmToFoam and foamToCcm

If anyone more competent than me knows a better way to do this, let me know!
Yann

Hi Yann,

I am experiencing some issues in the 10th step. When I was trying to run the makeCCMIO script I have found the following error:




openfoam@Ubuntu:/usr/lib/openfoam/openfoam2406/ThirdParty$ ./makeCCMIO
Appear to have {wmkdepend,wmkdep} binary
Found sources: sources/libccmio-2.6.1
Starting build: libccmio-2.6.1 (lib)

cpMakeFiles libccmio .
Compiling enabled on 12 cores
wmake lib
wmake: 'Make' directory does not exist in /usr/lib/openfoam/openfoam2406/ThirdParty/sources/libccmio-2.6.1
Searching up directories tree for Make directory
Error: no Make directory for /usr/lib/openfoam/openfoam2406/ThirdParty/sources/libccmio-2.6.1

Error building: libccmio-2.6.1




To give some context, I am running the steps in Ubuntu 22.04 version inside an Oracle Virtual Box Machine. Moreover, I run some of the previous steps with the command "sudo" because without it the installations and decompressions failed saying "permission denied".

Thank you in advance!
juancfd is offline   Reply With Quote

Old   January 8, 2025, 06:57
Default
  #7
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,243
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello Juan,

I am not exactly sure, but I think your error might be related to a permission issue.

You indeed need to have root privilege to be able to write files in the OpenFOAM installation directory.
This is what step 1 is about. If you did step 1 and run all other commands in the same shell session you should not have permission issues.
However if you skipped step 1 or ran commands from another shell session you should probably run pretty much all commands with sudo.

So you can try running sudo ./makeCCMIO, or go over all the procedure again paying attention to have the right permissions (just in case other steps failed due to permission issues)

Let me know how it goes!
juancfd likes this.
Yann is offline   Reply With Quote

Old   January 8, 2025, 08:47
Default
  #8
New Member
 
Juan
Join Date: Jun 2024
Posts: 3
Rep Power: 2
juancfd is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello Juan,

I am not exactly sure, but I think your error might be related to a permission issue.

You indeed need to have root privilege to be able to write files in the OpenFOAM installation directory.
This is what step 1 is about. If you did step 1 and run all other commands in the same shell session you should not have permission issues.
However if you skipped step 1 or ran commands from another shell session you should probably run pretty much all commands with sudo.

So you can try running sudo ./makeCCMIO, or go over all the procedure again paying attention to have the right permissions (just in case other steps failed due to permission issues)

Let me know how it goes!
Hello again Yann,

It's working now! As you said, I was trying to execute the commands from another shell. I've opened a new terminal and executed all steps again, finally it's working.

I've also tried to use the ccmToFoam package and it modifies the mesh from .ccm format into polyMesh without issues.

Thank you for your time and support!
Yann likes this.
juancfd is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 22:51


All times are GMT -4. The time now is 13:10.