July 11, 2021 at 12:09 pmJaydaSubscriber
I created a user defined function for the scattering phase. The UDF requires the scattering phase to be defined via cos(theta) = c. Thus: DEFINE_SCAT_PHASE_FUNC(phi, c, fsf).
However, my phi (phase function) is defined in terms of teta (T) instead of phi:
T = theta = arccos(cos(T)) = arccos(c)
Is this translation from theta to c correct and can I thus use the latter formula for the UDF?
- Does using arccos(c) give a problem, for example when teta = -pi, it will give an irrational number as output? Or is teta defined from 0 to +pi only?
JaydaJuly 12, 2021 at 11:12 amDrAmineAnsys EmployeeNot really related to Ansys Fluent. It is just C/C++ programming. Always take care to avoid Division by 0 or NAN.
July 12, 2021 at 11:55 amKarthik RAdministratorHello In addition to it is always a good practice to use the Message or fprintf statements to print your variables to the console. This will tell you if you are in the right direction or not.
Viewing 2 reply threads
Ansys Innovation Space
- You must be logged in to reply to this topic.
Simulation World 2022
Check out more than 70 different sessions now available on demand. Get inspired as you hear from visionary companies, leading researchers and educators from around the globe on a variety of topics from life-saving improvements in healthcare, to bold new realities of space travel. Take a leap of certainty and check out a session today here.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.Trending discussions
- Suppress Fluent to open with GUI while performing in journal file
- Heat transfer coefficient
- What are the differences between CFX and Fluent?
- Floating point exception in Fluent
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Getting graph and tabular data from result in workbench mechanical
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
Top Rated Tags
© 2022 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.