BlueCode2019 / COSMOL2OpenFOAM

Convert COMSOL mesh file to OpenFOAM mesh file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

COSMOL2OpenFOAM

Convert COMSOL mesh files (*.mphtxt) to OpenFOAM mesh files.

Tested on COMSOL 4.1, 5.2, 5.3, 5.3a. For other versions, please add the version info to the first part in mphtxtToFoam.m, or the program will exit on detection of the COMSOL version.

Tested on OpenFOAM 4.1. Should also work on later versions.

The head lines in COMSOL files are different. Three functions are made for v4.1, v5.2, and v.53, respectively. For newer versions of COMSOL, please compare the head lines and modify the readMphtxt53.m to generate the desired function for reading the files.

If you find this program helpful, please cite the paper Wang, Ningyu, Maša Prodanović, and Hugh Daigle. "Nanopaint application for flow assurance with electromagnetic pig." Journal of Petroleum Science and Engineering 180 (2019): 320-329.

To Octave users: 'parfor' is used to run for loops in parallel. It is not yet supported in Octave and needs to be replaced by the regular 'for'.

About

Convert COMSOL mesh file to OpenFOAM mesh file

License:GNU General Public License v3.0


Languages

Language:MATLAB 93.6%Language:C++ 6.4%