CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF Initialize temperature in solid objects

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2019, 05:20
Default UDF Initialize temperature in solid objects
  #1
New Member
 
Sérgio Cavaleiro Costa
Join Date: Nov 2017
Location: Lisbon, Portugal
Posts: 12
Rep Power: 9
sergiocavaleirocosta is on a distinguished road
Hi all,
In the Workbench I have created a fluid domain and 5 solid domains independently and merged all to a fluent. All solids are immersed in the fluid and linked using the mesh interface. Inside solids, I only want to solve heat conduction. I would like to initialize them with different temperatures without using the patch way. My code so far is the following:

Code:
#include "udf.h"

DEFINE_INIT(initMaterial, domain)
{
  cell_t c;
  Thread *t1 = Lookup_Thread(domain, 77);
  Thread *t2 = Lookup_Thread(domain, 74);
  Thread *t3 = Lookup_Thread(domain, 71);
  Thread *t4 = Lookup_Thread(domain, 68);
  Thread *t5 = Lookup_Thread(domain, 65);
   
  /*----------------body 1 -----------------*/
  thread_loop_c (t, domain)
  {
	  /* loop over all cells  */
	  begin_c_loop (c, t)
        {
		  C_T(c, t) = 500.;
        }
      end_c_loop (c, t)
   }
  
  /*----------------body 2 -----------------*/
    thread_loop_c (t2, domain)
	{
      begin_c_loop (c, t2)
        {
		  C_T(c, t2) = 600.;
        }
      end_c_loop (c, t2)
    }

	/*----------------body 3 -----------------*/
  thread_loop_c (t3, domain)
    {
      begin_c_loop (c, t3)
        {
		  C_T(c, t3) = 700.;
        }
      end_c_loop (c, t3)
    }
	
  /*----------------body 4 ----------------- */
  thread_loop_c (t4, domain)
    {
      begin_c_loop (c, t4)
        {
		  C_T(c, t4) = 800.;
        }
      end_c_loop (c, t4)
    }
	
	/*----------------body 5 -----------------*/
  
  thread_loop_c (t5, domain)
    {
      begin_c_loop (c, t5)
        {
		  C_T(c, t5) = 900.;
        }
      end_c_loop (c, t5)
    }
	
}
I have hooked the UDF in initialization, I manage to compile and initialize without any issues but when I check temperatures with isolines they don't match with the ones I want.

Can anyone help me? I have been searching for something similar but everything in my code looks logical and can't figure out I is it being ignored.
Thank you all for your help.
sergiocavaleirocosta is offline   Reply With Quote

Reply

Tags
fluid, initialisation, solid, temperature, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlet temperature to temperature boundary condition of velocity inlet. (UDF) dillon Fluent UDF and Scheme Programming 3 March 25, 2018 12:06
UDF to modify inlet fluid temperature Vipul_Patel Fluent UDF and Scheme Programming 0 February 22, 2016 22:11
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 05:39
Help please! UDF for Temperature profile in 3D subhankar_bhandari Fluent UDF and Scheme Programming 2 August 16, 2010 09:37
CFX4.3 -build analysis form Chie Min CFX 5 July 13, 2001 00:19


All times are GMT -4. The time now is 12:00.