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

Strange error - UDF wall BC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 14, 2014, 04:25
Default Strange error - UDF wall BC
  #1
New Member
 
Tom
Join Date: Mar 2014
Posts: 19
Rep Power: 12
blowback is on a distinguished road
When I compile below function for steady-state simulation, everything is fine. In case of transient simulation I got an error message when journal file set up wall BC with heat flux on it.

After this command:
/def/boundary/wall selection 0 n 0 n n y y "udf" "p1::libudf" n n n n 0 n 0
I got an error (only if transient is set up) - errorlog in enclosed file
HTML Code:
http://sendfile.pl/194535/fluenterror.log
Code:
#include "udf.h"
#include <math.h>
#define Vp 0.815
#define Vk 0.20375
#define dT 3.0
int Npts = 99 ; 
float *mean_power;

float get_q( int i)
{
  float ydata;
  ydata = mean_power[i];
  return ydata;
}
DEFINE_ON_DEMAND(read_mean_power)
{
int i=0;
  FILE* plik;
  plik = fopen("moce99.dat","r");
  mean_power = (float *) malloc(Npts*sizeof(float));
   for ( i=0;i<Npts;i++ )
    {
      fscanf(plik,"%f\n",&mean_power[i]);
    }
  fclose(plik);
}
DEFINE_PROFILE(velocity, ft, var)
{
    real time;
    face_t f;
    time = CURRENT_TIME;
    begin_f_loop(f,ft)
    {
        if (dT>time)
        {
            F_PROFILE(f,ft,var) = Vp - (Vp-Vk)*time/dT;
        }
        else
        {
            F_PROFILE(f,ft,var) = Vk;
        }
    }
    end_f_loop(f,ft)
}

DEFINE_PROFILE(p1, ft, var)
{
    float x[3];
    float z;
    face_t f;
    int i = 0;
    float q0;
q0 = get_q(i);
    
    begin_f_loop(f,ft)
    {
        F_CENTROID(x,f,ft);
        z = x[2];
        F_PROFILE(f,ft,var)= q0*sin(((z-0.231)/0.65)*M_PI);
    }
    end_f_loop(f,ft)
}
...
...
...
DEFINE_PROFILE(p99, ft, var)
{
    float x[3];
    float z;
    face_t f;
    int i = 98;
    float q0;
q0 = get_q(i);
    
    begin_f_loop(f,ft)
    {
        F_CENTROID(x,f,ft);
        z = x[2];
        F_PROFILE(f,ft,var)= q0*sin(((z-0.231)/0.65)*M_PI);
    }
    end_f_loop(f,ft)
}
blowback 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
Natural convection in a closed domain STILL NEEDING help! Yr0gErG FLUENT 4 December 2, 2019 01:04
Very technical question about solving wall boundary layer ... jlb001 FLUENT 6 December 27, 2014 06:56
Is wall ajacent temperature equal to conservative temperature of the wall? shenying0710 CFX 8 January 4, 2013 05:03
UDF for wall slipping HFLUENT Fluent UDF and Scheme Programming 0 April 27, 2011 13:03
Quick Question - Wall Function D.Tandra Main CFD Forum 2 March 16, 2004 05:29


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