-
-
September 27, 2017 at 11:19 amadminAnsys Employee
User can set a dummy user defined scalar (do not need to solve that UDS), assign the varible he wants to compute the gradient to that UDS. Then use the following udf: #include "udf.h" DEFINEEXECUTEATEND(myadjust) { Domain *d=GetDomain(1); Thread *t; cellt c; threadloopc(t,d) { begincloop(c,t) CUDSI(c,t,0)=CU(c,t); endcloop(c,t) } AllocStorageVars(d, SVUDSIRG(0), SVUDSIG(0), SVNULL); ScalarReconstruction(d, SVUDSI(0), -1, SVUDSIRG(0), NULL); ScalarDerivatives (d, SVUDSI(0), -1, SVUDSIG(0), SVUDSIRG(0), NULL); threadloopc(t,d) { begincloop(c,t) { CUDMI(c,t,0)=CUDSIG(c,t,0)[0]; CUDMI(c,t,1)=CUDSIG(c,t,0)[1]; CUDMI(c,t,2)=CUDSIG(c,t,0)[2]; } endcloop(c,t) } FreeStorageVars(d,SVUDSIRG(0), SVUDSIG(0), SV_NULL); }
-
September 27, 2017 at 11:19 amadminAnsys Employee
How to compute the derivative of an arbitrary varaible in a FLUENT UDF?
-
- The topic ‘Compute the derivative of an arbitrary varaible in a FLUENT UDF’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Fluent fails with Intel MPI protocol on 2 nodes
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Cyclone (Stairmand) simulation using RSM
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- UDF, Fluent: Access count of iterations for “Steady Statistics”
- RIBBON WINDOW DISAPPEARED
-
1421
-
599
-
591
-
565
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.