CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

how can I declare variables - please help

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 20, 2012, 04:36
Default how can I declare variables - please help
  #1
New Member
 
Join Date: Jan 2012
Location: Germany
Posts: 9
Rep Power: 14
cfd-noob is on a distinguished road
Hello,
I would like to declare a variable in blockMeshDict.

It should look like this:


aa=10;

bb=aa/10;

with "int" it doesn't seem to work.

Thank you very much
cfd-noob is offline   Reply With Quote

Old   January 20, 2012, 05:21
Default
  #2
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18
colinB is on a distinguished road
Hey,

as far as I know creating blockMeshDict files including variables doesn't
work, though the file itself is written in C++ style.

If you want to use variables you better write yourself a small tool
(I'm not aware of one existing)
that creates a blockMeshDict file and with this tool you can create
insert values and variables in a blockMeshDict file, which are dependent
on each other.

For the case that I'm wrong, I would also be interested in how to include
variables in a different manor.

regards
Colin

EDIT: This looks more like a topic for the blockMesh sub Forum than for
the running/solving sub Forum
colinB is offline   Reply With Quote

Old   January 20, 2012, 05:40
Default
  #3
Disabled
 
Join Date: Mar 2011
Posts: 174
Rep Power: 15
anon_a is on a distinguished road
I think that the "m4" macros are what you are looking for.
Just look for the corresponding tutorials
.../tutorials> find ./ -name *m4
and also in the forum.

I have not used this my self but it looks easy to understand.
anon_a is offline   Reply With Quote

Old   January 20, 2012, 06:39
Default Danke
  #4
New Member
 
Join Date: Jan 2012
Location: Germany
Posts: 9
Rep Power: 14
cfd-noob is on a distinguished road
Danke vielmals,
ich versuche es mal mit einem Matlab-Script.
cfd-noob is offline   Reply With Quote

Old   January 20, 2012, 12:30
Default
  #5
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 16
morard is on a distinguished road
You can also write a python script which creates blockMeshDict. It's very easy to write one, and works well.
morard is offline   Reply With Quote

Reply


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
Sgimpi pere OpenFOAM 27 September 24, 2011 07:57
$FOAM_USER_APPBIN & LIBBIN variables not set rassilon OpenFOAM Installation 2 February 16, 2010 20:54
Ld_library_path scottneh OpenFOAM 9 November 21, 2009 09:15
PHI file structure Eugene Phoenics 9 November 2, 2001 22:00
Saving variables on a user patch with physical coordinates Zoltan Turzo CFX 2 April 20, 2000 15:05


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