|
[Sponsors] |
Changing Boundary Condition Types via Scheme/UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 26, 2015, 15:20 |
Changing Boundary Condition Types via Scheme/UDF
|
#1 |
New Member
Join Date: Sep 2013
Posts: 13
Rep Power: 13 |
Hey everyone,
I'm looking to create a code to change the type of a boundary condition once. For example, I'm looking to change a boundary type with known zone ID from whatever it currently is to a velocity inlet, how would I go about doing this? Background on this, I have a problem which may have 200+ boundary condition locations in which are set as 'walls' during meshing. I'm looking to change these 200+ BCs all at once to their respective ones by either loading a scheme file or using define_execute_on_loading. Thanks. |
|
November 2, 2015, 16:54 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Changing boundary conditions must be done via the GUI or TUI. Using a scheme file, the boundary condition could be changed with the TUI command:
Code:
/define/boundary-conditions/modify-zones/zone-type |
|
November 3, 2015, 14:37 |
|
#3 |
New Member
Join Date: Sep 2013
Posts: 13
Rep Power: 13 |
Thanks e for the reply. I was hoping there was a more automated solution.
I believe what I'll end up doing is creating a script to generate either a scheme file or journal file with the zone ids/names, changing the boundaries that fit the certain criteria (most likely just some naming convention) with the TUI command you've stated, then assigning their properties with their respective TUI commands. I'm not quite sure where to start with scheme programming as it relates to fluent however. Currently I've been using the code below (source) to feed names into my UDF in which I get thread IDs that I use. Code:
(rp-var-define 'jos-thread-id-list () 'list #f) (rpsetvar 'jos-thread-id-list ()) (for-each (lambda (t) (rpsetvar 'jos-thread-id-list (list-add (rpgetvar 'jos-thread-id-list) (thread-id t)))) (get-all-threads)) (rpgetvar 'jos-thread-id-list) (rp-var-define 'jos-thread-name-list () 'list #f) (rpsetvar 'jos-thread-name-list ()) (for-each (lambda (t) (rpsetvar 'jos-thread-name-list (list-add (rpgetvar 'jos-thread-name-list) (thread-name t)))) (get-all-threads)) (rpgetvar 'jos-thread-name-list) Code:
strstr(RP_Get_List_Ref_String("jos-thread-name-list", j_BC), "channel_inlet") |
|
November 3, 2015, 15:28 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Unfortunately, I haven't found a simpler way of changing boundary conditions mid-simulation. There's unofficial documentation on Scheme programming with Fluent which might be useful.
How are you determining which boundaries are modified? Could you write these zone IDs to a file during a time step? |
|
November 3, 2015, 15:43 |
|
#5 |
New Member
Join Date: Sep 2013
Posts: 13
Rep Power: 13 |
Nice, thanks for the link, the only other document I've found in regards to fluent Scheme programming has all supporting text in German.
From meshing, I've named the boundaries to some common name, for example "channel_inlet" or "channel_outlet." From this, I've created a lookup table in my UDF of zone IDs which I use basically everywhere. Also, my case is strictly steady state, so this applying of a new boundary type only happens once during the setup of the problem. |
|
November 3, 2015, 16:52 |
|
#6 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
If you know which boundaries are changing beforehand then you could label them with a common prefix, for example "boundarychanges_inlet". The wildcard character can be used with the TUI such that "boundarychanges_*" includes all boundaries that start with "boundarychanges_".
|
|
November 3, 2015, 17:28 |
|
#7 |
New Member
Join Date: Sep 2013
Posts: 13
Rep Power: 13 |
Wow having the ability to use wildcards in TUI commands is very convenient! That makes everything a lot easier.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mixed inflow/outflow downstream boundary condition question | peob | OpenFOAM Running, Solving & CFD | 3 | February 3, 2017 11:54 |
Changing Boundary Types | otq | OpenFOAM Pre-Processing | 0 | October 8, 2013 13:00 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
Changing the name of a boundary condition produces errors | jorkolino | OpenFOAM Bugs | 2 | January 6, 2011 04:14 |
Convective Heat Transfer - Heat Exchanger | Mark | CFX | 6 | November 15, 2004 16:55 |