|
[Sponsors] |
October 11, 2024, 06:13 |
Dynamic mesh by UDF
|
#1 |
New Member
Kevin
Join Date: Oct 2024
Posts: 1
Rep Power: 0 |
Hello everyone,
I am currently working on a project simulating the changes in the etching boundary caused by the etching reaction. I attempted to compile a UDF, load the etchant concentration, and use a dynamic mesh to drive the movement of the etching boundary. While I successfully loaded the UDF, an error occurs, causing Fluent to crash when I start the computation. Below is my UDF code. I am a beginner with UDFs, and I would appreciate any assistance. Thank you. #include "udf.h" DEFINE_GRID_MOTION(etching_deformation, domain, dt, time, dtime) { Thread *tf = DT_THREAD(dt); face_t f; cell_t c; Node *v; real etch_rate, etch_depth, total_etch_depth; real NV_VEC(origin), NV_VEC(etch_dir), NV_VEC(current_pos); real local_concentration; real base_etch_rate = 0.5; int species_index = 0; int n; SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf)); c = F_C0_T(f, tf); local_concentration = C_YI(c, tf, species_index); NV_D(etch_dir, =, 1.0 * local_concentration, 0.5 * (1.0 - local_concentration), 0.0); begin_f_loop(f, tf) { f_node_loop(f, tf, n) { v = F_NODE(f, tf, n); if (NODE_POS_NEED_UPDATE(v)) { NODE_POS_UPDATED(v); etch_rate = base_etch_rate * local_concentration; etch_depth = etch_rate * time; total_etch_depth = etch_rate * (time - dtime); NV_VV(current_pos, =, NODE_COORD(v), -, origin); NV_S(current_pos, +=, etch_depth * NV_DOT(current_pos, etch_dir)); NV_V(NODE_COORD(v), =, current_pos); } } } end_f_loop(f, tf); } |
|
Tags |
dynamic mesh, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
flow over cylinder in openFoam | saeed jamshidi | OpenFOAM Pre-Processing | 3 | August 11, 2023 16:16 |
Dynamic mesh udf for oscillating wall | QBeast | Fluent UDF and Scheme Programming | 3 | December 17, 2020 03:03 |
How to check residuals in UDF for dynamic mesh? | Prikane | FLUENT | 3 | May 8, 2019 10:33 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Problem related with UDF for dynamic mesh | Ryan | FLUENT | 6 | April 29, 2004 10:29 |