CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   How to change model constants with TUI-File? (https://www.cfd-online.com/Forums/fluent/197850-how-change-model-constants-tui-file.html)

Sarah_Fluent January 19, 2018 01:22

How to change model constants with TUI-File?
 
Hello everybody,

I have written a TUI File that builds my model and solves it.
Extract: /define/models/viscous/kw-sst yes

The whole file is implemented in a batch file so I can run it iteratively.

Now I would like to change the model constants of my k-omega-sst- model, like "a1" or the "wall prandtl number".

I have not found out how this can be done by TUI.

Is that not possible? I have looked through the text command list but I did not find it.


Best regards
Sarah

LuckyTran January 19, 2018 14:43

It's possible but not so easily.

You have to use the rpsetvar command and manually set the variables, which means you have to know their built-in names. And as you know, the names are not documented anywhere.

But remember that the case file contains all the information about your setup and the case file can be read by a text editor (as long as you don't save in binary language & as long as you have enough memory to open the entire mesh). It helps to have a small case file for testing purposes where you can easily do this. Now if you were to open the .cas file you would find lines like the following, somewhere:

Code:

(kw-not-trans-sst-production-limiter? #t)
(kw-not-trans-sst-kato-launder? #f)
(kw-sst-min-visc/apply-below-f2-value 0.)
(kw-sst-min-visc-ratio 0.)
(sst-pk-lam-factor 0.)
(sst-po-lam-factor 0.)
(sst-pk-factor 10.)
(sst-kappa 0.41)
(sst-beta-i2 0.0828)
(sst-beta-i1 0.075)
(sst-a1 0.31)
(sst-sig-w2 1.168)
(sst-sig-w1 2.)
(sst-sig-k2 1.)
(sst-sig-k1 1.176)
.
.
.
(keprt 0.85)
.
.
.
(wallprt 0.85)

Notice these names are not the same as the labels in the GUI, but it should not be too difficult to figure out. Now you can change the a1 constant from 0.31 to 0.32 by doing for example:
Code:

(rpsetvar' sst-a1 0.32)
I recommend to verify that you have done it correctly using a GUI session. Since you may not be sure if you have changed the right variable. e.g. keprt is also the energy turbulent prandtl number even for kw-sst and vars like ssg-k1 and sst-sig-w1 are labeled TKE and SDR Prandtl # in the GUI. If you are familiar with the model equations, it is more intuitive why they are labeled sig-k and sig-w.

Sarah_Fluent January 19, 2018 16:09

Thank you very much!

I will try thar approach. What I did to know was recording a journal file where I only save the variable, extract the commands and this works quite well. But for saving some lines, I will implement your proposal.

visitor August 23, 2020 06:05

This is interesting. I was looking for away in changing turbulence model depending on a conditional statement.

If temperature per a cell is greater than 500K use k-e RNG
Else use k-e

Don't know how to write such a conditional statement in a TUI.

Hope someone can show an example, thanks.

AlexanderZ August 24, 2020 00:04

TUI command to run k-e RNG
Code:

define models viscous> ke-rng? yes
you need scheme script + TUI commands to define this condition

1. Get temperature
2. compare with criteria
3. execute condition

you may run this script on each timestep using execute commands


All times are GMT -4. The time now is 03:34.