CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Help: ACCESS VIOLATION, strange behaviour (https://www.cfd-online.com/Forums/fluent/102807-help-access-violation-strange-behaviour.html)

ghost82 June 3, 2012 03:55

Help: ACCESS VIOLATION, strange behaviour
 
1 Attachment(s)
Hi all,
I'm noticing a strange behaviour, which I cannot explain to myself: my case is very simple, as you can see from the attached file (3d simulation).

A cylinder with wall as bottom and side surfaces and a pressure outlet at the top.

Next I compiled this udf, which compiles and load fine, to take into accout water compressibility and custom sound speed (directly taken from fluent guide):

Code:

#include "udf.h"

#define BMODULUS 2.2e9
#define rho_ref 998.2
#define p_ref 101325.0
#define p_operating 101325.0

DEFINE_PROPERTY(water_density, c, t)
{
    real rho;
    real p, dp;
   
    p = C_P(c,t) + p_operating;
    dp = p-p_ref;
    rho = rho_ref/(1.0-dp/BMODULUS);
    return rho;
}

DEFINE_PROPERTY(sound_speed, c,t)
{
    real a;
    real p, dp;
   
    p = C_P(c,t) + p_operating;
    dp = p-p_ref;
    a = (1.-dp/BMODULUS)*sqrt(BMODULUS/rho_ref); 
    return a;
}

When I set the simulation parameters everything works fine.

However, if I change the bottom wall boundary condition to inlet velocity or pressure inlet, when setting reference values (computing from inlet), fluent gives an ACCESS VIOLATION error.

I cannot understand why..can anybody help me?

Daniele

PS: I'm using fluent 14.0 with sp1

ghost82 June 3, 2012 05:50

I must initialize before computing reference values from inlet..now it works.
Daniele

fluency October 26, 2012 02:46

URgent
 
HI,

I'm getting the access violation error while trying to initialise my case..
I'm trying to simulate droplet impact on flat surface and ve written an UDF for dynamic contact angle..
the udf is as follows

#include udf.h
#include mem.h
#include metric.h
#define vis 0.001
#define st 0.073
#define theta_adv 105
#define theta_rec 95
DEFINE_PROFILE(dymanic_contact, thread, index)
{
face_t f;
real vcl,b;
begin_f_loop(f, thread)
{
cell_t c0= F_c0(f,thread);
if(C_VOF(c0,thread)==0.5)
vcl= C_V(c0, thread);
}
If(vcl>0)
{
b=0.07133;
ca=vis*vcl/st;
a=ca+b;
F_PROFILE(dynamic_angle,thread,index)=acos(1-(2*tanh(5.16*(a/(1+(1.31*a^0.99)))^0.706)));
}
elseif
{
b=0.05304;
ca=vis*(-vcl)/st;
a=ca+b;
F_PROFILE(dynamic_angle,thread,index)=acos(1-(2*tanh(5.16*(a/(1+(1.31*a^0.99)))^0.706)));
}
}



Kindly help


All times are GMT -4. The time now is 16:56.