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/)
-   -   Ohmic Heater Tutorial (https://www.cfd-online.com/Forums/fluent-udf/123141-ohmic-heater-tutorial.html)

pmtgt September 5, 2013 06:22

Ohmic Heater Tutorial
 
Hi,

I found an old fluent tutorial on the web which would be useful for my studies but no source code for the UDF. Does anyone have a copy?

http://cfd.iut.ac.ir/files/ohmic_heater.pdf

Many Thanks
Tom

ghost82 September 5, 2013 12:57

Here:

Code:

#include "udf.h"
#define electric_potential 0

/******************************************************************************************
  This UDF calculates the heat generated due to the Joule heating.
  This head generated is added as volumetric source term in the energy equation
********************************************************************************************/


DEFINE_SOURCE(Energy_Source, c, t, dS, eqn)
{
 real NV_VEC(CURRENT_DENSITY);
 real Source_Joule,Source;


/******************************************************************************************
  Fluent has some utilities that can be use in UDFs to access or manipulate vector
  quantities and deal with two and three dimensions. These utilities are implemented
  as macros in the code. For more details about this utilities please refer section
  6.6 of Fluent6.2 User Guide: http://www.fluentusers.com/fluent/doc/ori/html/udf/node161.htm
********************************************************************************************/

  Source_Joule = 0.0;

    NV_VS(CURRENT_DENSITY, =, C_UDSI_G(c, t, electric_potential), *,
                      C_UDSI_DIFF(c, t, electric_potential));

    NV_VS(CURRENT_DENSITY, =, CURRENT_DENSITY,*, -1);

    if(C_UDSI_DIFF(c, t, electric_potential) > 1e-6)
      {
        Source_Joule = NV_DOT(CURRENT_DENSITY, CURRENT_DENSITY)/
                        C_UDSI_DIFF(c, t, electric_potential);

                        C_UDMI(c,t,electric_potential) = Source_Joule;
      }

  Source = Source_Joule;

 dS[eqn] = 0.0;

 return Source;
}


gaza January 26, 2016 04:05

Quote:

Originally Posted by ghost82 (Post 450107)
Here:

Code:

#include "udf.h"
#define electric_potential 0

/******************************************************************************************
  This UDF calculates the heat generated due to the Joule heating.
  This head generated is added as volumetric source term in the energy equation
********************************************************************************************/


DEFINE_SOURCE(Energy_Source, c, t, dS, eqn)
{
 real NV_VEC(CURRENT_DENSITY);
 real Source_Joule,Source;


/******************************************************************************************
  Fluent has some utilities that can be use in UDFs to access or manipulate vector
  quantities and deal with two and three dimensions. These utilities are implemented
  as macros in the code. For more details about this utilities please refer section
  6.6 of Fluent6.2 User Guide: http://www.fluentusers.com/fluent/doc/ori/html/udf/node161.htm
********************************************************************************************/

  Source_Joule = 0.0;

    NV_VS(CURRENT_DENSITY, =, C_UDSI_G(c, t, electric_potential), *,
                      C_UDSI_DIFF(c, t, electric_potential));

    NV_VS(CURRENT_DENSITY, =, CURRENT_DENSITY,*, -1);

    if(C_UDSI_DIFF(c, t, electric_potential) > 1e-6)
      {
        Source_Joule = NV_DOT(CURRENT_DENSITY, CURRENT_DENSITY)/
                        C_UDSI_DIFF(c, t, electric_potential);

                        C_UDMI(c,t,electric_potential) = Source_Joule;
      }

  Source = Source_Joule;

 dS[eqn] = 0.0;

 return Source;
}


Hi ghost82,

Can you provide the rest of the files from this tutorial?

pmtgt January 26, 2016 04:45

Hi,

I see the original link I posted doesn't work any more for the tutorial. I made my own geometry and mesh with ICEM. If you personal message me your email I'd be happy to send you these files.

Thanks

gaza January 26, 2016 09:46

I wrote to you by PM


All times are GMT -4. The time now is 01:39.