CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   [multiphase] C_UDMI in DEFINE_PROPERTY for diameter of secondary phase (https://www.cfd-online.com/Forums/fluent-udf/164021-multiphase-c_udmi-define_property-diameter-secondary-phase.html)

SJSW December 10, 2015 09:11

[multiphase] C_UDMI in DEFINE_PROPERTY for diameter of secondary phase
 
Hi~

I wrote a UDF for diameter used in secondary phase using Eulerian Model.
This model was from the tutorial "Hydrodynamics of Bubble column reactors."
They are all the same except the diameter of the secondary phase was replaced by this UDF.

This UDF could be compiled and no warning like ACCESS_VIOLATION appeared.
I used C_UDMI to record the new diameter calculated in UDF.
Then I tried to show contour of this C_UDMI, but all value is zero all the time.
But the distribution of bubbles are different from that in the tutorial.

Could someone kind to share why the value is zero all the time?

Here is my thought, but I don't know if it is right:
The value is not truly zero.
This C_UDMI truly restore the new diameter value calculated in UDF.
However, the thread of this C_UDMI is for secondary phase.
Since the contour can only show User-defined Memory in primary phase, a C_UDMI for secondary phase could not be displayed.

If my consideration is correct, could it be possible to restore the values of C_UDMI for secondary phase to another C_UDMI for primary phase?

Thanks for your attention, and I hope someone will help this!

SJSW December 12, 2015 12:06

Problem solved.

A formula was involved with a fraction, and I wrote an integer divided by the other integer.
This resulted in an integer "0."
It could be avoided by using "1.0/2" or "1/2.0" .

Another thing is that "cell_t c" and "thread t" in DEFINE_PROFILE and DEFINE_PROPERTY are for the phase to which the UDF was applied.
So usually there is no need to use THREAD_SUPER_THREAD or THREAD_SUB_THREAD.

A strange thing is that when a C_UDMI was used in DEFINE_PROPERTY and assigned to a secondary phase, one could show a contour of this C_UDMI for mixture and the values are correct.
For example, C_UDMI=C_P(c,t). c and t are for a secondary phase, but the contour of this C_UDMI could be shown when choosing "mixture."
In fact, one can only choose "mixture."


All times are GMT -4. The time now is 20:58.