-
-
September 23, 2020 at 12:14 pm
lytsophy
SubscriberDear all,nI would like to ask how to define a periodic piecewise function for inlet velocity in UDF.nthe function can be like:nv=f(t), (n=0,1,2,...)n0.07n<=t<0.07n+0.02, v=1n0.07n+0.02<=t<0.07(n+1), v=0nthanks a lot!n -
September 23, 2020 at 2:21 pm
Rob
Forum ModeratorI've done this using a mix of IF statements, sin(t) and floor https://www.programiz.com/cpp-programming/library-function/cmath/floor I'll leave you to work out the maths! n -
September 23, 2020 at 4:01 pm
lytsophy
SubscriberI have solved this problem already~n -
September 23, 2020 at 4:07 pm
Rob
Forum ModeratorExcellent. Please post the solution for others to learn from. n -
September 24, 2020 at 9:11 am
lytsophy
SubscriberThanks a lot!nthe code could be like:n#include udf.hnDEFINE_PROFILE(inlet_velocity,th,i)n{nface_t f;nbegin_f_loop(f,th)nreal t=(CURRENT_TIME-floor(CURRENT_TIME/0.7)*0.7);n{nif(t<0.2)nF_PROFILE(f,th,i)=0.01;nelsenF_PROFILE(f,th,i)=0;n}nend_f_loop(f,th);n}n
-
Viewing 4 reply threads
- The topic ‘How to define a periodic piecewise function for inlet velocity in UDF’ is closed to new replies.
Ansys Innovation Space
Trending discussions
- air flow in and out of computer case
- Varying Bond model parameters to mimic soil particle cohesion/stiction
- Eroded Mass due to Erosion of Soil Particles by Fluids
- I am doing a corona simulation. But particles are not spreading.
- Centrifugal Fan Analysis for Determination of Characteristic Curve
- Guidance needed for Conjugate Heat Transfer Analysis for a 3s3p Li-ion Battery
- Issue to compile a UDF in ANSYS Fluent
- JACOBI Convergence Issue in ANSYS AQWA
- affinity not set
- Resuming SAG Mill Simulation with New Particle Batch in Rocky
Top Contributors
-
3977
-
1461
-
1272
-
1124
-
1021
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.