|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 7 ![]() |
Hi everybody,
i need a UDF for the time-step in which i have to assign 3 different time-steps at 3 different levels, respectively: from 0 to 1s ---> TS=0.01 from 1s to 3s---> TS=0.004 from 3s to end---> TS=0.1 I tried this way but it didn't work Code:
#include "udf.h"
DEFINE_DELTAT(ts, d)
{
real time_step;
real flow_time = CURRENT_TIME;
if (flow_time < 1)
time_step = 0.01;
if (flow_time > 3)
time_step = 0.1;
else
time_step = 0.004;
return time_step;
}
|
|
|
|
|
|
|
|
|
#2 |
|
New Member
Join Date: Sep 2020
Posts: 8
Rep Power: 7 ![]() |
Try this:
Code:
DEFINE_DELTAT(ts, d)
{
real time_step;
real flow_time = RP_Get_Real("flow-time");
#if PARALLEL
host_to_node_real_1(flow_time);
#endif
if (flow_time < 1.0)
{
time_step = 0.01;
}
else if (flow_time > 3)
{
time_step = 0.1;
}
else
{
time_step = 0.004;
}
return time_step;
}
|
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend" | bigphil | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 686 | December 22, 2022 10:10 |
| time step continuity problem in VAWT simulation | lpz_michele | OpenFOAM Running, Solving & CFD | 5 | February 22, 2018 20:50 |
| Stuck in a Rut- interDyMFoam! | xoitx | OpenFOAM Running, Solving & CFD | 14 | March 25, 2016 08:09 |
| Floating point exception error | lpz_michele | OpenFOAM Running, Solving & CFD | 53 | October 19, 2015 03:50 |
| calling result of a UDF into current time step | Komon | Fluent UDF and Scheme Programming | 1 | April 1, 2012 20:53 |