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

how to convert c file into udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 11, 2014, 03:11
Default how to convert c file into udf
  #1
New Member
 
N.Ramchander
Join Date: Apr 2014
Posts: 6
Rep Power: 12
ramchander is on a distinguished road
hi,
i have a C file and want to change into udf file,so that i want to use it in fluent .please give some suggestions how to change it.

C file:

#include<stdio.h>
#include<conio.h>
int main()
{
int x=0,temp=0,t;
printf("enter t value");
scanf("%d",t);
if(t>=90 && t<=180);
{
x=t-90;
temp=1533-x*7;
printf("temperature %d",temp);
}
else
{
printf("tempearture you given not satisfy %d",temp);
}
getch();
}
ramchander is offline   Reply With Quote

Old   April 11, 2014, 08:23
Default
  #2
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
ghost82 will become famous soon enough
Be more specific; is it to apply as a profile?
your program requests input values given by user..
What is t?time, space??
ghost82 is offline   Reply With Quote

Old   April 11, 2014, 10:14
Default convert c file to udf
  #3
New Member
 
N.Ramchander
Join Date: Apr 2014
Posts: 6
Rep Power: 12
ramchander is on a distinguished road
"t" represents angle
as the t value changing from 90 to 180, temperature varies as mathematical form like (1533-x*7),
when t=90 then x=0,
when t=91 then x=1, and so on.......
here as the t (angle) changes from 90 to 180 the temperature decreases from 1533 to 903.
ramchander is offline   Reply With Quote

Old   April 11, 2014, 10:19
Default
  #4
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
ghost82 will become famous soon enough
post a picture of your domain with sizes, describe your case problem and if you want to use the udf as a boundary condition.
ghost82 is offline   Reply With Quote

Old   April 17, 2014, 04:06
Default
  #5
New Member
 
Jackson Sim
Join Date: Apr 2014
Posts: 7
Rep Power: 12
reformat is on a distinguished road
If your question is how you can convert the c file into udf for fluent, you can either interpret or compiled it. For me, i personally prefer the latter.

Go to Define-->Function-->Compiled
Add the c file into the box on the left, highlight it and click "build".
A list of information will start loading at the bottom screen of your mesh.
Look out for words with "error" or "warning", there are lines stated where the error occurs. Do correct them and "build" the c file again. Once all the errors have been cleared, load the ::libudf file
reformat is offline   Reply With Quote

Reply


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
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 03:30
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 01:22
patch error OF v2.2.2 mac hewei OpenFOAM Installation 4 November 30, 2013 16:55
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 13:59
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 11:46


All times are GMT -4. The time now is 03:11.