-
-
December 8, 2024 at 9:22 pm
sjohn
SubscriberI 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-1Divergence detected in AMG solver: pressure coupledDivergence detected in AMG solver: vof-1Divergence detected in AMG solver: pressure coupledDivergence detected in AMG solver: vof-1Divergence detected in AMG solver: pressure coupledDivergence detected in AMG solver: vof-1Divergence detected in AMG solver: pressure coupledDivergence detected in AMG solver: vof-1Divergence detected in AMG solver: pressure coupledDivergence detected in AMG solver: vof-1Divergence detected in AMG solver: pressure coupledDivergence detected in AMG solver: vof-1Divergence detected in AMG solver: pressure coupledDivergence detected in AMG solver: vof-1Divergence detected in AMG solver: pressure coupledDivergence detected in AMG solver: vof-1Divergence detected in AMG solver: pressure coupledDivergence detected in AMG solver: vof-1Divergence detected in AMG solver: pressure coupledDivergence detected in AMG solver: vof-1Divergence detected in AMG solver: pressure coupledDivergence detected in AMG solver: vof-1Error at host: floating point exceptionÂError: floating point exceptionError 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 exceptionWould 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;} -
December 9, 2024 at 10:25 am
Rob
Forum ModeratorIt's diverging, so the code is grammatically correct. But.... Is your intent to set a material density based on the species or phase fraction in a cell? Have a think about the physics, why would that be the case?Â
-
December 10, 2024 at 1:01 am
sjohn
SubscriberI would like to set the density based on phase fraction because the temperature-dependent density equation is for the phase. Instead of 50%, I could use 100% as the condition to change density as per temperature.
-
December 10, 2024 at 11:39 am
Rob
Forum ModeratorYou're setting the phase density based on the phase fraction. You're not setting the mixture density.Â
-
- You must be logged in to reply to this topic.
- How do I get my hands on Ansys Rocky DEM
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Script Error
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- convergence issue for transonic flow
- Running ANSYS Fluent on a HPC Cluster
- Point exception in erosion calculation
-
1882
-
802
-
599
-
591
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.