|
[Sponsors] |
decreasing volume of solid area with time step |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 5, 2019, 02:21 |
decreasing volume of solid area with time step
|
#1 |
New Member
Mohammad
Join Date: Jul 2015
Posts: 7
Rep Power: 10 |
hello
I'm new in udf so please help me to learn i want to reform a solid domain with time step in 2D which my fluid area is a 16*16 mm Square and my solid domain is 2*2 Square in middle of fluid area. so i want to reform to decreasing solid area volume with time step. this is my udf but i think there is some problems, my code doesn't compile in fluent. i want to read every cell in every time step and decrease voulume of all cells of domain. thanks for your help. #include "udf.h" DEFINE_GEOM(solid,domain,dt,position) { real vol,vol2; Domain *domain; Thread *c_thread; thread_loop_c(c_thread, domain) /*loops over all cell threads in domain*/ { cell_t c; Thread*t; vol=C_VOLUME(c,t); if (vol<=0) vol2=0; if (vol>0) vol2=vol-0.01*vol; position[0]=vol2; } position[1]=position[0]; } |
|
October 15, 2019, 07:50 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
#include "udf.h" DEFINE_GEOM(solid,domain,dt,position) { real vol,vol2; cell_t c; Thread *t = DT_THREAD (dt); thread_loop_c(t, domain) /*loops over all cell threads in domain*/ { begin_c_loop(c, t) { vol=C_VOLUME(c,t); if (vol<=0) vol2=0; if (vol>0) vol2=vol-0.01*vol; position[0]=vol2; } end_c_loop(c, t); } position[1]=position[0]; }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
October 15, 2019, 13:41 |
|
#3 | |
New Member
Mohammad
Join Date: Jul 2015
Posts: 7
Rep Power: 10 |
Quote:
Thanks for your reply i'm wonder how can i change the code for reading all faces area in a cell groups and changing those faces area. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field | lakeat | OpenFOAM Community Contributions | 58 | December 23, 2021 02:36 |
LES, Courant Number, Crash, Sudden | Alhasan | OpenFOAM Running, Solving & CFD | 5 | November 22, 2019 02:05 |
Micro Scale Pore, icoFoam | gooya_kabir | OpenFOAM Running, Solving & CFD | 2 | November 2, 2013 13:58 |
plot over time | fferroni | OpenFOAM Post-Processing | 7 | June 8, 2012 07:56 |
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 | bookie56 | OpenFOAM Installation | 8 | August 13, 2011 04:03 |