CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

PyFluent Parametric Command

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Youwann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 14, 2024, 04:31
Default PyFluent Parametric Command
  #1
New Member
 
Youwann
Join Date: Feb 2024
Location: France
Posts: 2
Rep Power: 0
Youwann is on a distinguished road
Hello,

I'm trying to use PyFluent to modify a already existing case :

Code:
%matplotlib
import ansys.fluent.core as pyfluent

solver = pyfluent.launch_fluent(
    precision="double",
    version="2d",
    processor_count=10,
    mode="solver",
    show_gui='True'
)

solver.file.read(file_type="case", file_name="example.cas.h5")

solver.tui.define.boundary_conditions.list_zones

inle = solver.setup.boundary_conditions.mass_flow_inlet['inlet']
inlet.mass_flow = 0.01

solver.file.write(
    file_type="case",
    file_name="example.cas.h5",
)

solver.tui.define.parameters.enable_in_TUI("yes")
But when I try to change an input parameter :

Code:
solver.tui.define.parameters.input_parameters.advance.use_in("udf_size", "htc_ext", 20)
I obtain :

Code:
invalid command [udf_size]

Error: wta(2nd) to string_eq
Error Object: #f
and why I try to use the TUI commande :
Code:
define parameters input-parameters advance use-in udf-side htc_ext set 0
It didn't work either :

Code:
Error: eval: unbound variable
Error: 'htc_ext'is predefined expression. Please change name.
Error Object: #f
Is there a way to run TUI code directly in a jupyter notebook or a command to update existing Pyfluent parameters?
Youwann is offline   Reply With Quote

Old   February 15, 2024, 03:02
Default Update
  #2
New Member
 
Youwann
Join Date: Feb 2024
Location: France
Posts: 2
Rep Power: 0
Youwann is on a distinguished road
I found the command for Python:

Code:
solver.tui.define.parameters.input_parameters.edit("name", "new_name", value)
Volcano Nebula likes this.
Youwann 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
EnSight - queue of command files and abaqus post-processing Delcraft EnSight 1 June 1, 2016 16:38
invalid command error Hashir Shafi Main CFD Forum 1 April 8, 2016 03:32
Ansys SIG$ILL error loth ANSYS 3 December 24, 2015 05:31
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 flakid OpenFOAM Installation 16 December 28, 2010 08:48
Command Line vs. GUI Menus Go FLUENT 0 June 8, 2005 16:05


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