CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] Define blockMeshDict dynamically using c++ code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 31, 2022, 16:20
Default Define blockMeshDict dynamically using c++ code
  #1
Member
 
Miguel Hernandez
Join Date: Feb 2021
Location: En mi casa
Posts: 56
Rep Power: 5
Miguel Hernandez is on a distinguished road
Hi everyone,
I am wandering if is possible to create a dynamic blockMeshDict file using c++ CODE.
I know that is possible to use

code
#{
//c++ instructions...
#};

but, what I'd like to know is if is possible to create a certain number of blocks using a for loop.

To be precise, I would like to create a mesh of a stair, using a user defined variable (e.g. an integer variable) that represents the number of steps.
Using this variable (or more than one variable) I would like to create a certain number of blocks equal to the defined variable.

Does anyone know how to implement a code like that?
How can I implement a for loop inside

blocks
(

);

Thanks in advance.

Miguel
Miguel Hernandez is offline   Reply With Quote

Reply

Tags
blockmesh dict, c++ geometry


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
REAL GAS UDF brian FLUENT 6 September 11, 2006 09:23
UDF FOR UNSTEADY TIME STEP mayur FLUENT 3 August 9, 2006 11:19
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 16:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 09:10
UDF Scalar Code: HT 1 Greg Perkins FLUENT 8 October 20, 2000 13:40


All times are GMT -4. The time now is 13:58.