|
[Sponsors] |
UDF-define a vector of velocity for velocity inlet |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 28, 2016, 13:07 |
UDF-define a vector of velocity for velocity inlet
|
#1 |
New Member
|
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; } |
|
Tags |
udf, vector of velocity |
|
|
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 |