|
[Sponsors] |
Define time step size with max or min of Temp in a domain |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 17, 2014, 14:33 |
Define time step size with max or min of Temp in a domain
|
#1 |
New Member
hosein
Join Date: Sep 2013
Posts: 16
Rep Power: 13 |
Hi cfd-online
I have a very very sensible unsteady simulation and it must run with small time step size. I want to use DEFINE_DELTAT and set Deltat function of some cell variable in a domain. for example if max Temp < T1 then Deltat=a if max Temp >= T1 then Deltat=b if max Liquid fraction > 0 then Deltat=c . . . is it possible to do that? I think "Looping Over Cell Threads in a Domain (thread_loop_c)" can help me if I use that in DEFINE_DELTAT macro. thank you |
|
December 18, 2014, 06:30 |
|
#2 |
New Member
hosein
Join Date: Sep 2013
Posts: 16
Rep Power: 13 |
my udf is:
Red number is line number in udf commands . Code:
DEFINE_DELTAT(mydeltat, domain) { real time_step; real T_max=0.0 ; real T1=303.0 ; real T2=300.5 ; real T3=304.0 ; Thread t; cell_t c; 54 thread_loop_c(t,domain) { 56 begin_c_loop(c,t) { 58 temp = C_T(c,t); if (temp > T_max || T_max == 0.0) T_max = temp; } end_c_loop(c,t) } if (T_max < T1) time_step = 1.0; else time_step = 0.00001; return time_step; } error after build in compiler window: Done. (chdir "libudf")(chdir "win64\2ddp")# Generating ud_io1.h Paper_PCM_Prop_and_DeltaT_v2.c ..\..\src\Paper_PCM_Prop_and_DeltaT_v2.c(54) : error C2440: '=' : cannot convert from 'thread_struct *' to 'Thread' ..\..\src\Paper_PCM_Prop_and_DeltaT_v2.c(54) : error C2088: '!=' : illegal for struct ..\..\src\Paper_PCM_Prop_and_DeltaT_v2.c(54) : error C2232: '->next' : left operand has 'struct' type, use '.' ..\..\src\Paper_PCM_Prop_and_DeltaT_v2.c(56) : error C2232: '->nelements' : left operand has 'struct' type, use '.' ..\..\src\Paper_PCM_Prop_and_DeltaT_v2.c(58) : error C2232: '->storage' : left operand has 'struct' type, use '.' Done. whats wrong in udf? |
|
December 18, 2014, 06:57 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Instead of making "t" a thread variable, in
Code:
Thread t; Code:
Thread *t; |
|
December 18, 2014, 07:59 |
|
#4 |
New Member
hosein
Join Date: Sep 2013
Posts: 16
Rep Power: 13 |
ok , Its work
|
|
Tags |
define_deltat |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Transient simulation not converging | skabilan | OpenFOAM Running, Solving & CFD | 14 | December 17, 2019 00:12 |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 06:36 |
Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 01:01 |
time step directories naming issue | Andrea_85 | OpenFOAM | 3 | April 3, 2014 09:38 |
Problems in compiling paraview in Suse 10.3 platform | chiven | OpenFOAM Installation | 3 | December 1, 2009 08:21 |