|
[Sponsors] |
April 24, 2018, 01:34 |
How to fix value for some cells with UDF
|
#1 |
New Member
Wang Fei-Long
Join Date: Apr 2015
Posts: 9
Rep Power: 11 |
Hi everyone,
I want to use the fixed value function to fix the velocity of some cell (marked as C_UDM=0). Once I used the fixed value function the velocity of whole zone was fixed, not the specified cell. Please somebody help me how to realize it with UDF. Thank you very much. husywfl |
|
April 24, 2018, 01:45 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
How do you define the cell,where you want to fix velocity?
post your code here best regards |
|
April 24, 2018, 14:00 |
|
#3 | |
New Member
Wang Fei-Long
Join Date: Apr 2015
Posts: 9
Rep Power: 11 |
Quote:
Thank you for your reply. My code: DEFINE_ADJUST(adjust_fix,d) { Thread *t; cell_t c; thread_loop_c(t,d) { begin_c_loop_all(c,t) { if (C_UDMI(c,t,0) == 1.) { C_U(c,t) = 0.; C_V(c,t) = 0.; #if RP_3D C_W(c,t) = 0.; #endif } } end_c_loop_all(c,t) } } For example, I want to fix the red zone (Fig.1) marked as UDM=1 with zero velocity, whick means the flow will be blocked. But the results (Fig.2) shows the marked zone still have velocity, and the flow before and after the zone is not effected. Please help me. Thank you. Husywfl |
||
April 24, 2018, 21:42 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
is porous zone is suitable for your simulation?
best regards |
|
October 9, 2020, 09:48 |
|
#5 |
New Member
Join Date: Oct 2019
Posts: 12
Rep Power: 6 |
Dear husywfl,
Would you be able to solve this problem? Do you succeed to specify zero velocity to this specific region? If you, may you share with me how did you do that? Thanks, |
|
March 18, 2021, 10:31 |
|
#6 | |
New Member
Join Date: Mar 2021
Posts: 1
Rep Power: 0 |
I think following macro's
Quote:
In mem.h, they are defined as Code:
#define C_U(c,t)C_STORAGE_R(c,t,SV_U) |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] Error in mesh writing | helios | ANSYS Meshing & Geometry | 21 | August 19, 2021 14:18 |
How to use a UDF to set the volume fraction in the cells next to a wall? | DF15 | Fluent UDF and Scheme Programming | 33 | August 20, 2020 13:36 |
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF | acasas | CFD Freelancers | 1 | January 23, 2015 07:26 |
snappyHexMesh in parallel - FOAM Fatal IO Error | mturcios777 | OpenFOAM Running, Solving & CFD | 4 | August 10, 2012 19:18 |
killed "snappyHexMesh" | parkh32 | OpenFOAM Pre-Processing | 2 | April 8, 2012 17:12 |