(* This is written in the ASCEND Language ... ASCEND is an environment to pose modeling problems and solve the resulting equations in an object oriented fashion ... ASCEND is copyrighted by Carnegie Mellon University ... the project has been directed by Prof. Art Westerberg in the Chemical Engineering Department ...*) (* ASCEND is free software, released under GNU ... and you can get it from http://www.cs.cmu.edu/~ascend ... The software has been released WITH source code ... it compiles under Solaris, Linux and IRIX (SGI) ... thanks to the excellent job in putting the software together by the folks at CMU! ... and autoconf ... I have no idea of how people compiled things before ./configure ! *) (* This example written by Krishnan Chittur (chitturk@uah.edu) Chemical Engineering Department, University of Alabama in Huntsville, Huntsville, AL 35899 (205) 890 6850 (V), (205) 890 6839 (FAX) *) (* See how easy it is to calculate Reynolds Number - or any other dimensionless number --- you can mix/match units very well, ascend takes care of it for you ... THAT MAY BE BAD sometimes, so use it carefully ... you better know what the heck you are doing - in this example, change feet to cm or meters or whatever - ASCEND will convert everything to SI units by default - you can choose any set of units ofcourse *) (* velocity IS_A speed - speed is defined in atoms.a4l and associated files ... measures.a4l, system.a4l etc ... speed is distance divided by time - dimensions L/T - and so it goes for the other items like mass_density, viscosity etc *) REQUIRE "atoms.a4l"; MODEL reynolds; velocity IS_A speed; visc IS_A viscosity; diameter IS_A distance; density IS_A mass_density; reynolds_number IS_A factor; eq: reynolds_number = diameter*velocity*density/visc; METHODS METHOD clear; velocity.fixed := FALSE; visc.fixed := FALSE; diameter.fixed := FALSE; density.fixed := FALSE; reynolds_number.fixed := FALSE; END clear; METHOD specify; velocity.fixed := TRUE; visc.fixed := TRUE; diameter.fixed := TRUE; density.fixed := TRUE; reynolds_number.fixed := FALSE; END specify; METHOD values; velocity := 100 {meter/second}; diameter := 2.0 {feet}; (* diameter := 0.6108 {meter}; *) (* diameter := 61.08 {cm}; *) (* you get the idea *) density := 1.0 {g/cm^3}; visocity := 1.0 {cP}; END values; METHOD seqmod; RUN clear; RUN specify; RUN values; END seqmod; END reynolds_number;