CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Altering the mesh (http://www.cfd-online.com/Forums/openfoam-pre-processing/62222-altering-mesh.html)

alejo February 16, 2006 08:04

Hi all Im new openFoam user.
 
Hi all
Im new openFoam user. Im doing a very simple mesh and I read about using m4 for change the points by defining the points. It is possible to change the mesh by using equations in m4? How should I proceed?.
Thanks.
Alejandro

hemph February 16, 2006 08:21

Hi Alejandro You can let perl
 
Hi Alejandro
You can let perl do the calculations if you add the command
define(calc, [esyscmd(perl -e 'printf ($1)')])
in the header of your m4-file. You can then use the newly defined calculator by calling calc(expression)
example:
define(CX, calc(R*cos((PI/180)*45)))
would assign to CX, the x-value of a point at a distance R, with an angle of 45 degrees.
//Rasmus

alejo February 16, 2006 09:06

Thanks Rasmus, I was trying
 
Thanks Rasmus,
I was trying to doit, but I have to say that it is the first time that I heard about m4, and less about m4 files. Im using kDevelop c/c++ to change set the mesh manually, and then the blockMesh utility. I do not understand how to use the m4 command. If u have some comment about I would appreciate it.
Thanks again.

hemph February 16, 2006 09:15

you have to be careful then, a
 
you have to be careful then, apparently m4 can take over your life...
(http://www.gnu.org/software/m4/manua...tro.html#Intro)
There is a section in the WIKI on how to use m4 to generate a blockMesh. Did you see it?
http://openfoamwiki.net/index.php/HowTo_blockMesh _with_m4


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