def potential_gravity(self, grain_bill_dict, wort_vol, grain_units=None): ''' Takes in grain bill and wort volume and returns the theoretical gravity Input: grain_bill_dict: Dictionary object containing grain bill in kg wort_vol: Volume of wort in Liters Return: gravity: Scalar gravity of wort. ''' # Load parameters saps = self.saps if grain_units == 'ppg': max_yeild = mu.read_saps(saps['GRAIN_PPG']) final_vol = mu.l2gal(wort_vol) else: max_yeild = mu.read_saps(saps['GRAIN_PKL']) # Calculate potential_og = 0 n_grains = len(grain_bill_dict) grain_keys = list(grain_bill_dict.keys()) tot_points = 0 for ii in range(n_grains): points = max_yeild[grain_keys[ii]] mass = grain_bill_dict[grain_keys[ii]] tot_points += points * mass points = tot_points / wort_vol self.potential_og = 1 + (points / 1000) return self.potential_og
def m20191231wash0013(wash_file='',save_wash=False, overwrite=False): ''' Returns wash object with all attributes of brew day, fermentation, etc. ''' # ---------- Constants ----------------------------- mash_in_temp_c = 62 mash_temp_data = False if mash_temp_data: print('load in data') # ================= INPUTS ============================= name = "Wash #0013" wash = bu(saps,name) final_vol = mu.gal2l(5.5) og = 1.078 fg = 1.007 og_temp = 70 fg_temp = 88 # Grain Bill kgs grain_bill_dict = {'white_wheat_malt': mu.lb2kg(4), 'pilsner_malt': mu.lb2kg(3), 'rye_malt': mu.lb2kg(3), 'flaked_corn': mu.lb2kg(3), 'pot_still_malt': mu.lb2kg(2)} #==================================================================== # --------- Mash and water calculations #==================================================================== total_grain = sum(grain_bill_dict.values()) mash_vol, t_water = wash.mash_in(total_grain,mash_in_temp_c) #==================================================================== #---------- Calculated values #==================================================================== wash.set_og(og) wash.set_fg(fg) wash.set_yeast('WLP099 Super High Gravity Yeast') wash.set_final_vol_L(final_vol) wash.set_grain_bill_dict(grain_bill_dict) theoretical = wash.potential_gravity(grain_bill_dict, final_vol, grain_units='plk') theo_points = (theoretical - 1) * 1000 og_points = (og - 1) * 1000 efficeincy = og_points/theo_points * 100 abv = wash.abv(tog=og_temp,tfg=fg_temp) print('\n') print("Wash: " + name + '\n') print('MASH:') print(' Water vol(l): {}'.format(round(mash_vol,2))) print(' Water vol(gal): {}'.format(round(mu.l2gal(mash_vol),2))) print(' Water Temp(C): {}'.format(round(t_water,2))) print(' Water Temp(F): {}'.format(round(mu.c2f(t_water),2))) print('Final:') print(' Potential OG: {}'.format(round(theoretical,3))) print(' Actual OG: {}'.format(og)) print(' Efficiency: {}'.format(round(efficeincy,2))) print(' ABV: {}'.format(round(abv,2))) print('\n') overwrite = True if save_wash: mu.save_beer_to_archive(wash_file, wash, overwrite=overwrite) return wash
Type: Wash Name: Wash #13 Brewed: 20191231 Yeast: WLP099 Super High Gravity ''' # Import Python Modules import numpy as np # Import Custom Modules from BrewUtilities import BrewUtilities as bu import MiscUtilities as mu # SAPS saps = mu.read_saps('./brew_saps.json') def m20191231wash0013(wash_file='',save_wash=False, overwrite=False): ''' Returns wash object with all attributes of brew day, fermentation, etc. ''' # ---------- Constants ----------------------------- mash_in_temp_c = 62 mash_temp_data = False if mash_temp_data: print('load in data') # ================= INPUTS ============================= name = "Wash #0013" wash = bu(saps,name) final_vol = mu.gal2l(5.5)
def m20200404wash0018(wash_file='',save_wash=False, overwrite=False): ''' Returns wash object with all attributes of brew day, fermentation, etc. ''' # ---------- Constants ----------------------------- mash_in_temp_c = 70.5 mash_temp_data = False if mash_temp_data: print('load in data') # ================= INPUTS ============================= name = "Wash #0018" yeast = 'Still Spirits Fast Fermenting Classic 8' wash = bu(saps,name) final_vol = mu.gal2l(6) og = 1.11 fg = 1.007 og_temp = 70 fg_temp = 70 # Grain Bill kgs grain_bill_dict = { 'cracked_corn': 5, 'white_wheat_malt': 2, 'two_row_malt': 2, 'sucrose': mu.lb2kg(8) } #==================================================================== # --------- Mash and water calculations #==================================================================== total_grain = sum(grain_bill_dict.values()) mash_vol, t_water = wash.mash_in(total_grain,mash_in_temp_c) #==================================================================== #---------- Calculated values #==================================================================== wash.set_og(og) wash.set_fg(fg) wash.set_yeast(yeast) wash.set_final_vol_L(final_vol) wash.set_grain_bill_dict(grain_bill_dict) theoretical = wash.potential_gravity(grain_bill_dict, final_vol, grain_units='plk') theo_points = (theoretical - 1) * 1000 og_points = (og - 1) * 1000 efficeincy = og_points/theo_points * 100 abv = wash.abv(tog=og_temp,tfg=fg_temp) print('\n') print("Wash: " + name + '\n') print('MASH:') print(' Water vol(l): {}'.format(round(mash_vol,2))) print(' Water vol(gal): {}'.format(round(mu.l2gal(mash_vol),2))) print(' Water Temp(C): {}'.format(round(t_water,2))) print(' Water Temp(F): {}'.format(round(mu.c2f(t_water),2))) print('Final:') print(' Potential OG: {}'.format(round(theoretical,3))) print(' Actual OG: {}'.format(og)) print(' Efficiency: {}'.format(round(efficeincy,2))) print(' ABV: {}'.format(round(abv,2))) print('\n') if save_wash: mu.save_beer_to_archive(wash_file, wash, overwrite=overwrite) return wash
def b20200411pale_ale(beer_file='', save_beer=False, overwrite=False): ''' Returns beer object with all attributes of brew day, fermentation, etc. ''' # ---------- Constants ----------------------------- mash_in_temp_c = 70.5 mash_temp_data = False if mash_temp_data: print('load in data') # ================= INPUTS ============================= name = "John Lemmon" classification = "Ale" beer_type = "Pale Ale" yeast = 'Safe Ale US-05' beer = bu(saps, name) final_vol = mu.gal2l(4) og = 1.054 fg = 1.018 og_temp = 83 fg_temp = 64 # hops = [Alpha, Boil, Ounces] additions = 1 hops = np.array((additions, 3)) cascade = np.array([3.8, 60, 0.2]) hops = cascade hops = hops.reshape((additions, 3)) hop_types = ['cascade'] # Grain Bill kgs grain_bill_dict = { 'white_wheat_malt': 0.52, 'pale_malt': 1.354, 'pilsner_malt': 2.72 } #==================================================================== # --------- Mash and water calculations #==================================================================== total_grain = sum(grain_bill_dict.values()) mash_vol, t_water = beer.mash_in(total_grain, mash_in_temp_c) #==================================================================== #---------- Calculated values #==================================================================== beer.set_classification(classification) beer.set_beer_type(beer_type) beer.set_og(og) beer.set_fg(fg) beer.set_yeast(yeast) beer.set_hop_types(hop_types) beer.set_final_vol_L(final_vol) beer.set_grain_bill_dict(grain_bill_dict) beer.set_hop_types(hop_types) beer.set_hops(hops) theoretical = beer.potential_gravity(grain_bill_dict, final_vol, grain_units='plk') theo_points = (theoretical - 1) * 1000 og_points = (og - 1) * 1000 efficeincy = og_points / theo_points * 100 abv = beer.abv(tog=og_temp, tfg=fg_temp) ibus = beer.ibus(hops) calories = beer.calories(og, fg) print('\n') print("BEER: " + name + '\n') print('MASH:') print(' Water vol(l): {}'.format(round(mash_vol, 2))) print(' Water vol(gal): {}'.format(round(mu.l2gal(mash_vol), 2))) print(' Water Temp(C): {}'.format(round(t_water, 2))) print(' Water Temp(F): {}'.format(round(mu.c2f(t_water), 2))) print('Final:') print(' Potential OG: {}'.format(round(theoretical, 3))) print(' Actual OG: {}'.format(og)) print(' Efficiency: {}'.format(round(efficeincy, 2))) print(' ABV: {}'.format(round(abv, 2))) print(' IBUs: {}'.format(round(ibus, 2))) print(' Calories: {}'.format(round(calories, 2))) print('\n') if save_beer: mu.save_beer_to_archive(beer_file, beer, overwrite=overwrite) return beer
def b20191231nut_brown(beer_file='', save_beer=False): ''' Returns beer object with all attributes of brew day, fermentation, etc. ''' # ---------- Constants ----------------------------- mash_in_temp_c = 62 mash_temp_data = False if mash_temp_data: print('load in data') # ================= INPUTS ============================= name = "Lead Ale (Pb)" classification = 'Ale' beer_type = 'Brown' yeast = 'Safe Ale US-04 Yeast' beer = bu(saps, name) final_vol = mu.gal2l(5.8) og = 1.059 fg = 1.016 og_temp = 70 fg_temp = 70 # hops = [Alpha, Boil, Ounces] additions = 1 hops = np.array((additions, 3)) east_kent_golding = np.array([4.4, 60, 1]) hops = east_kent_golding hops = hops.reshape((additions, 3)) hop_types = ['east kent golding'] # Grain Bill kgs pale_malt = mu.lb2kg(6) caramel_malt_80l = mu.lb2kg(3) chocolate_malt = mu.lb2kg(1) honey_malt = mu.lb2kg(1) victory_malt = mu.lb2kg(3) grain_bill_dict = { 'pale_malt': pale_malt, 'caramel_malt_80l': caramel_malt_80l, 'chocolate_malt': chocolate_malt, 'honey_malt': honey_malt, 'victory_malt': victory_malt } #==================================================================== # --------- Mash and water calculations #==================================================================== total_grain = sum(grain_bill_dict.values()) mash_vol, t_water = beer.mash_in(total_grain, mash_in_temp_c) #==================================================================== #---------- Calculated values #==================================================================== beer.set_classification(classification) beer.set_beer_type(beer_type) beer.set_og(og) beer.set_fg(fg) beer.set_yeast(yeast) beer.set_hop_types(hop_types) beer.set_final_vol_L(final_vol) beer.set_grain_bill_dict(grain_bill_dict) beer.set_hop_types(hop_types) beer.set_hops(hops) theoretical = beer.potential_gravity(grain_bill_dict, final_vol, grain_units='plk') theo_points = (theoretical - 1) * 1000 og_points = (og - 1) * 1000 efficeincy = og_points / theo_points * 100 abv = beer.abv(tog=og_temp, tfg=fg_temp) ibus = beer.ibus(hops) calories = beer.calories(og, fg) print('\n') print("BEER: " + name + '\n') print('MASH:') print(' Water vol(l): {}'.format(round(mash_vol, 2))) print(' Water vol(gal): {}'.format(round(mu.l2gal(mash_vol), 2))) print(' Water Temp(C): {}'.format(round(t_water, 2))) print(' Water Temp(F): {}'.format(round(mu.c2f(t_water), 2))) print('Final:') print(' Potential OG: {}'.format(round(theoretical, 3))) print(' Actual OG: {}'.format(og)) print(' Efficiency: {}'.format(round(efficeincy, 2))) print(' ABV: {}'.format(round(abv, 2))) print(' IBUs: {}'.format(round(ibus, 2))) print(' Calories: {}'.format(round(calories, 2))) print('\n') overwrite = True if save_beer: mu.save_beer_to_archive(beer_file, beer, overwrite=overwrite) mu.delete_beer_from_archive(beer_file, "Jiffy's Lube") return beer
def b20191221mexican_lager(beer_file='', save_beer=False): ''' Returns beer object with all attributes of brew day, fermentation, etc. ''' # ---------- Constants ----------------------------- mash_in_temp_c = 62 mash_temp_data = False if mash_temp_data: print('load in data') # ================= INPUTS ============================= name = "Tim's Beer" classification = "Lager" beer_type = "Pilsner" yeast = 'WLP940 Mexican Lager Yeast' beer = bu(saps, name) final_vol = mu.gal2l(5.5) og = 1.041 fg = 1.01 og_temp = 73 fg_temp = 58 # hops = [Alpha, Boil, Ounces] additions = 1 cascade = np.array([5, 60, 0.5]) hop_types = ['cascade'] hops = cascade hops = hops.reshape((additions, 3)) # Grain Bill kgs grain_bill_dict = { 'marris_otter_malt': mu.lb2kg(9), 'caramel_malt_20l': mu.lb2kg(1) } #==================================================================== # --------- Mash and water calculations #==================================================================== total_grain = sum(grain_bill_dict.values()) mash_vol, t_water = beer.mash_in(total_grain, mash_in_temp_c) #==================================================================== #---------- Calculated values #==================================================================== beer.set_classification(classification) beer.set_beer_type(beer_type) beer.set_og(og) beer.set_fg(fg) beer.set_yeast(yeast) beer.set_hop_types(hop_types) beer.set_final_vol_L(final_vol) beer.set_grain_bill_dict(grain_bill_dict) beer.set_hop_types(hop_types) beer.set_hops(hops) theoretical = beer.potential_gravity(grain_bill_dict, final_vol, grain_units='plk') theo_points = (theoretical - 1) * 1000 og_points = (og - 1) * 1000 efficeincy = og_points / theo_points * 100 abv = beer.abv(tog=og_temp, tfg=fg_temp) ibus = beer.ibus(hops) calories = beer.calories(og, fg) print('\n') print("BEER: " + name + '\n') print('MASH:') print(' Water vol(l): {}'.format(round(mash_vol, 2))) print(' Water vol(gal): {}'.format(round(mu.l2gal(mash_vol), 2))) print(' Water Temp(C): {}'.format(round(t_water, 2))) print(' Water Temp(F): {}'.format(round(mu.c2f(t_water), 2))) print('Final:') print(' Potential OG: {}'.format(round(theoretical, 3))) print(' Actual OG: {}'.format(og)) print(' Efficiency: {}'.format(round(efficeincy, 2))) print(' ABV: {}'.format(round(abv, 2))) print(' IBUs: {}'.format(round(ibus, 2))) print(' Calories: {}'.format(round(calories, 2))) print('\n') overwrite = True if save_beer: mu.save_beer_to_archive(beer_file, beer, overwrite=overwrite) return beer
''' Misc calcs for brew day of double wash. ''' # Import custom modules from BrewUtilities import * import MiscUtilities as mu temp_1 = 67.3 vol_1 = mu.gal2l(5.8) vol_2 = mu.gal2l(1) grain_mass = 6.8 target_t = 70.5 # temp_1 = mu.f2c(152) # vol_1 = mu.gal2l(5) # vol_1 = mu.gal2l(5.5) # grain_mass = mu.lb2kg(20) # target_t = mu.f2c(158) ti = mu.what_water_temp(target_t,vol_2,vol_1,temp_1,grain_mass) print(ti)
def b20200202milk_porter(beer_file='', save_beer=False, overwrite=False): ''' Returns beer object with all attributes of brew day, fermentation, etc. ''' # ---------- Constants ----------------------------- mash_in_temp_c = 65 mash_temp_data = False if mash_temp_data: print('load in data') # ================= INPUTS ============================= name = "Chocolate Portering Unit (CPU)" classification = "Ale" beer_type = "Porter" yeast = 'WLP001 California Ale Yeast' beer = bu(saps, name) final_vol = mu.gal2l(6.2) og = 1.077 fg = 1.026 og_temp = 70 fg_temp = 60 # hops = [Alpha, Boil, Ounces] additions = 1 hops = np.array((additions, 3)) willamette = np.array([3.8, 60, 0.65]) hop_types = ['willamette'] hops = willamette hops = hops.reshape((additions, 3)) # Grain Bill kgs grain_bill_dict = { 'pale_malt': mu.lb2kg(2), 'pale_chocolate_malt': mu.lb2kg(1), 'black_malt': mu.lb2kg(3 / 16), 'chocolate_wheat_malt': mu.lb2kg(0.25), 'two_row_malt': mu.lb2kg(10), 'flaked_oats': mu.lb2kg(0.5) } #==================================================================== # --------- Mash and water calculations #==================================================================== total_grain = sum(grain_bill_dict.values()) mash_vol, t_water = beer.mash_in(total_grain, mash_in_temp_c) #==================================================================== #---------- Calculated values #==================================================================== beer.set_classification(classification) beer.set_beer_type(beer_type) beer.set_og(og) beer.set_fg(fg) beer.set_yeast(yeast) beer.set_hop_types(hop_types) beer.set_final_vol_L(final_vol) beer.set_grain_bill_dict(grain_bill_dict) beer.set_hop_types(hop_types) beer.set_hops(hops) theoretical = beer.potential_gravity(grain_bill_dict, final_vol, grain_units='plk') theo_points = (theoretical - 1) * 1000 og_points = (og - 1) * 1000 efficeincy = og_points / theo_points * 100 abv = beer.abv(tog=og_temp, tfg=fg_temp) ibus = beer.ibus(hops) calories = beer.calories(og, fg) print('\n') print("BEER: " + name + '\n') print('MASH:') print(' Water vol(l): {}'.format(round(mash_vol, 2))) print(' Water vol(gal): {}'.format(round(mu.l2gal(mash_vol), 2))) print(' Water Temp(C): {}'.format(round(t_water, 2))) print(' Water Temp(F): {}'.format(round(mu.c2f(t_water), 2))) print('Final:') print(' Potential OG: {}'.format(round(theoretical, 3))) print(' Actual OG: {}'.format(og)) print(' Efficiency: {}'.format(round(efficeincy, 2))) print(' ABV: {}'.format(round(abv, 2))) print(' IBUs: {}'.format(round(ibus, 2))) print(' Calories: {}'.format(round(calories, 2))) print('\n') if save_beer: mu.save_beer_to_archive(beer_file, beer, overwrite=overwrite) return beer
# ===================================================================== # ============ Control volume ========================================= # Total energy transfere on control volume # Assumptions: # - Steady state. 0 = Q_box + Q_out + Q_gen Q_out = -(Q_box + Q_gen) print('Cooler must operate at {} W to ensure steady state at {} C in {} C ambient.'.format( round(Q_out,digs),t_inside,t_ambient)) # Control volume is fermentor area_basis = 1 water_per = 0.3 t_amb = mu.f2c(68) # C t_water = mu.f2c(50) # C t_ferm = mu.f2c(55) water_coeff = 400 # W/m2 K air_coeff = 50 # W/m2 K Q_water = area_basis * water_per * water_coeff * (t_water - t_ferm) Q_air = area_basis * (1-water_per) * air_coeff * (t_amb - t_ferm) Q_gen = 40 print('Net tranfer: {}'.format(round(Q_water + Q_air + Q_gen,digs))) print('stop')