// Reynolds Number 

function Reynolds(rho, u, d, mu, v){
	this.rho = rho; // density
	this.u = u; // velocity
	this.d = d; // hydraulic diameter
	this.mu = mu; // absolute viscosity
	this.v = v; // kinematic viscosity
	this.turb = "";
}

Reynolds.prototype.reynoldsNumber = function(){
	var re = -1;
	if (this.rho && this.u && this.d && this.mu) re = Math.round(this.rho * this.u * this.d / this.mu);
	if (this.u && this.d && this.v) re = Math.round(this.u * this.d / this.v); 
	if (re > 4000) this.turb = "turbulent";
	if (re > 2300 && re <4000) this.turb = "transient";
	if(re < 2300) this.turb = "laminar";
	return re;
}
Reynolds.prototype.turbulent = function(){
	return this.turb;
}

Reynolds.prototype.inputString = function(){
	return this.rho + " " + this.u + " " + this.d + " " + this.mu + " " + this.v;
}

// Copyright engineeringtoolbox.com