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

Divergence when using UDF for PVT Tait model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 16, 2016, 04:50
Default Divergence when using UDF for PVT Tait model
  #1
Senior Member
 
Jordi Pina
Join Date: Mar 2015
Posts: 157
Rep Power: 11
jpina is on a distinguished road
Dear all,

I'm modeling a polymer flow, whose density is temperature and pressure dependance and, moreover, has a discontinuity in the density in the melting point. The graphic looks like this:



The UDF compiles and loads successfully and is the following:

#include "udf.h"
#include<string.h>
#include<stdio.h>
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
#include <nrutil.h>

DEFINE_PROPERTY(cell_pvt2,cell,thread)
{
real T = C_T(cell, thread);
real P = C_P(cell,thread);
real B;
real V;
real V0;
real rho;
real B1s=8.54e-4;
real B2s=1.59e-7;
real B3s=2.99e8;
real B4s=1.71e-3;
real B1l=8.54e-4;
real B2l=5.62e-7;
real B3l=1.83e8;
real B4l=3.99e-3;
real Tg=144+273;

if (T>Tg) {
V0=B1l+B2l*(T-Tg);
B=B3l*exp(-B4l*(T-Tg));
}
else{
V0=B1s+B2s*(T-Tg);
B=B3s*exp(-B4s*(T-Tg));
}

V=V0*(1-0.0894*log(1+P/B));

rho=1/V;

if (P > 0.0001)
{
return rho;
}
else{
return 1000;
}
}

However, in the second iteration I give divergence problems and a floating point exception.

I'm modeling the inlet of a polymer into a cavity filled with air, having a 0 atm outlet and a pressure inlet that pushes the polymer.

I have tried the UDF without having the two regions but happens the same. I have tried different solvers and relaxing the UDF without success.

Somebody has a hint?

Thanks al ot!
jpina 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
UDF for Multiphase euilerian model pibea FLUENT 3 April 30, 2024 02:25
EMMS drag model UDF NAD Fluent UDF and Scheme Programming 26 November 19, 2017 08:49
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 07:12
UDF fails to model 9.81m/s^2 gravity jpo Fluent UDF and Scheme Programming 2 January 24, 2012 19:15
UDF of Zimont model in fluent Z Main CFD Forum 0 February 17, 2005 04:07


All times are GMT -4. The time now is 18:15.