CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Meshing & Mesh Conversion (
-   -   Modify mesh runtime (

Daniele111 June 21, 2010 08:02

Modify mesh runtime
I'm simulating a evolutive case. My initial domain is a rectangle 2d and the shape of the bottom is a gaussian. At each temporal step the bottom modify its shape, How can I modify the mesh quickly at each time step?


deepsterblue June 21, 2010 09:11

Simple. Use the mesh-motion solver to move points at each time step. Take a look at icoDyMFoam and its multiple variants.

Daniele111 June 21, 2010 09:54

Uhm the coordinates of new point are calculated with matlab. I can use icoDyMFoam?

deepsterblue June 21, 2010 09:59

I don't see why not. I would write a function in C++ that replicates the matlab code to define boundary point-positions, and pass that into the mesh-motion solver to let it deal with internal ones. There's a ton of code-snippets in the forum that deal with this situation.

Daniele111 June 21, 2010 19:37

I can use it with simpleFoam?

Daniele111 June 21, 2010 19:55

I don't understand well how work it. In my problem matlab simulate a process and inside it (for cycle) I call OpenFoam to calculate shear stress, the new shape of the bottom is result of matlab script, I would modify old vertex mesh into the new one, and recalculate the new shear stress with openfoam etc...

Daniele111 October 11, 2010 04:29

I'm using simpleFoam for my simulation couple with a matlab script. I do a simulation with openfoam and I use its result for matlab script that update the geometry. How can I modify my mesh without remeshing to start a new simulation? I use a fluent mesh. It is a evolutive simulation coupled with matlab, and during the simulation change only the bottom shape.


shajitah October 12, 2010 14:18

Dear Daniele,

As far as I've realized, you've written a script in Linux which calls OpenFOAM. I'm gonna do a similar job. Actually, I'm supposed to write an algorithm in C++ or Matlab which one part of it deals with CFD calculations in which it needs to call OpenFOAM. I was wondering if you could please provide me a sample code/script (in any language) which calls OpenFOAM or a tutorial which might help me sort out the way of calling OpenFOAM.


Daniele111 December 19, 2010 16:43

What kind of command i must use to update my geometry. My situation is this:
1) Matlab script -> new bottom geometry
2) Update OpenFoam mesh with new bottom
3)OpenFoam simulation-> result go to matlab

So Can i update OpenFoam mesh? Matlab script give me new vertex position of the mesh bottom.
Help me!


All times are GMT -4. The time now is 14:48.