Calculating the Bulk Modulus of a Fluid
ThermophyiscalData:-Property will compute the properties of fluids; these properties include density, enthalpy, viscosity and more.
However, some properties are not computable out-of-the box; these include the isothermal bulk modulus a fluid. Bulk modulus is defined as
So to compute the bulk modulus we need to calculate the
fluid density
and the numeric derivative of pressure with respect to density (at constant temperature).
This procedure accepts a temperature, pressure and fluid, and calculates the bulk modulus. Numerical derivatives are computed with fdiff .
BulkModulus := proc(temp, press, fluid) local rho: uses ThermophysicalData: rho:=Property(density, temperature = temp, pressure = press, fluid); return rho*fdiff(Property(P, density = D, temperature = temp, fluid), D = rho); end proc:
Hence the bulk modulus of water at 20°C and 1 atm is
This value closely matches that given by miniREFPROP , as illustrated in the screengrab below
This plot demonstrates that the bulk modulus of water is at a maximum when the temperature is about 320 K