|
[Sponsors] |
October 14, 2023, 09:04 |
Make FLUENT stop calculations automatically
|
#1 |
New Member
Join Date: Oct 2023
Posts: 3
Rep Power: 3 |
Hello everyone, I combined udf and scheme to make FLUENT automatically stop calculating when the wall temperature and pressure reach conditions. But it is not possible to realize it.here is my code with many references. thank you
Code:
#include "udf.h" #include "math.h" #include "var.h" DEFINE_ADJUST(interrupt_1, d) { cell_t cell; Thread* thread; Domain* domain; real temp, pressure, NV_VEC(dist); int ID = 12; face_t f; Thread* t; cell_t c0, c1; domain = Get_Domain(1); thread = Lookup_Thread(domain, ID); begin_f_loop(f, thread) { c0 = F_C0(f, thread); c1 = F_C1(f, thread); if (THREAD_ID(thread) == ID) { t = THREAD_T0(thread); if (c0 != -1) { temp = C_T(c0, t); pressure = C_P(c0, t); if (temp > 250.0 && pressure > 140) { RP_Set_Integer("interrupt/flag",5); Message("Temperature exceeds 2500K and Pressure exceeds 1.4MPa. Stopping simulation...\n"); } } } } end_f_loop(f, thread) } Code:
(rp-var-define 'interrupt/flag 0 'integer #f) (define (interrupt-end-of-timestep) (if (> (%rpgetvar 'interrupt/flag) 0) (begin (cx-interrupt-end-of-timestep)))) |
|
October 16, 2023, 01:18 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
cx-interrupt, scheme, stop simulation, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blastFoam] BlastFoam Question | alimea | OpenFOAM Community Contributions | 17 | January 28, 2023 11:50 |
how to run fluent from matlab without using aas toolbox? | artemis96 | ANSYS | 7 | May 23, 2022 13:16 |
How To Make MATLAB Apps For Fluent | behest | FLUENT | 0 | March 3, 2014 08:00 |
problem in using parallel process in fluent 14 | aydinkabir88 | FLUENT | 1 | July 10, 2013 03:00 |
2D Vs 3D VOF Fluent calculations | sachinthakre | FLUENT | 0 | February 5, 2013 12:35 |