Skip to content

Commit

Permalink
Begin work on adding an evaporation constant to the boil gravity calc…
Browse files Browse the repository at this point in the history
…ulation
  • Loading branch information
chrisgilmerproj committed Oct 5, 2016
1 parent 54470f6 commit 3705765
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions brew/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,6 @@

#: Weight Tolerance, considered equal within this range
WEIGHT_TOLERANCE = 0.005

#: Percent of water evaporated during boil, usually 8% or between 8%-10%
BOIL_EVAPORATION = 0.00
11 changes: 7 additions & 4 deletions brew/recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import textwrap

from .constants import BOIL_EVAPORATION
from .constants import GRAIN_TYPE_DME
from .constants import GRAIN_TYPE_LME
from .constants import GAL_PER_LITER
Expand Down Expand Up @@ -220,23 +221,25 @@ def get_original_gravity(self):
"""
return gu_to_sg(self.get_original_gravity_units())

def get_boil_gravity_units(self):
def get_boil_gravity_units(self, evaporation=BOIL_EVAPORATION): # nopep8
"""
Get the boil gravity units
:param float evaporation: Percent water evaporation during boil
:return: The boil gravity units
:rtype: float
"""
return self.get_total_points() / self.start_volume
return self.get_total_points() / ((1.0 - evaporation) * self.start_volume) # nopep8

def get_boil_gravity(self):
def get_boil_gravity(self, evaporation=BOIL_EVAPORATION): # nopep8
"""
Get the boil specific gravity
:param float evaporation: Percent water evaporation during boil
:return: The boil specific gravity
:rtype: float
"""
return gu_to_sg(self.get_boil_gravity_units())
return gu_to_sg(self.get_boil_gravity_units(evaporation=evaporation))

def get_final_gravity_units(self):
"""
Expand Down

0 comments on commit 3705765

Please sign in to comment.