Thanks a lot for your kind patience responding to both my e-mails. I
will do as you recommend and see what I get.
I shall send you the Python wrappers I wrote for the Refprop database shortly.
thanks again,
gani --
P.S. Did you take a look at the math package SAGE
(http://www.sagemath.org/)? It is really great and has won several
acclaims of late. If you have Python wrappers for Ascend there might
be way to pull into SAGE as well.
At 09:42 PM 7/22/2008, you wrote:
Hi Gani
As this is a simple example, I hope you won't mind that I've CCed this
back to the mailing list.
Gani B. Ganapathi wrote:
> Hi John:
>
> I wrote a simple model based on textbook example, and I'm having
> problems with it. Any help in what I'm doing wrong would be appreciated.
> The expected answers are:
> f = 0.019546, Q = 0.207 m3/s, hp = 26.169 m.
Firstly, there was a minor problem with your units assignment in
'default_self' where you had not non-dimensionalised.
Secondly, one of the key advantages of using dimensional variable
declarations is that you get some upper and lower bounds implicitly, for
example a distance must be positive, but a delta_distance can be
positive or negative. So I re-dimensionalised your model back to what,
presumably, you originally had.
Finally, I found that even when these things were fixed, your model
still didn't converge when first loaded. I found that if I first solved
the model for a fixed Q, and then reconfigured the model for fixed H
(see the new equation for net H) and solved again, then it worked
perfectly.
This would suggest that convergence of this particular model is highly
sensitive to the initial values. To make a more robust model for this
problem might require you to reconfigure the friction factor to another
variable, or to rearrange the equation for friction factor so that the
relationship between the residual and the variables is changed. This is
a bit of a trial-and-error thing, usually.
After all this, I managed to make the model converge, but the answers
are not the same are your values, so you will need to investigate that
in more detail. I would expect that there's some problem in the values
or the equations as entered, simply.
Anyway, I attach a revised model that you might like to try. If you work
out what the error in the expected answers is, please let us know.
Cheers
JP
REQUIRE "atoms.a4l";
ATOM kinematic_viscosity REFINES solver_var
DIMENSION L^2/T
DEFAULT 1e-6 {m^2/s};
lower_bound := 0.0 {m^2/s};
upper_bound := 1e50 {m^2/s};
nominal := 1.3 {g/s/m} * 0.001 {m^3/kg};
END kinematic_viscosity;
MODEL gani_flow;
Q IS_A volume_rate;
H, H_pump, H_pipe IS_A delta_distance;
nu IS_A kinematic_viscosity;
e, D, L IS_A distance;
A IS_A area;
f IS_A fraction; (* gives it an upper bound of 1 *)
Re IS_A factor; (* dimensionless, greater than 0 *)
A = 1{PI} * D^2 / 4;
e_on_D IS_A factor;
e_on_D = e/D;
(* Colebrook-White equation for friction factor *)
1./f^0.5 + 2.0*0.434*ln(e/D + 9.35/(Re*f^0.5)) = 1.14;
Re = (Q*D)/(A*nu); (* Reynolds number *)
H_pipe = 75 {ft} + f*(L/D)*Q^2/(2{EARTH_G}*A^2); (* energy
equation based on pumping up 75 ft*)
H_pump = -3.224*Q^2 + 33.293*Q + 24.472; (* text book pump
equation *)
(* at outlet, head should be zero *)
H = H_pump - H_pipe;
METHODS
METHOD on_load;
RUN specify;
RUN values;
RUN default_all;
END on_load;
METHOD specify;
FIX Q, e, D, L, nu;
END specify;
METHOD values;
H := 0 {m};
e := 0.015 {inch};
D := 18 {inch};
L := 6000 {ft};
nu := 0.0000114 {ft^2/s};
END values;
METHOD default_self;
D := 1 {m};
L := 1 {m};
e := 0.015 {inch};
D := 18 {inch};
L := 6000 {ft};
nu := 0.0000114 {ft^2/s};
Q := 0.2 {m^3/s};
END default_self;
METHOD reconfigure;
FREE Q;
FIX H;
H := 0 {m};
END reconfigure;
(* no need for a 'default_all' method, becuase this model
isn't parametric *)
END gani_flow;
Dr. Gani B. Ganapathi
Technical Group Supervisor, Thermal Hardware and Fluids Systems
Engineering Group (3547)
Jet Propulsion Laboratory
4800 Oak Grove Drive Mail Stop 125-224
Pasadena, Ca. 91109-8099
Telephone: 818-354-7449 Cell: (818)-625-5282
Email: [EMAIL PROTECTED]
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ascend-sim-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ascend-sim-users