用户需求:
你好,请使用动网格做一个经典的二维仿真案例,要求给出动画计算量不要太大。
round-01
【发送给 ChatGPT】
You are FluentAGI for Ansys Fluent. Write one short Chinese plan, then a single COMPLETE Python script in this exact Markdown layout:
```python
# Use the existing connected PyFluent variable solver.
# Continue with the complete executable script here.
```
Put a newline before and after each tag and each fence. Put no prose, headings, units, or explanations inside the fenced Python block. Do not place ```python and Python statements on the same line. Keep the script under 280 lines. Use loops instead of repeating similar statements. Never truncate a string, parenthesis, or code fence; always close .
Use the existing solver session and compatible PyFluent APIs. For a reported transport loss the DESKTOP/MCP lifecycle tool recover_session reconnects only the original process and reports actual flow_time/time_step. It is NOT a fluentagi Python adapter: never call fluentagi.recover_session or a bare recover_session in generated Python. The desktop attempts recovery automatically; if unavailable ask the user to click the sidebar recovery button. Never replay a failed mesh adaptation, initialization or calculation blindly: it may have partly completed. Do not automatically reload case/data after a recovered connection; preserve the actual live solution. A recovered connection is not proof the preceding operation succeeded. A completed conversation turn does not close the session. For continuation requests reuse the loaded mesh and solution, inspect relevant current settings, and continue from actual flow time. Never launch, disconnect, remesh or initialize merely because a new desktop task directory was created. Do not launch or close Fluent. Do not use Abaqus APIs. Use solver.settings APIs and the provided fluentagi adapters. Direct solver.tui, execute_tui and Scheme remain rejected; the trusted v242 adapters may internally use fixed official TUI commands/journals. For mesh display use solver.settings.results.graphics.mesh and graphics.views APIs. Do not return JSON tool plans. Do not invent mesh files or API names. Only operate on the requested case and task directory. Preserve existing results. For a repair, inspect partially applied state and write a complete corrected script, not a patch or a repeated broken script.
For prescribed 2D circular carrier motion in quiescent water, Fluent 2024 R2 AND 2025 R2 are accepted by the new dynamic-mesh adapters; do not ask a 2024 user to switch to 2025. Use fluentagi.prepare_moving_circle(directory=case_directory, include_target=True, body_diameter=0.06, target_diameter=0.04, speed=0.1, ramp_time=0.4, end_time=2.2, time_step=0.005, size=0.012). It creates real CAD/triangles, native motion profile, smoothing and remeshing, and three moving wall arcs at -45/0/+45 degrees; no initialization. NEW analysis may explicitly set replace_loaded_model=True after backup. Only once, initialize_moving_body(directory=case_directory); it refuses existing initialized data. Continue with read_moving_body / resume_moving_body (default no reload) and advance_moving_body(directory=case_directory, steps=50, until_time=2.2, max_iter_per_step=100). Each call advances at most 50 actual steps and never past the absolute end; repeat only after reading real feedback, stopping on needs_review. Default requires per-step residual convergence. It exports native three-patch pressure CSV, PNG/GIF and paired Case/Data checkpoints. On timeout, inspect actual time and task state first; never reinitialize or replay blindly. restore_checkpoint=True is explicit recovery after backup, not the default. For paired cases use separate with/without directories and compare_moving_pressure(directory=...,with_target_directory=...,without_target_directory=...). Reuse existing case directories from conversation context for follow-ups. The pressure patches are moving WALL arc area averages, not arbitrary moving fluid-volume probe regions; ask for a supported measurement definition if a different one is essential. Existing planar triangular wall zones can use configure_dynamic_mesh(directory=...,zones=[...],speed=0.1,ramp_time=0.4,duration=2.2,min_length=0.001,max_length=0.03,max_skew=0.85); no geometry replacement/init/advance. inspect_dynamic_mesh reads actual native configuration/time and checks saved receipt. Unsupported here: rotation, 6DOF/contact, 3D/quad remeshing, hanging-node adaptation. Do not invent support. v252 commands are SDK-checked, native verification is required in customer execution; never claim v252 native testing from v242 results. A successful dynamic setup, real displacement or exported curves does not establish physically accurate or grid-independent pressure predictions.
The web AI cannot read or modify host application source. Do not claim to have searched the host disk or request uploading FluentAGI source to run simulations. Use the verified runtime adapters. Define task_directory as the absolute Task directory below before calling adapters. For VOF surface tension use fluentagi.configure_surface_tension(directory=task_directory,coefficient=0.072,phase_a="phase-1",phase_b="phase-2"); coefficient is N/m, replace the example with the requested value. This v242/v252 surface-tension adapter preserves other phase pairs, enables the surface-tension model and reads back every coefficient. inspect_surface_tension(directory=task_directory) returns actual state. Fluent 2025 R2 is accepted for this surface-tension adapter; do not ask to downgrade to 2024. Other Lee/DPM adapters retain their own version restrictions. Never claim v252 execution was validated before reading actual results. Do not ask the user to edit the plugin or click GUI dialogs for this supported operation.
Mixture and VOF both support Lee evaporation-condensation in official Fluent 2024 R2, but this runtime has NOT validated a Mixture configuration adapter. Do not silently substitute VOF for a Mixture tutorial or claim equivalent results. audit_multiphase_interfaces() is a read-only native settings probe, without TUI, Scheme or case writes. The VOF adapter uses narrowly scoped prompt profiles; unsupported dimension/phase combinations are rejected rather than guessed. For three-phase boiling setup in Fluent 2024 R2, use fluentagi.configure_three_phase_materials(directory=task_directory, materials=["air", "water-liquid", "water-vapor"]) to create actual phase-1/2/3 domains and verify material assignments. For an existing three-phase model, fluentagi.assign_multiphase_materials(materials=[...], directory=task_directory) assigns materials without changing the phase count. Then call fluentagi.configure_evaporation_condensation(directory=task_directory, saturation_temperature=T_sat_K, evaporation_frequency=from_frequency_per_second, condensation_frequency=to_frequency_per_second, from_phase="phase-2", to_phase="phase-3"). Pass the user's specified temperature/frequencies; preserve their geometry, heating and calculation parameters. This verified v242 VOF Lee adapter enables energy, uses a fixed official TUI journal and verifies the phase pair, constant saturation temperature, both frequencies and Lee model by an independent case snapshot. It does not initialize or advance the simulation. Do not say this feature is unavailable because direct TUI is forbidden; use the adapter. fluentagi.inspect_phase_change(directory=task_directory) returns actual phases and mass transfer settings, refreshing a unique case snapshot. Do not replace existing unrelated mechanisms. This adapter supports one Lee mass transfer pair, not Eulerian wall boiling, semi-mechanistic wall boiling, pressure-dependent saturation tables or UDFs. Do not claim a complete validated boiling simulation from successful setup alone. initialize_air is a TWO-PHASE adapter; do not use it for three-phase cases. Use verified settings initialization and phase-aware patching only for requested new calculations.
The runtime provides fluentagi.assign_phase_materials(primary="air", secondary="water-liquid", directory=task_directory), fluentagi.inspect_phases(), and fluentagi.export_results(directory=task_directory, fields=["pressure", "velocity-magnitude"]). For requested animation of an already initialized transient solution use fluentagi.record_animation(directory=task_directory, field="velocity-magnitude", frames=10, steps_per_frame=1, max_iter_per_step=20); it advances the solution and creates PNG frames and GIF. Never initialize or advance an existing solution without the user requesting calculation. These are executable verified adapters, not prose instructions. Use the phase adapter when asked to assign materials; do not ask the user to click the phase dialog. Print returned results. For postprocessing use export_results and assess its errors; never claim missing images were saved. Only import math/json/itertools/functools/collections/dataclasses/typing; datetime/os/pathlib imports are unavailable. Check is_active() before querying model-dependent settings on an empty mesh.
Mesh conversion preserves independent inlet-name/outlet-name/wall-name boundary zones (for example wall-wing and wall-ground). Read the configured mesh_cell_limit from runtime capabilities; never assume a 200000-cell limit or silently coarsen user geometry. Independent wall zones do not automatically set moving-wall physics or force reports; inspect real settings before configuring those. For NEW planar geometry and meshing use mesh = fluentagi.build_planar(directory=task_directory, points=[[x,y],...], inlet_edges=[0], outlet_edges=[2], size=0.001). Coordinates and size are in METERS; polygon vertices ordered around its boundary; edge i joins point i to point (i+1)%N. This creates real STEP CAD and converts first-order triangular Gmsh cells into a genuine Fluent mesh with inlet/outlet/walls. Then solver.settings.file.read_mesh(file_name=mesh["mesh_file"]), solver.settings.mesh.check(), configure physics, initialize, iterate, and export_results. Save current case/data before replacing loaded geometry. Do not reuse a model from previous successful construction during a repair; use its mesh_file from feedback. For curved planar CAD, use fluentagi.geometry_mesh(directory=task_directory,code=gmsh_script_string); the worker has gmsh,math,output_dir already, no imports; create OCC geometry and physical line groups named inlet,outlet,walls (or independent inlet-name/outlet-name/wall-name groups), export STEP, generate first-order triangular or quadrilateral mesh(2). Returned mesh_file is Fluent format; gmsh-native.msh is NOT Fluent format. 3D modeling and volume mesh conversion are now implemented. fluentagi.build_volume(directory=task_directory, shape="box",length=0.1,width=0.02,height=0.02,size=0.005,mesh_type="tet") creates tetrahedra; mesh_type="hex" creates a structured all-hexahedron box. shape="cylinder",radius=0.01 supports tetrahedra with axis along +X. Inlet is X=0 and outlet X=length. fluentagi.build_extruded(directory=task_directory,points=[[x,y],...],inlet_edges=[0],outlet_edges=[2],depth=0.01,size=0.002,mesh_type="tet") extrudes a planar profile, naming lateral inlet/outlet faces; front/back faces are walls. mesh_type="hex-dominant" uses recombined extruded mesh and MAY include prisms: assess returned cell_types, never call mixed cells pure hex. geometry_mesh supports arbitrary OCC volumes (boolean unions/cuts), physical SURFACE groups inlet/outlet/walls or independent inlet-name/outlet-name/wall-name groups, and mesh.generate(3), first-order tet/hex/prism/pyramid. Imported STEP is not currently supported by the restricted worker. build_planar mesh_type="quad" produces mapped pure quadrilaterals for valid four-sided rectangles; complex polygons can be quad/tri mixed. 2D uses triangles/quads, 3D uses tet/hex. The runtime starts or safely backs up its owned solver before switching dimension according to explicit user words. Do not request user-supplied 3D mesh for supported geometry. Save backups before replacing any loaded mesh. For 3D postprocessing create useful cut planes/isosurfaces using verified settings APIs; boundary-only contours are not an interior volume visualization. For an entire new analysis, carry out all stages rather than only inspection; collect real residual/convergence evidence and exports.
For water-air transient filling, call fluentagi.configure_water_air(directory=task_directory,velocity=0.05,time_step=0.001,gravity_y=-9.81,inlet="inlet",outlet="outlet"). This backs up and sets laminar VOF, materials, phase-aware inlet/outlet, gravity and timestep; does NOT initialize or erase existing solution. For requested NEW filling use fluentagi.initialize_air(directory=task_directory), which saves a backup, hybrid initializes and patches phase-2 volume fraction to zero across all fluid cell zones. Never initialize_air on existing results without an explicit restart request. Fluent v242 contour fields are phase-2-vof (water, only after confirming phase-2=water-liquid) and phase-1-vof (air); do not confuse them. Query real contour field.allowed_values for VOF fields. For 3D interior contours/animation use section=fluentagi.create_section(axis="z",position=depth/2), then export_results(...,surfaces=[section["surface"]]) or record_animation(...,surfaces=[section["surface"]]). A plane section is not full volumetric rendering; report it accurately. Frames are 2..60. Each frame after the first advances steps_per_frame real time steps; final time is initial time+(frames-1)*steps_per_frame*time_step. Do not claim the pipe fills if the simulated duration is too short. Normalize typos like "二维四面体" by explaining 2D triangular equivalent; if depth/3D was explicitly requested, use volume tools.
For UNSTEADY dust motion use the separate transient DPM adapters, never track_particles (steady replay). build_dust_box(directory=task_directory) creates a 3D 40mm box with a top cylindrical nozzle (axis Y, inlet at top blowing DOWN with positive normal inlet speed) and an upper side pressure vent. Save existing case before reading its mesh_file. geometry parameters are SI and can be passed as named arguments. Choose suitable air physics; configure a real pressure outlet, do not create a sealed box with uncompensated inflow. configure_transient_dust(directory=task_directory,region_min=[.012,.003,.012],region_max=[.028,.004,.028],counts=[2,2,2],release_time=.02,release_duration=.0005,total_mass=1e-8,diameter=[1e-5,5e-5]*4,density=2500,initial_velocity=[0,0,0],gravity=[0,-9.81,0],time_step=.004,wall_behavior="trap") enables actual unsteady air and one-way unsteady DPM. It creates one short native injection pulse for each seed; total_mass kg is distributed across weighted parcels. It accepts explicit points instead of a region. The entire release pulse must fit inside one physical dt. Does NOT initialize. For requested NEW cases only, initialize_transient_dust(directory=task_directory) refuses any existing valid solution. Then advance_transient_dust(directory=task_directory,until_time=.2,max_iter_per_step=200,residual_tolerance=.001) advances at most 60 actual steps per call, preferring an ABSOLUTE end time; read returned final_time and call again until target. Already reached until_time does not advance again. The small demonstration explicitly uses normalized residual tolerance .001; honor stricter user requirements and never silently relax them. The default adapter tolerance is 1e-5, which the coarse benchmark did NOT meet on its initial step. Failed per-step convergence/air mass balance/particle accounting stops with needs_review and a checkpoint; never claim success. read_transient_dust(directory=task_directory) reads actual current native particle positions, fates, masses and physical time without advancement. resume_transient_dust(directory=task_directory,checkpoint="latest-checkpoint.json") backs up current case, validates hashes, restores native Case/Data including particles, and verifies actual state; never initializes. read_transient_dust_results(directory=task_directory) reads saved files offline. On continuation reuse the ORIGINAL batch directory from execution feedback for read/resume/advance; do not create another configuration merely because the desktop has a new task directory. Native output remains with the original case, while preview PNG/GIF/CSV are mirrored into the current desktop task for real-time display. Every frame is a snapshot of native transient particles, not a steady trajectory interpolation. Report deposited/trapped, escaped, in-domain, incomplete, aborted and not-yet-released parcels and actual mass budget. Caption all runs "预先释放悬浮颗粒,非积尘再悬浮". Particle seeds/markers represent weighted parcels, not physical particle counts or true point size. Laminar transport shows resolved advection/settling; do not claim stochastic turbulent diffusion is modeled. No verified deposited-dust detachment/adhesion/UDF resuspension adapter exists. Never add an upward initial velocity and call it resuspension. Preserve steady DPM as a distinct path.
For EXPLICITLY STEADY dilute solid dust ONLY use the verified v242 one-way STEADY DPM adapters, not VOF. First inspect_dpm(). On a single-phase carrier first create_dust_injection with the required density (default 2500 kg/m3) to activate actual inert materials, THEN configure_dpm(directory=task_directory,density=2500,material="agi-dust",max_steps=10000) verifies the inert material density and sets tracking limit; never use solid CAD material. The v242 inert material container has an unreliable active flag/get_state; adapters enumerate named material children and read those real states instead. Never query the entire inert material container. create_dust_injection(directory=task_directory,name="dust",start=[0.00001,0.003,0.01],end=[0.00001,0.017,0.01],streams=12,diameter=0.00005,mass_flow=0.0000001,velocity=[0.5,0,0],material="agi-dust") creates a real group injection. Replace positions with points just INSIDE the actual inlet; SI meters, diameter meters, mass_flow TOTAL kg/s (adapter divides over streams). streams=1 creates a single injection; group uses a release line between start/end. Do not use surface injection; its v242 settings readback failed validation. set_particle_boundaries(directory=task_directory,boundaries={"inlet":"escape","outlet":"escape","walls":"trap"}) also supports reflect with existing restitution settings; always inspect readback. Never silently change an existing multiphase or coupled DPM model. For a requested NEW analysis, configure and solve the AIR carrier first (laminar only for suitable low Reynolds), then track_particles(directory=task_directory,injections=["dust"],frames=30). This tracks native DPM trajectories, exports tracks.csv/json, native summary text, statistics and PNG/GIF. It does NOT initialize or advance the carrier. Animation is a residence-time replay of native STEADY particle tracks with simultaneous release, not a transient fluid/DPM calculation. Never use air pathlines or a continuous-phase contour as dust motion. Returned counts refer to particle streams, not physical dust counts; rates use reported mass flow. Report incomplete/aborted streams, mass/count balance and carrier convergence separately. A successful track/image is not validated collection efficiency; require mesh/physics validation for engineering conclusions. Preserve results; use a new injection name if its parameters change.
End with Chinese explanation of the intended changes, without claiming execution success.
If essential input or an incompatible session prevents a valid script, return only the specific missing input in Chinese.
After the desktop returns execution results, either provide a corrected script or return only a Chinese assessment supported by those results. Do not execute the same successful script again. Successful execution alone does not prove convergence.
Previous conversation and execution context (reference only; do not repeat successful scripts):
[{"user": "你好,请使用动网格做一个经典的二维仿真案例,要求给出动画计算量不要太大。"}]
Runtime capabilities:
{"protocol": "FluentAGI-capabilities-v1", "session": {"connected": true, "mode": "launch"}, "geometry": {"worker": "gmsh isolated process", "imports": [], "builtins": ["range", "len", "int", "float", "str", "list", "tuple", "enumerate", "zip", "min", "max", "abs", "round", "RuntimeError", "ValueError", "print", "set", "sum", "sorted", "bool", "all", "any"], "physical_groups": ["inlet[-name]", "outlet[-name]", "wall[-name]", "walls"], "independent_boundary_zones": true, "mesh_cell_limit": 2000000, "geometry_timeout_seconds": 3600, "cell_types": ["triangle", "quadrilateral", "tetrahedron", "hexahedron", "prism", "pyramid"]}, "script": {"imports": ["math", "json", "itertools", "functools", "collections", "dataclasses", "typing"], "adapters": ["configure_dynamic_mesh", "inspect_dynamic_mesh", "prepare_moving_circle", "initialize_moving_body", "read_moving_body", "resume_moving_body", "advance_moving_body", "compare_moving_pressure", "build_dust_box", "configure_transient_dust", "initialize_transient_dust", "read_transient_dust", "advance_transient_dust", "resume_transient_dust", "read_transient_dust_results", "inspect_dpm", "configure_dpm", "create_dust_injection", "set_particle_boundaries", "track_particles", "build_planar", "build_volume", "build_extruded", "geometry_mesh", "configure_water_air", "initialize_air", "record_animation", "export_results", "assign_phase_materials", "assign_multiphase_materials", "configure_three_phase_materials", "audit_multiphase_interfaces", "configure_evaporation_condensation", "inspect_phase_change", "configure_surface_tension", "inspect_surface_tension"]}, "generated_at": 1792390139.8139367, "phase_change": {"version": "v242", "model": "Lee", "adapter_multiphase_models": ["vof"], "mixture_officially_available": true, "mixture_adapter_validated": false, "two_phase_2d_correction_runtime_validation": "pending", "automatic_model_switch": false, "phases": [2, 3], "saturation": "constant K", "frequencies": "positive finite 1/s", "mass_transfer_pairs": 1, "internal_official_tui": true, "generated_direct_tui": false, "readback": "unique case snapshot", "initializes": false}, "dynamic_mesh": {"versions": ["v242", "v252"], "scope": "2D planar pure triangles, prescribed +X rigid translation; smoothing + local remeshing", "v242_native_validation": "real moving geometry and pressure patches; see shipped validation log", "v252_native_validation": "not installed locally; official generated SDK checked, each customer setup requires native case readback", "motion_is_real": true, "settings_receipt": "dynamic-mesh.json and unique Case snapshot", "continuation": "actual live time first; paired SHA256 Case/Data; never automatic initialization/replay", "chunk_steps": 50, "retry_safety": "absolute until_time", "unsupported": ["6DOF", "contact/collision", "rotation", "3D/quad remeshing", "hanging-node adaptation"], "pressure_patches": "three moving wall arcs, not volumetric pressure probes"}, "connection_recovery": {"mcp_tool": "recover_session", "python_adapter": false, "desktop_button": true, "original_endpoint_only": true, "automatically_replays_failed_operations": false, "initializes": false, "progress_readback": ["flow_time", "time_step"]}, "surface_tension": {"version": "v242/v252", "runtime_validation": {"v242": "previous native validation", "v252": "official command and generated SDK checked; customer runtime readback required"}, "model": "VOF", "coefficient": "nonnegative finite N/m", "preserves_other_pairs": true, "readback": "unique case snapshot", "initializes": false}, "transient_dpm": {"version": "v242", "model": "unsteady single-phase carrier + transient one-way inert DPM", "release": "one short native pulse per explicit point / region grid, max 64 weighted parcels", "chunk_steps": 60, "positions": "native current positions at actual physical time; never steady replay", "checkpoint": "unique Case/Data plus SHA256 and particle-state readback", "acceptance": "each-step residuals, native air mass flux, particle mass/count fate closure", "default_residual_tolerance": 1e-05, "benchmark_residual_tolerance": 0.001, "strict_1e_5_initial_step_validated": false, "resuspension_validated": false, "stochastic_turbulent_dispersion_validated": false}, "dpm": {"version": "v242", "carrier": "single phase, one-way, steady inert dust", "injection_types": ["single", "group"], "surface_injection_validated": false, "boundary_types": ["reflect", "trap", "escape"], "trajectory_source": "native GetParticleTracksField RPC", "animation": "steady DPM trajectory residence-time replay, no carrier advance", "transient_dpm_validated": false, "two_way_validated": false, "readback": true, "active": false}, "fluent_version": "Ansys Fluent 2024 R2", "model_active": false}
Current session:
{"connected": true, "dimension": 2, "mode": "solver", "owned": true, "continuation": false}
Task directory:
C:\Users\13977\AppData\Local\FluentAGI\data\runs\20261019-140836-a95f99
Current request:
你好,请使用动网格做一个经典的二维仿真案例,要求给出动画计算量不要太大。
【ChatGPT 回复】
ChatGPT 说:
采用二维圆柱在静水中平移的动网格案例:圆柱直径 60 mm,平滑启动至 0.1 m/s,目标计算 2.2 s;使用三角网格、平滑和局部重划分,分批检查收敛并输出动画。
```python
# Use the existing connected PyFluent variable solver.
import json
task_directory = r"C:\Users\13977\AppData\Local\FluentAGI\data\runs\20261019-140836-a95f99"
case_directory = task_directory
end_time = 2.2
time_step = 0.005
def checked(stage, result):
print(stage)
print(result)
value = result
if isinstance(value, str):
try:
value = json.loads(value)
except ValueError:
raise RuntimeError("Adapter feedback is not structured; inspect output before continuing.")
def inspect(item):
if isinstance(item, dict):
status = str(item.get("status", "")).strip().lower()
if status in (
"needs_review", "error", "failed", "failure",
"timeout", "interrupted", "aborted"
):
raise RuntimeError("Stopped at " + stage + ": " + status)
if item.get("needs_review") is True:
raise RuntimeError("Native feedback requires review at " + stage)
if item.get("success") is False or item.get("ok") is False:
raise RuntimeError("Adapter reported failure at " + stage)
for key, child in item.items():
if key in ("error", "errors") and child:
raise RuntimeError("Adapter reported errors at " + stage)
if isinstance(child, (dict, list, tuple)):
inspect(child)
elif isinstance(item, (list, tuple)):
for child in item:
inspect(child)
if not isinstance(value, (dict, list, tuple)):
raise RuntimeError("Missing structured feedback at " + stage)
inspect(value)
return value
def reported_time(state):
if isinstance(state, dict):
for key in ("flow_time", "final_time"):
value = state.get(key)
if isinstance(value, (int, float)) and not isinstance(value, bool):
return float(value)
return None
prepared = checked(
"PREPARE_MOVING_CIRCLE",
fluentagi.prepare_moving_circle(
directory=case_directory,
include_target=False,
body_diameter=0.06,
target_diameter=0.04,
speed=0.1,
ramp_time=0.4,
end_time=end_time,
time_step=time_step,
size=0.012
)
)
checked(
"INSPECT_NATIVE_DYNAMIC_MESH",
fluentagi.inspect_dynamic_mesh(directory=case_directory)
)
checked(
"INITIALIZE_NEW_CASE_ONCE",
fluentagi.initialize_moving_body(directory=case_directory)
)
state = checked(
"READ_INITIAL_NATIVE_STATE",
fluentagi.read_moving_body(directory=case_directory)
)
for chunk in range(9):
previous_time = reported_time(state)
if previous_time is not None and previous_time >= end_time - 1e-9:
break
checked(
"ADVANCE_CHUNK_" + str(chunk + 1),
fluentagi.advance_moving_body(
directory=case_directory,
steps=50,
until_time=end_time,
max_iter_per_step=100
)
)
state = checked(
"READ_NATIVE_STATE_" + str(chunk + 1),
fluentagi.read_moving_body(directory=case_directory)
)
current_time = reported_time(state)
if previous_time is not None and current_time is not None:
if current_time <= previous_time and current_time < end_time - 1e-9:
raise RuntimeError("No verified time advancement; inspect native state before continuing.")
if current_time is not None and current_time >= end_time - 1e-9:
break
final_time = reported_time(state)
print("FINAL_NATIVE_STATE")
print(state)
if final_time is not None and final_time < end_time - 1e-9:
raise RuntimeError("Target time was not reached; preserve the current solution and inspect feedback.")
checked(
"FINAL_NATIVE_DYNAMIC_MESH",
fluentagi.inspect_dynamic_mesh(directory=case_directory)
)
checked(
"EXPORT_FINAL_FIELDS",
fluentagi.export_results(
directory=case_directory,
fields=["pressure", "velocity-magnitude"]
)
)
```
脚本将建立真实平移动网格,分批计算并由适配器输出 PNG/GIF、三个运动壁面弧段的平均压力记录及 Case/Data 检查点。遇到需复核或错误反馈即停止,保留当前解;动画生成、实际计算时长及收敛情况以桌面执行反馈为准。该粗网格案例用于演示,尚未进行网格无关性验证。
round-02
【发送给 ChatGPT】
You are FluentAGI for Ansys Fluent. Write one short Chinese plan, then a single COMPLETE Python script in this exact Markdown layout:
```python
# Use the existing connected PyFluent variable solver.
# Continue with the complete executable script here.
```
Put a newline before and after each tag and each fence. Put no prose, headings, units, or explanations inside the fenced Python block. Do not place ```python and Python statements on the same line. Keep the script under 280 lines. Use loops instead of repeating similar statements. Never truncate a string, parenthesis, or code fence; always close .
Use the existing solver session and compatible PyFluent APIs. For a reported transport loss the DESKTOP/MCP lifecycle tool recover_session reconnects only the original process and reports actual flow_time/time_step. It is NOT a fluentagi Python adapter: never call fluentagi.recover_session or a bare recover_session in generated Python. The desktop attempts recovery automatically; if unavailable ask the user to click the sidebar recovery button. Never replay a failed mesh adaptation, initialization or calculation blindly: it may have partly completed. Do not automatically reload case/data after a recovered connection; preserve the actual live solution. A recovered connection is not proof the preceding operation succeeded. A completed conversation turn does not close the session. For continuation requests reuse the loaded mesh and solution, inspect relevant current settings, and continue from actual flow time. Never launch, disconnect, remesh or initialize merely because a new desktop task directory was created. Do not launch or close Fluent. Do not use Abaqus APIs. Use solver.settings APIs and the provided fluentagi adapters. Direct solver.tui, execute_tui and Scheme remain rejected; the trusted v242 adapters may internally use fixed official TUI commands/journals. For mesh display use solver.settings.results.graphics.mesh and graphics.views APIs. Do not return JSON tool plans. Do not invent mesh files or API names. Only operate on the requested case and task directory. Preserve existing results. For a repair, inspect partially applied state and write a complete corrected script, not a patch or a repeated broken script.
For prescribed 2D circular carrier motion in quiescent water, Fluent 2024 R2 AND 2025 R2 are accepted by the new dynamic-mesh adapters; do not ask a 2024 user to switch to 2025. Use fluentagi.prepare_moving_circle(directory=case_directory, include_target=True, body_diameter=0.06, target_diameter=0.04, speed=0.1, ramp_time=0.4, end_time=2.2, time_step=0.005, size=0.012). It creates real CAD/triangles, native motion profile, smoothing and remeshing, and three moving wall arcs at -45/0/+45 degrees; no initialization. NEW analysis may explicitly set replace_loaded_model=True after backup. Only once, initialize_moving_body(directory=case_directory); it refuses existing initialized data. Continue with read_moving_body / resume_moving_body (default no reload) and advance_moving_body(directory=case_directory, steps=50, until_time=2.2, max_iter_per_step=100). Each call advances at most 50 actual steps and never past the absolute end; repeat only after reading real feedback, stopping on needs_review. Default requires per-step residual convergence. It exports native three-patch pressure CSV, PNG/GIF and paired Case/Data checkpoints. On timeout, inspect actual time and task state first; never reinitialize or replay blindly. restore_checkpoint=True is explicit recovery after backup, not the default. For paired cases use separate with/without directories and compare_moving_pressure(directory=...,with_target_directory=...,without_target_directory=...). Reuse existing case directories from conversation context for follow-ups. The pressure patches are moving WALL arc area averages, not arbitrary moving fluid-volume probe regions; ask for a supported measurement definition if a different one is essential. Existing planar triangular wall zones can use configure_dynamic_mesh(directory=...,zones=[...],speed=0.1,ramp_time=0.4,duration=2.2,min_length=0.001,max_length=0.03,max_skew=0.85); no geometry replacement/init/advance. inspect_dynamic_mesh reads actual native configuration/time and checks saved receipt. Unsupported here: rotation, 6DOF/contact, 3D/quad remeshing, hanging-node adaptation. Do not invent support. v252 commands are SDK-checked, native verification is required in customer execution; never claim v252 native testing from v242 results. A successful dynamic setup, real displacement or exported curves does not establish physically accurate or grid-independent pressure predictions.
The web AI cannot read or modify host application source. Do not claim to have searched the host disk or request uploading FluentAGI source to run simulations. Use the verified runtime adapters. Define task_directory as the absolute Task directory below before calling adapters. For VOF surface tension use fluentagi.configure_surface_tension(directory=task_directory,coefficient=0.072,phase_a="phase-1",phase_b="phase-2"); coefficient is N/m, replace the example with the requested value. This v242/v252 surface-tension adapter preserves other phase pairs, enables the surface-tension model and reads back every coefficient. inspect_surface_tension(directory=task_directory) returns actual state. Fluent 2025 R2 is accepted for this surface-tension adapter; do not ask to downgrade to 2024. Other Lee/DPM adapters retain their own version restrictions. Never claim v252 execution was validated before reading actual results. Do not ask the user to edit the plugin or click GUI dialogs for this supported operation.
Mixture and VOF both support Lee evaporation-condensation in official Fluent 2024 R2, but this runtime has NOT validated a Mixture configuration adapter. Do not silently substitute VOF for a Mixture tutorial or claim equivalent results. audit_multiphase_interfaces() is a read-only native settings probe, without TUI, Scheme or case writes. The VOF adapter uses narrowly scoped prompt profiles; unsupported dimension/phase combinations are rejected rather than guessed. For three-phase boiling setup in Fluent 2024 R2, use fluentagi.configure_three_phase_materials(directory=task_directory, materials=["air", "water-liquid", "water-vapor"]) to create actual phase-1/2/3 domains and verify material assignments. For an existing three-phase model, fluentagi.assign_multiphase_materials(materials=[...], directory=task_directory) assigns materials without changing the phase count. Then call fluentagi.configure_evaporation_condensation(directory=task_directory, saturation_temperature=T_sat_K, evaporation_frequency=from_frequency_per_second, condensation_frequency=to_frequency_per_second, from_phase="phase-2", to_phase="phase-3"). Pass the user's specified temperature/frequencies; preserve their geometry, heating and calculation parameters. This verified v242 VOF Lee adapter enables energy, uses a fixed official TUI journal and verifies the phase pair, constant saturation temperature, both frequencies and Lee model by an independent case snapshot. It does not initialize or advance the simulation. Do not say this feature is unavailable because direct TUI is forbidden; use the adapter. fluentagi.inspect_phase_change(directory=task_directory) returns actual phases and mass transfer settings, refreshing a unique case snapshot. Do not replace existing unrelated mechanisms. This adapter supports one Lee mass transfer pair, not Eulerian wall boiling, semi-mechanistic wall boiling, pressure-dependent saturation tables or UDFs. Do not claim a complete validated boiling simulation from successful setup alone. initialize_air is a TWO-PHASE adapter; do not use it for three-phase cases. Use verified settings initialization and phase-aware patching only for requested new calculations.
The runtime provides fluentagi.assign_phase_materials(primary="air", secondary="water-liquid", directory=task_directory), fluentagi.inspect_phases(), and fluentagi.export_results(directory=task_directory, fields=["pressure", "velocity-magnitude"]). For requested animation of an already initialized transient solution use fluentagi.record_animation(directory=task_directory, field="velocity-magnitude", frames=10, steps_per_frame=1, max_iter_per_step=20); it advances the solution and creates PNG frames and GIF. Never initialize or advance an existing solution without the user requesting calculation. These are executable verified adapters, not prose instructions. Use the phase adapter when asked to assign materials; do not ask the user to click the phase dialog. Print returned results. For postprocessing use export_results and assess its errors; never claim missing images were saved. Only import math/json/itertools/functools/collections/dataclasses/typing; datetime/os/pathlib imports are unavailable. Check is_active() before querying model-dependent settings on an empty mesh.
Mesh conversion preserves independent inlet-name/outlet-name/wall-name boundary zones (for example wall-wing and wall-ground). Read the configured mesh_cell_limit from runtime capabilities; never assume a 200000-cell limit or silently coarsen user geometry. Independent wall zones do not automatically set moving-wall physics or force reports; inspect real settings before configuring those. For NEW planar geometry and meshing use mesh = fluentagi.build_planar(directory=task_directory, points=[[x,y],...], inlet_edges=[0], outlet_edges=[2], size=0.001). Coordinates and size are in METERS; polygon vertices ordered around its boundary; edge i joins point i to point (i+1)%N. This creates real STEP CAD and converts first-order triangular Gmsh cells into a genuine Fluent mesh with inlet/outlet/walls. Then solver.settings.file.read_mesh(file_name=mesh["mesh_file"]), solver.settings.mesh.check(), configure physics, initialize, iterate, and export_results. Save current case/data before replacing loaded geometry. Do not reuse a model from previous successful construction during a repair; use its mesh_file from feedback. For curved planar CAD, use fluentagi.geometry_mesh(directory=task_directory,code=gmsh_script_string); the worker has gmsh,math,output_dir already, no imports; create OCC geometry and physical line groups named inlet,outlet,walls (or independent inlet-name/outlet-name/wall-name groups), export STEP, generate first-order triangular or quadrilateral mesh(2). Returned mesh_file is Fluent format; gmsh-native.msh is NOT Fluent format. 3D modeling and volume mesh conversion are now implemented. fluentagi.build_volume(directory=task_directory, shape="box",length=0.1,width=0.02,height=0.02,size=0.005,mesh_type="tet") creates tetrahedra; mesh_type="hex" creates a structured all-hexahedron box. shape="cylinder",radius=0.01 supports tetrahedra with axis along +X. Inlet is X=0 and outlet X=length. fluentagi.build_extruded(directory=task_directory,points=[[x,y],...],inlet_edges=[0],outlet_edges=[2],depth=0.01,size=0.002,mesh_type="tet") extrudes a planar profile, naming lateral inlet/outlet faces; front/back faces are walls. mesh_type="hex-dominant" uses recombined extruded mesh and MAY include prisms: assess returned cell_types, never call mixed cells pure hex. geometry_mesh supports arbitrary OCC volumes (boolean unions/cuts), physical SURFACE groups inlet/outlet/walls or independent inlet-name/outlet-name/wall-name groups, and mesh.generate(3), first-order tet/hex/prism/pyramid. Imported STEP is not currently supported by the restricted worker. build_planar mesh_type="quad" produces mapped pure quadrilaterals for valid four-sided rectangles; complex polygons can be quad/tri mixed. 2D uses triangles/quads, 3D uses tet/hex. The runtime starts or safely backs up its owned solver before switching dimension according to explicit user words. Do not request user-supplied 3D mesh for supported geometry. Save backups before replacing any loaded mesh. For 3D postprocessing create useful cut planes/isosurfaces using verified settings APIs; boundary-only contours are not an interior volume visualization. For an entire new analysis, carry out all stages rather than only inspection; collect real residual/convergence evidence and exports.
For water-air transient filling, call fluentagi.configure_water_air(directory=task_directory,velocity=0.05,time_step=0.001,gravity_y=-9.81,inlet="inlet",outlet="outlet"). This backs up and sets laminar VOF, materials, phase-aware inlet/outlet, gravity and timestep; does NOT initialize or erase existing solution. For requested NEW filling use fluentagi.initialize_air(directory=task_directory), which saves a backup, hybrid initializes and patches phase-2 volume fraction to zero across all fluid cell zones. Never initialize_air on existing results without an explicit restart request. Fluent v242 contour fields are phase-2-vof (water, only after confirming phase-2=water-liquid) and phase-1-vof (air); do not confuse them. Query real contour field.allowed_values for VOF fields. For 3D interior contours/animation use section=fluentagi.create_section(axis="z",position=depth/2), then export_results(...,surfaces=[section["surface"]]) or record_animation(...,surfaces=[section["surface"]]). A plane section is not full volumetric rendering; report it accurately. Frames are 2..60. Each frame after the first advances steps_per_frame real time steps; final time is initial time+(frames-1)*steps_per_frame*time_step. Do not claim the pipe fills if the simulated duration is too short. Normalize typos like "二维四面体" by explaining 2D triangular equivalent; if depth/3D was explicitly requested, use volume tools.
For UNSTEADY dust motion use the separate transient DPM adapters, never track_particles (steady replay). build_dust_box(directory=task_directory) creates a 3D 40mm box with a top cylindrical nozzle (axis Y, inlet at top blowing DOWN with positive normal inlet speed) and an upper side pressure vent. Save existing case before reading its mesh_file. geometry parameters are SI and can be passed as named arguments. Choose suitable air physics; configure a real pressure outlet, do not create a sealed box with uncompensated inflow. configure_transient_dust(directory=task_directory,region_min=[.012,.003,.012],region_max=[.028,.004,.028],counts=[2,2,2],release_time=.02,release_duration=.0005,total_mass=1e-8,diameter=[1e-5,5e-5]*4,density=2500,initial_velocity=[0,0,0],gravity=[0,-9.81,0],time_step=.004,wall_behavior="trap") enables actual unsteady air and one-way unsteady DPM. It creates one short native injection pulse for each seed; total_mass kg is distributed across weighted parcels. It accepts explicit points instead of a region. The entire release pulse must fit inside one physical dt. Does NOT initialize. For requested NEW cases only, initialize_transient_dust(directory=task_directory) refuses any existing valid solution. Then advance_transient_dust(directory=task_directory,until_time=.2,max_iter_per_step=200,residual_tolerance=.001) advances at most 60 actual steps per call, preferring an ABSOLUTE end time; read returned final_time and call again until target. Already reached until_time does not advance again. The small demonstration explicitly uses normalized residual tolerance .001; honor stricter user requirements and never silently relax them. The default adapter tolerance is 1e-5, which the coarse benchmark did NOT meet on its initial step. Failed per-step convergence/air mass balance/particle accounting stops with needs_review and a checkpoint; never claim success. read_transient_dust(directory=task_directory) reads actual current native particle positions, fates, masses and physical time without advancement. resume_transient_dust(directory=task_directory,checkpoint="latest-checkpoint.json") backs up current case, validates hashes, restores native Case/Data including particles, and verifies actual state; never initializes. read_transient_dust_results(directory=task_directory) reads saved files offline. On continuation reuse the ORIGINAL batch directory from execution feedback for read/resume/advance; do not create another configuration merely because the desktop has a new task directory. Native output remains with the original case, while preview PNG/GIF/CSV are mirrored into the current desktop task for real-time display. Every frame is a snapshot of native transient particles, not a steady trajectory interpolation. Report deposited/trapped, escaped, in-domain, incomplete, aborted and not-yet-released parcels and actual mass budget. Caption all runs "预先释放悬浮颗粒,非积尘再悬浮". Particle seeds/markers represent weighted parcels, not physical particle counts or true point size. Laminar transport shows resolved advection/settling; do not claim stochastic turbulent diffusion is modeled. No verified deposited-dust detachment/adhesion/UDF resuspension adapter exists. Never add an upward initial velocity and call it resuspension. Preserve steady DPM as a distinct path.
For EXPLICITLY STEADY dilute solid dust ONLY use the verified v242 one-way STEADY DPM adapters, not VOF. First inspect_dpm(). On a single-phase carrier first create_dust_injection with the required density (default 2500 kg/m3) to activate actual inert materials, THEN configure_dpm(directory=task_directory,density=2500,material="agi-dust",max_steps=10000) verifies the inert material density and sets tracking limit; never use solid CAD material. The v242 inert material container has an unreliable active flag/get_state; adapters enumerate named material children and read those real states instead. Never query the entire inert material container. create_dust_injection(directory=task_directory,name="dust",start=[0.00001,0.003,0.01],end=[0.00001,0.017,0.01],streams=12,diameter=0.00005,mass_flow=0.0000001,velocity=[0.5,0,0],material="agi-dust") creates a real group injection. Replace positions with points just INSIDE the actual inlet; SI meters, diameter meters, mass_flow TOTAL kg/s (adapter divides over streams). streams=1 creates a single injection; group uses a release line between start/end. Do not use surface injection; its v242 settings readback failed validation. set_particle_boundaries(directory=task_directory,boundaries={"inlet":"escape","outlet":"escape","walls":"trap"}) also supports reflect with existing restitution settings; always inspect readback. Never silently change an existing multiphase or coupled DPM model. For a requested NEW analysis, configure and solve the AIR carrier first (laminar only for suitable low Reynolds), then track_particles(directory=task_directory,injections=["dust"],frames=30). This tracks native DPM trajectories, exports tracks.csv/json, native summary text, statistics and PNG/GIF. It does NOT initialize or advance the carrier. Animation is a residence-time replay of native STEADY particle tracks with simultaneous release, not a transient fluid/DPM calculation. Never use air pathlines or a continuous-phase contour as dust motion. Returned counts refer to particle streams, not physical dust counts; rates use reported mass flow. Report incomplete/aborted streams, mass/count balance and carrier convergence separately. A successful track/image is not validated collection efficiency; require mesh/physics validation for engineering conclusions. Preserve results; use a new injection name if its parameters change.
End with Chinese explanation of the intended changes, without claiming execution success.
If essential input or an incompatible session prevents a valid script, return only the specific missing input in Chinese.
After the desktop returns execution results, either provide a corrected script or return only a Chinese assessment supported by those results. Do not execute the same successful script again. Successful execution alone does not prove convergence.
Previous conversation and execution context (reference only; do not repeat successful scripts):
[{"user": "你好,请使用动网格做一个经典的二维仿真案例,要求给出动画计算量不要太大。"}, {"tool": "run_code", "result": "{\"status\": \"ok\", \"stdout\": \"Note: Rank = 0: Process affinity not being set (6).\\nReading \\\"C:\\\\Users\\\\13977\\\\AppData\\\\Local\\\\FluentAGI\\\\data\\\\runs\\\\20261019-140836-a95f99\\\\cad-1723e845\\\\fluent.msh\\\"...\\nBuffering for file scan...\\n\\n 3421 nodes.\\n 6605 mixed cells, zone 2.\\n 9789 2D interior faces, zone 3.\\n 34 2D velocity-inlet faces, zone 4.\\n 34 2D pressure-outlet faces, zone 5.\\n 16 2D wall faces, zone 6.\\n 150 2D wall faces, zone 7.\\n 1 2D wall \n…中间日志已省略,完整日志保存在任务目录…\nity-magnitude.png'], 'errors': [], 'convergence_verified': False}\\n\", \"stderr\": \"ansys\\\\fluent\\\\core\\\\services\\\\field_data.py:276: PyFluentDeprecationWarning: This usage is deprecated and will be removed in a future release. Please use 'field_data.surfaces()' instead\\n warnings.warn(\\nansys\\\\fluent\\\\core\\\\services\\\\field_data.py:398: PyFluentDeprecationWarning: Function 'get_surface_data' is deprecated since version v0.34.0. Use 'get_field_data' instead.\\n return self._field_data_accessor(*args, **kwargs)\\nansys\\\\fluent\\\\core\\\\services\\\\field_data.py:398: PyFluentDeprecationWarning: Function 'get_surface_data' is deprecated since version v0.34.0. Use 'get_field_data' instead.\\n return self._field_data_accessor(*args, **kwargs)\\nansys\\\\fluent\\\\core\\\\services\\\\field_data.py:398: PyFluentDeprecationWarning: Function 'get_surface_data' is deprecated since version v0.34.0. Use 'get_field_data' instead.\\n return self._field_data_accessor(*args, **kwargs)\\n\", \"return_value\": {\"status\": \"ok\", \"directory\": \"C:\\\\Users\\\\13977\\\\AppData\\\\Local\\\\FluentAGI\\\\data\\\\runs\\\\20261019-140836-a95f99\\\\post-142430-1905\", \"created\": \"2026-10-19T14:24:30.737246\", \"files\": [\"mesh.png\", \"pressure.png\", \"residual.csv\", \"result-sf-1-t-6.sf\", \"result-sf-2-t-8.sf\", \"result-sf-3-t-9.sf\", \"result-sf-4-t-10.sf\", \"result-sf-5-t-2.sf\", \"result.cas.h5\", \"result.dat.h5\", \"velocity-magnitude.png\"], \"errors\": [], \"convergence_verified\": false}, \"message\": null, \"error_code\": null, \"warnings\": []}"}]
Runtime capabilities:
{"protocol": "FluentAGI-capabilities-v1", "session": {"connected": true, "mode": "launch"}, "geometry": {"worker": "gmsh isolated process", "imports": [], "builtins": ["range", "len", "int", "float", "str", "list", "tuple", "enumerate", "zip", "min", "max", "abs", "round", "RuntimeError", "ValueError", "print", "set", "sum", "sorted", "bool", "all", "any"], "physical_groups": ["inlet[-name]", "outlet[-name]", "wall[-name]", "walls"], "independent_boundary_zones": true, "mesh_cell_limit": 2000000, "geometry_timeout_seconds": 3600, "cell_types": ["triangle", "quadrilateral", "tetrahedron", "hexahedron", "prism", "pyramid"]}, "script": {"imports": ["math", "json", "itertools", "functools", "collections", "dataclasses", "typing"], "adapters": ["configure_dynamic_mesh", "inspect_dynamic_mesh", "prepare_moving_circle", "initialize_moving_body", "read_moving_body", "resume_moving_body", "advance_moving_body", "compare_moving_pressure", "build_dust_box", "configure_transient_dust", "initialize_transient_dust", "read_transient_dust", "advance_transient_dust", "resume_transient_dust", "read_transient_dust_results", "inspect_dpm", "configure_dpm", "create_dust_injection", "set_particle_boundaries", "track_particles", "build_planar", "build_volume", "build_extruded", "geometry_mesh", "configure_water_air", "initialize_air", "record_animation", "export_results", "assign_phase_materials", "assign_multiphase_materials", "configure_three_phase_materials", "audit_multiphase_interfaces", "configure_evaporation_condensation", "inspect_phase_change", "configure_surface_tension", "inspect_surface_tension"]}, "generated_at": 1792390139.8139367, "phase_change": {"version": "v242", "model": "Lee", "adapter_multiphase_models": ["vof"], "mixture_officially_available": true, "mixture_adapter_validated": false, "two_phase_2d_correction_runtime_validation": "pending", "automatic_model_switch": false, "phases": [2, 3], "saturation": "constant K", "frequencies": "positive finite 1/s", "mass_transfer_pairs": 1, "internal_official_tui": true, "generated_direct_tui": false, "readback": "unique case snapshot", "initializes": false}, "dynamic_mesh": {"versions": ["v242", "v252"], "scope": "2D planar pure triangles, prescribed +X rigid translation; smoothing + local remeshing", "v242_native_validation": "real moving geometry and pressure patches; see shipped validation log", "v252_native_validation": "not installed locally; official generated SDK checked, each customer setup requires native case readback", "motion_is_real": true, "settings_receipt": "dynamic-mesh.json and unique Case snapshot", "continuation": "actual live time first; paired SHA256 Case/Data; never automatic initialization/replay", "chunk_steps": 50, "retry_safety": "absolute until_time", "unsupported": ["6DOF", "contact/collision", "rotation", "3D/quad remeshing", "hanging-node adaptation"], "pressure_patches": "three moving wall arcs, not volumetric pressure probes"}, "connection_recovery": {"mcp_tool": "recover_session", "python_adapter": false, "desktop_button": true, "original_endpoint_only": true, "automatically_replays_failed_operations": false, "initializes": false, "progress_readback": ["flow_time", "time_step"]}, "surface_tension": {"version": "v242/v252", "runtime_validation": {"v242": "previous native validation", "v252": "official command and generated SDK checked; customer runtime readback required"}, "model": "VOF", "coefficient": "nonnegative finite N/m", "preserves_other_pairs": true, "readback": "unique case snapshot", "initializes": false}, "transient_dpm": {"version": "v242", "model": "unsteady single-phase carrier + transient one-way inert DPM", "release": "one short native pulse per explicit point / region grid, max 64 weighted parcels", "chunk_steps": 60, "positions": "native current positions at actual physical time; never steady replay", "checkpoint": "unique Case/Data plus SHA256 and particle-state readback", "acceptance": "each-step residuals, native air mass flux, particle mass/count fate closure", "default_residual_tolerance": 1e-05, "benchmark_residual_tolerance": 0.001, "strict_1e_5_initial_step_validated": false, "resuspension_validated": false, "stochastic_turbulent_dispersion_validated": false}, "dpm": {"version": "v242", "carrier": "single phase, one-way, steady inert dust", "injection_types": ["single", "group"], "surface_injection_validated": false, "boundary_types": ["reflect", "trap", "escape"], "trajectory_source": "native GetParticleTracksField RPC", "animation": "steady DPM trajectory residence-time replay, no carrier advance", "transient_dpm_validated": false, "two_way_validated": false, "readback": true, "active": false}, "fluent_version": "Ansys Fluent 2024 R2", "model_active": false}
Current session:
{"connected": true, "dimension": 2, "mode": "solver", "owned": true, "continuation": false}
Task directory:
C:\Users\13977\AppData\Local\FluentAGI\data\runs\20261019-140836-a95f99
Current request:
你好,请使用动网格做一个经典的二维仿真案例,要求给出动画计算量不要太大。
Desktop execution feedback:
[{"action": {"tool": "run_code", "arguments": {"code": "# Use the existing connected PyFluent variable solver.\nimport json\n\ntask_directory = r\"C:\\Users\\13977\\AppData\\Local\\FluentAGI\\data\\runs\\20261019-140836-a95f99\"\ncase_directory = task_directory\nend_time = 2.2\ntime_step = 0.005\n\n\ndef checked(stage, result):\n print(stage)\n print(result)\n value = result\n if isinstance(value, str):\n try:\n value = json.loads(value)\n except ValueError:\n raise RuntimeError(\"Adapter feedback is not structured; inspect output before continuing.\")\n\n def inspect(item):\n if isinstance(item, dict):\n status = str(item.get(\"status\", \"\")).strip().lower()\n if status in (\n \"needs_review\", \"error\", \"failed\", \"failure\",\n \"timeout\", \"interrupted\", \"aborted\"\n ):\n raise RuntimeError(\"Stopped at \" + stage + \": \" + status)\n if item.get(\"needs_review\") is True:\n raise RuntimeError(\"Native feedback requires review at \" + stage)\n if item.get(\"success\") is False or item.get(\"ok\") is False:\n raise RuntimeError(\"Adapter reported failure at \" + stage)\n for key, child in item.items():\n if key in (\"error\", \"errors\") and child:\n raise RuntimeError(\"Adapter reported errors at \" + stage)\n if isinstance(child, (dict, list, tuple)):\n inspect(child)\n elif isinstance(item, (list, tuple)):\n for child in item:\n inspect(child)\n\n if not isinstance(value, (dict, list, tuple)):\n raise RuntimeError(\"Missing structured feedback at \" + stage)\n inspect(value)\n return value\n\n\ndef reported_time(state):\n if isinstance(state, dict):\n for key in (\"flow_time\", \"final_time\"):\n value = state.get(key)\n if isinstance(value, (int, float)) and not isinstance(value, bool):\n return float(value)\n return None\n\n\nprepared = checked(\n \"PREPARE_MOVING_CIRCLE\",\n fluentagi.prepare_moving_circle(\n directory=case_directory,\n include_target=False,\n body_diameter=0.06,\n target_diameter=0.04,\n speed=0.1,\n ramp_time=0.4,\n end_time=end_time,\n time_step=time_step,\n size=0.012\n )\n)\n\nchecked(\n \"INSPECT_NATIVE_DYNAMIC_MESH\",\n fluentagi.inspect_dynamic_mesh(directory=case_directory)\n)\n\nchecked(\n \"INITIALIZE_NEW_CASE_ONCE\",\n fluentagi.initialize_moving_body(directory=case_directory)\n)\n\nstate = checked(\n \"READ_INITIAL_NATIVE_STATE\",\n fluentagi.read_moving_body(directory=case_directory)\n)\n\nfor chunk in range(9):\n previous_time = reported_time(state)\n if previous_time is not None and previous_time >= end_time - 1e-9:\n break\n\n checked(\n \"ADVANCE_CHUNK_\" + str(chunk + 1),\n fluentagi.advance_moving_body(\n directory=case_directory,\n steps=50,\n until_time=end_time,\n max_iter_per_step=100\n )\n )\n\n state = checked(\n \"READ_NATIVE_STATE_\" + str(chunk + 1),\n fluentagi.read_moving_body(directory=case_directory)\n )\n current_time = reported_time(state)\n\n if previous_time is not None and current_time is not None:\n if current_time <= previous_time and current_time < end_time - 1e-9:\n raise RuntimeError(\"No verified time advancement; inspect native state before continuing.\")\n if current_time is not None and current_time >= end_time - 1e-9:\n break\n\nfinal_time = reported_time(state)\nprint(\"FINAL_NATIVE_STATE\")\nprint(state)\nif final_time is not None and final_time < end_time - 1e-9:\n raise RuntimeError(\"Target time was not reached; preserve the current solution and inspect feedback.\")\n\nchecked(\n \"FINAL_NATIVE_DYNAMIC_MESH\",\n fluentagi.inspect_dynamic_mesh(directory=case_directory)\n)\n\nchecked(\n \"EXPORT_FINAL_FIELDS\",\n fluentagi.export_results(\n directory=case_directory,\n fields=[\"pressure\", \"velocity-magnitude\"]\n )\n)"}}, "result": "{\"status\": \"ok\", \"stdout\": \"Note: Rank = 0: Process affinity not being set (6).\\nReading \\\"C:\\\\Users\\\\13977\\\\AppData\\\\Local\\\\FluentAGI\\\\data\\\\runs\\\\20261019-140836-a95f99\\\\cad-1723e845\\\\fluent.msh\\\"...\\nBuffering for file scan...\\n\\n 3421 nodes.\\n 6605 mixed cells, zone 2.\\n 9789 2D interior faces, zone 3.\\n 34 2D velocity-inlet faces, zone 4.\\n 34 2D pressure-outlet faces, zone 5.\\n 16 2D wall faces, zone 6.\\n 150 2D wall faces, zone 7.\\n 1 2D wall faces, zone 8.\\n 1 2D wall faces, zone 9.\\n 1 2D wall faces, zone 10.\\n\\nBuilding...\\n m\n…中间日志已省略,完整日志保存在任务目录…\n: 'agi-motion-e3c4b4ba', 'relative': False, 'exclude_mesh_motion_from_wall_bc': False}, 'wall-probe-3': {'zone_id': 10, 'type': 'rigid-body', 'profile': 'agi-motion-e3c4b4ba', 'relative': False, 'exclude_mesh_motion_from_wall_bc': False}}, 'verified': True, 'topology': {'cells': 6531, 'cell_types': ['triangle'], 'dimension': 2}, 'advances_solution': False}\\n\\nWriting to Austra:\\\"C:\\\\Users\\\\13977\\\\AppData\\\\Local\\\\FluentAGI\\\\data\\\\runs\\\\20261019-140836-a95f99\\\\post-142430-1905\\\\result.cas.h5\\\" in NODE0 mode and compression level 1 ...\\nGrouping cells for Laplace smoothing ...\\n 6531 cells, 1 zone ...\\n 9915 faces, 8 zones ...\\n 3384 nodes, 1 zone ...\\n Done.\\n\\n Writing boundary layer flags ...\\n Done.\\n Writing data for \\\"agi-motion-e3c4b4ba\\\" profile.\\nDone.\\n\\nWriting to Austra:\\\"C:\\\\Users\\\\13977\\\\AppData\\\\Local\\\\FluentAGI\\\\data\\\\runs\\\\20261019-140836-a95f99\\\\post-142430-1905\\\\result.dat.h5\\\" in NODE0 mode and compression level 1 ...\\n Writing results.\\nDone.\\nEXPORT_FINAL_FIELDS\\n{'status': 'ok', 'directory': 'C:\\\\\\\\Users\\\\\\\\13977\\\\\\\\AppData\\\\\\\\Local\\\\\\\\FluentAGI\\\\\\\\data\\\\\\\\runs\\\\\\\\20261019-140836-a95f99\\\\\\\\post-142430-1905', 'created': '2026-10-19T14:24:30.737246', 'files': ['mesh.png', 'pressure.png', 'residual.csv', 'result-sf-1-t-6.sf', 'result-sf-2-t-8.sf', 'result-sf-3-t-9.sf', 'result-sf-4-t-10.sf', 'result-sf-5-t-2.sf', 'result.cas.h5', 'result.dat.h5', 'velocity-magnitude.png'], 'errors': [], 'convergence_verified': False}\\n{'status': 'ok', 'directory': 'C:\\\\\\\\Users\\\\\\\\13977\\\\\\\\AppData\\\\\\\\Local\\\\\\\\FluentAGI\\\\\\\\data\\\\\\\\runs\\\\\\\\20261019-140836-a95f99\\\\\\\\post-142430-1905', 'created': '2026-10-19T14:24:30.737246', 'files': ['mesh.png', 'pressure.png', 'residual.csv', 'result-sf-1-t-6.sf', 'result-sf-2-t-8.sf', 'result-sf-3-t-9.sf', 'result-sf-4-t-10.sf', 'result-sf-5-t-2.sf', 'result.cas.h5', 'result.dat.h5', 'velocity-magnitude.png'], 'errors': [], 'convergence_verified': False}\\n\", \"stderr\": \"ansys\\\\fluent\\\\core\\\\services\\\\field_data.py:276: PyFluentDeprecationWarning: This usage is deprecated and will be removed in a future release. Please use 'field_data.surfaces()' instead\\n warnings.warn(\\nansys\\\\fluent\\\\core\\\\services\\\\field_data.py:398: PyFluentDeprecationWarning: Function 'get_surface_data' is deprecated since version v0.34.0. Use 'get_field_data' instead.\\n return self._field_data_accessor(*args, **kwargs)\\nansys\\\\fluent\\\\core\\\\services\\\\field_data.py:398: PyFluentDeprecationWarning: Function 'get_surface_data' is deprecated since version v0.34.0. Use 'get_field_data' instead.\\n return self._field_data_accessor(*args, **kwargs)\\nansys\\\\fluent\\\\core\\\\services\\\\field_data.py:398: PyFluentDeprecationWarning: Function 'get_surface_data' is deprecated since version v0.34.0. Use 'get_field_data' instead.\\n return self._field_data_accessor(*args, **kwargs)\\n\", \"return_value\": {\"status\": \"ok\", \"directory\": \"C:\\\\Users\\\\13977\\\\AppData\\\\Local\\\\FluentAGI\\\\data\\\\runs\\\\20261019-140836-a95f99\\\\post-142430-1905\", \"created\": \"2026-10-19T14:24:30.737246\", \"files\": [\"mesh.png\", \"pressure.png\", \"residual.csv\", \"result-sf-1-t-6.sf\", \"result-sf-2-t-8.sf\", \"result-sf-3-t-9.sf\", \"result-sf-4-t-10.sf\", \"result-sf-5-t-2.sf\", \"result.cas.h5\", \"result.dat.h5\", \"velocity-magnitude.png\"], \"errors\": [], \"convergence_verified\": false}, \"message\": null, \"error_code\": null, \"warnings\": []}"}]
【ChatGPT 回复】