Giter VIP home page Giter VIP logo

comsol-adapter's Introduction

preCICE-adapter for the FEM code COMSOL Multi-Physics

This folder contains files to use COMSOL as the structural solver in an FSI simulation. Since it was not possible to directly couple the C++ coded preCICE to the COMSOL API, we used FSI*ce as intermediate communication/data library. There are, hence, two important files: comsol_simulation.c, the interface with the COMSOL API, which uses FSI*ce to communicate the data to the intermediate (executable) component ComsolPrecice.c. ComsolPrecice uses FSI*ce to exchange data with comsol_simulation, and preCICE for the actual coupling.

Only 2D simulations have been done so far. For 3D, several changes to comsol_simulation.c and some to ComsolPrecice.c have to be done.

How to compile the files?

The compilation is done by SCons, check the SConstruct script for detailed information on the build variables. There is a debug and a release mode.

comsol_simulation.c is compiled and linked into a shared object (.so). For that, it needs (among others) the pathes to the COMSOL installation, and the FSI*ce libraries. These paths are hardcoded in the SConstruct file.

ComsolPrecice.c is compiled into an executable. For that, it needs (among others) the pathes to the FSI*ce libraries and the preCICE library.

How to run COMSOL for FSI simulations?

There are two executables to be run (in any order). The Comsol script needs to be run as follows

$ comsol script simulation

The keyword "simulation" tells the COMSOL script to run the simulation.m file in the current directory. It can also be omitted and given in the scripting GUI. To run COMSOL script without GUI, type

$ comsol script -term

Wait until comsol started, then type

$> flreport('off') $> simulation

To run ComsolPrecice, type

./ComsolPrecice Comsol precice_config.xml

Where COMSOL gives the name of the participant to preCICE, and precice_config.xml tells preCICE where to find the coupling configuration.

HINT: Sometimes, after killing the COMSOL script, it happens that COMSOL starts, but doesn't load the simulation.m file. It suffices to close and restart it.

comsol-adapter's People

Contributors

kyledavissa avatar uekerman avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

drs261083 jmake

comsol-adapter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.