You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -88,7 +88,8 @@ class Units { // contains the 4 base units [m], [kg], [s], [K] for unit conversi
88
88
floatGa(constfloat x, constfloat nu, constfloat g) { returncb(x)*g/sq(nu); } // Galilei number Ga = x^3*g/nu^2 = [1] no unit
89
89
floatGa(constfloat x, constfloat rho, constfloat nu, constfloat f) { returncb(x)*f/(sq(nu)*rho); } // Galilei number Ga = x^3*g/nu^2 = [1] no unit
90
90
floatMa(constfloat u) const { return u/0.57735027f; } // Mach number Ma = u/c = [1] no unit, c = 1/sqrt(3) is lattice speed of sound
91
-
floatrho_from_p(constfloat p) const { return3.0f*p; } // density rho = p/c^2 = 3*p = [kg/(m*s^2)], p is pressure, c = 1/sqrt(3) is lattice speed of sound
91
+
floatp_from_rho(constfloat rho) const { return (rho-1.0f)/3.0f; } // pressure p = (rho-rho0)*c^2 = (rho-1)/3 = [kg/(m*s^2)] = [Pa], rho is density, c = 1/sqrt(3) is lattice speed of sound
92
+
floatrho_from_p(constfloat p) const { return1.0f+3.0f*p; } // density rho = p0/c^2+p/c^2 = 1+3*p = [kg/m^3], p is pressure, c = 1/sqrt(3) is lattice speed of sound
92
93
floatrho_laplace(constfloat sigma, constfloat R) { return6.0f*sigma/R; } // sphere laplace pressure p = 2*sigma/R, density rho = 3*p
93
94
floatrho_hydrostatic(constfloat f, constfloat z, constfloat h) { return3.0f*f*(h-z)+1.0f; } // hydrostatic pressure p = rho*g*h+p0 = f*h+1/3, density rho = 3*p, force per volume f = rho*g, rho0 = 1
0 commit comments