Fluids

Fluids

UDF to define properties in terms of energy and pressure instead of temperature and pressure

    • zbharris
      Subscriber

      Hello,

      I am trying to use the UDRGM UDF in Fluent to implement custom EOS and property formulations, and I would like to define properties in terms of internal energy or enthalpy instead of temperature for a two species mixture. I know the DEFINE_PROPERTY UDFs allow for reference to cell properties and appear to be able to use any value that can be called from a cell in the formulation, but I need specific heat and enthalpy, which must be defined using the DEFINE_SPECIFIC_HEAT function, to include a pressure term, which does not appear possible because DEFINE_SPECIFIC_HEAT only supplies temperature and mixture fraction, and appears to set the values for the whole array of cells at once, meaning that other properties don’t seem to be accessible on a per-cell basis within the DEFINE_SPECIFIC HEAT function.

      In the UDRGM, cell indices are unavailable as far as I can tell because only pressure, temperature, and mixture fraction values are passed to each property function.

      I would also like to understand the respective internal processes for finding the temperature value after the energy equation is solved when the UDRGM or the DEFINE_PROPERTY functions are used.

      Thank you for your help.

    • DrAmine
      Ansys Employee
      In UDRGM cell thread access is supported and you are able there to access whatever you want.
    • zbharris
      Subscriber
      In UDRGM, how would I know the index of the cell to reference in the individual functions that define properties? For instance, in
      double MIXTURE_density(cxboolean vapor_phase, double Temp, double P, double yi[])
      where the density is defined in terms of temperature, pressure, and mixture fraction, if I call
      C_H(c,t)
      within the function, how do I define values for c and t?
      Also, when UDRGM is used, how does Fluent solve for the temperature value internally after the energy equation is solved? I would prefer to access the internal energy value from the energy equation directly in the property equations, but I only see enthalpy listed in the cell flow macro options. I'm afraid Fluent will use the enthalpy and density relationships with respect to temperature and pressure, along with the energy value, to find the temperature, then use the same enthalpy relationship to find the value that will be returned when I call C_H(c,t). I would prefer to have the direct energy value from the energy equation because temperature may not have an appreciable gradient with enthalpy or internal energy.
      Thanks
Viewing 2 reply threads
  • You must be logged in to reply to this topic.