a week ago
I am tryng to apply friction factor that I derived from experiment. So, I simply made my code with dynamic library compiler tool. However, I got error 'At t = 1.17571e-010 and step size 1.17571e-29, the corrector repeateldy failed to converge' . How can I revise my code?
{
/** ------------------------------------------------------------------------ **/
/** >>>>>>>>>>>>>>>>>>> INSERT Private Code HERE **/
double pii, tup;
pii = 3.141592;
if (*pa > *pb)
{tup = *taK;}
else
{tup = *tbK;}
double rhoa,rhob,rhoavg;
rhoa = tfrhoid_(nodeIda);
rhob = tfrhoid_(nodeIdb);
rhoavg = (rhoa+rhob)/2;
double mua,mub,muavg;
mua = tfmuid_(nodeIda);
mub = tfmuid_(nodeIdb);
muavg = (mua+mub)/2;
double Re,vel;
vel = *dm/ *area/ rhoavg;
Re = fabs(rhoavg*vel* (*dh)/muavg);
double dff; // darcy friction factor
if (Re <= 1e-5) {dff = 64*1e5;}
else{
dff = 21.48*pow(Re,-0.89)*4;
}
*dm = sign(*dP,*dP) *sqrt((*dP) * (*dh / (*length)) * (2 * rhoavg * pow((*area),2)) / (dff));
/** <<<<<<<<<<<<<<<<<<< END of Private Code **/
/** ------------------------------------------------------------------------ **/
}
Thursday
Thursday
Thursday - last edited Thursday
okay.
my questions are:
1. What does 'corrector converge failed' message mean?
2. What is algorithm that TFPHE model and half heat exchanger model compute inlet pressure from input mass flow rate?
According to manual, they compute mass flow rate from given pressure drop and temperature. However, from my experience, they can compute inlet pressure from given mass flow rate. does Amesim compute this by iteration? If it does so, How can user make a code computing inlet pressure from given mass flow rate ?