Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def kettle_variables():
- diameter = float(input("Diameter centimeters: "))
- volume = float(input("Volume in liters: "))
- temp = float(input("Temperature in celsius: "))
- density = float(input("Density: "))
- mass = volume * density
- radius = diameter/2
- # height in cm
- height = (volume * 1000) / (math.pi * math.pow(radius, 2))
- # surface in m^2
- surface = (2 * math.pi * math.pow(radius, 2) + 2 * math.pi * radius * height) / 10000
- return diameter,volume,temp,density,height,surface,mass
- def kettle_heat(THERMAL_CONDUCTIVITY_STEEL,surface,temp):
- duration = float(input("Duration: "))
- ambient_temp = float(input("The ambient temperature in degree celsius: "))
- heat_loss_factor = float(input("Increase or decrease the heat loss by aspecified factor: "))
- # Q = k_w * A * (T_kettle - T_ambient)
- # P = Q / t
- power = ((THERMAL_CONDUCTIVITY_STEEL * surface
- * (temp - ambient_temp)) / duration)
- # W to kW
- power /= 1000
- temp -= get_deltaT(power, duration) * heat_loss_factor
- return temp
- def get_deltaT(power, duration,SPECIFIC_HEAT_CAP_WATER,mass):
- # P = Q / t
- # Q = c * m * delta T
- # => delta(T) = (P * t) / (c * m)
- return ((power * duration) / (SPECIFIC_HEAT_CAP_WATER * mass))
- if __name__ == '__main__':
- kettle_variables()
- kettle_heat(surface,THERMAL_CONDUCTIVITY_STEEL,temp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement