|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Join Date: Oct 2024
Posts: 8
Rep Power: 2 ![]() |
I wrote a UDF to specify density as a function of* temperature for a multi-species, multiphase model. This is the error I get.
* step* flow-time* * *p-inlet * * *0* 0.0000e+00 -1.0553e-14 Updating solution at time level N... *done. * iter* continuity* x-velocity* y-velocity* z-velocity* * * energy* ch44-p* ch3oh-pha* n2-phase-a* co2-phase-* vf-phase-a* * *time/iter * * * * Stabilizing pressure coupled to enhance linear solver robustness. * * * * Stabilizing pressure coupled using GMRES to enhance linear solver robustness. Experiencing convergence difficulties - temporarily relaxing and trying again... Experiencing convergence difficulties - temporarily relaxing and trying again... Experiencing convergence difficulties - temporarily relaxing and trying again... Experiencing convergence difficulties - temporarily relaxing and trying again... * * * * Stabilizing pressure coupled to enhance linear solver robustness. * * * * Stabilizing pressure coupled using GMRES to enhance linear solver robustness. Experiencing convergence difficulties - temporarily relaxing and trying again... Divergence detected in AMG solver: pressure coupled temperature limited to 3.273150e+03 in 387997 cells on zone 1231 in domain 1 * * * * *Stabilizing vof-1 to enhance linear solver robustness. * * * * Stabilizing vof-1 using GMRES to enhance linear solver robustness. Divergence detected in AMG solver: vof-1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: vof-1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: vof-1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: vof-1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: vof-1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: vof-1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: vof-1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: vof-1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: vof-1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: vof-1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: vof-1 Divergence detected in AMG solver: pressure coupled Divergence detected in AMG solver: vof-1 Error at host: floating point exception Error: floating point exception Error Object: () Error at Node 5: floating point exception Error at Node 4: floating point exception Error at Node 6: floating point exception Error at Node 3: floating point exception Error at Node 10: floating point exception Error at Node 7: floating point exception Error at Node 0: floating point exception Error at Node 9: floating point exception Error at Node 8: floating point exception Error at Node 1: floating point exception Error at Node 11: floating point exception Error at Node 2: floating point exception Error: floating point exception Would someone be able to review my UDF (below) and tell me if there is an obvious mistake. #include "udf.h" /* Define the UDF to specify temperature-dependent density */ DEFINE_PROPERTY(temperature_dependent_density, cell, thread) { * * real T;* /* Temperature */ * * real density;* /* Density */ * * real vol_frac;* /* Volume fraction of phase A */ * * /* Loop over all cells in the thread */ * * begin_c_loop(cell, thread) * * { * * * * /* Get the volume fraction of phase A in the cell */ * * * * vol_frac = C_VOF(cell, thread); * * * * /* Check if the volume fraction of phase A is greater than 50% */ * * * * if (vol_frac > 0.5) * * * * { * * * * * * /* Get the temperature of the cell */ * * * * * * T = C_T(cell, thread); * * * * * * /* Calculate the density based on the given relationship */ * * * * * * density = 1.4811 - 0.0007 * T; * * * * * * /* Set the density for the cell */ * * * * * * C_R(cell, thread) = density; * * * * } * * } * * end_c_loop(cell, thread) * * return density; } |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Refik
Join Date: Dec 2014
Location: Turkey
Posts: 65
Rep Power: 12 ![]() |
Hello,
Are you sure you need cell looping in DEFINE_PROPERTY macro? From what i remember it is called for each individual cell and all you have to do is extract arguments (temp, vol fractions etc.) from cell, calculate what you want and assign it. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Chris
Join Date: Mar 2021
Posts: 27
Rep Power: 6 ![]() |
I think you might need to get the pointer for the phase thread you are trying to loop over first. As an example C_VOF(cell,thread) would be C_VOF(cell, liq) or C_VOF(cell, gas) where liq and cell are pointers to the liquid and gas phase cell threads.
|
|
![]() |
![]() |
![]() |
Tags |
density, temperature dependent, udf |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Natural Convection ! Boussinesq Vs Ideal Gas density | cfd_user_pune | ANSYS | 4 | September 15, 2020 09:46 |
temperature dependent density of water in fluent | sahar.mh | Fluent UDF and Scheme Programming | 0 | November 15, 2019 11:00 |
can user define a location dependent density in Define_property udf macro? | Pmaroul | Fluent UDF and Scheme Programming | 2 | January 21, 2019 16:34 |
Setting Density for Velocity Inlet Face | arkie87 | FLUENT | 0 | November 7, 2012 16:15 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 05:41 |