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

UDF-define a vector of velocity for velocity inlet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 28, 2016, 13:07
Default UDF-define a vector of velocity for velocity inlet
  #1
New Member
 
masoud meskin
Join Date: Jul 2016
Location: Italy
Posts: 5
Rep Power: 10
masoudmeskin is on a distinguished road
Send a message via AIM to masoudmeskin
Dear all,
I have written a UDF in which i tried to read a vector (which is a velocity vector) and then at every single time step, the fluent pick one of those velocity components from the vector. The size of the vector is 250*1 But when i interpret it, The fluent gives me an error? Is there a problem in my program? is there another easy way to do this? Thank you for your help


#include <cmath>
#include <fstream>
#include <vector>
#include <sstream>
#include <algorithm>

//using namespace std;


int main()
{

double velocity[250];
std::ifstream File ("D:\\masoud\\velocity.txt");

if (File.is_open())
{
int ii=0;
for( ii ; ii < 251 ; ii++)
{
File >> velocity[ii];
//cout<< ii <<" "<< frp[ii] <<endl;
}


}
else
{
cout<<"ERROR";
}

DEFINE_PROFILE(ondaE_A, thread, nv)
{
face_t f;
int curr_ts;
curr_ts = N_TIME;
begin_f_loop (f,thread)
{
F_PROFILE(f,thread,nv) = velocity[curr_ts-1];
}
end_f_loop (f,thread)
}


return 0;
}
masoudmeskin is offline   Reply With Quote

Reply

Tags
udf, vector of velocity


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
Having trouble adapting serial UDF to work in parallel muyuntao Fluent UDF and Scheme Programming 1 November 10, 2015 14:42
UDF to set velocity and pressure in inlet GerardX89 Fluent UDF and Scheme Programming 0 July 16, 2012 11:15
Velocity inlet boundary condition for porous medium Chander CFX 3 March 11, 2012 22:18
UDF problem : inlet velocity in cyl. coord. system Jongdae Kim FLUENT 0 June 15, 2004 12:21
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11


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