Skip to content

Commit

Permalink
Merge pull request #7 from nmicht/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
nmicht authored Feb 7, 2019
2 parents 7c5533f + a290190 commit c39a6b4
Show file tree
Hide file tree
Showing 5 changed files with 289 additions and 124 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Mead Nutrient Calculator

Mead Calculator for the right nutrient addition regimen.


## Features

This mead nutrient calculator will give you all the data required to make mead
with the correct amount of nutrient. Also, includes extra information to help
you with the elements to use.

- Yeast Pitch Rate.
- Go-Ferm.
- Water to dilute Go-Ferm.
- Yeast needed.
- Total nutrient needed.
- Nutrient addition.
- Units in metric system and USCS.
98 changes: 96 additions & 2 deletions src/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,20 @@ const YEAST_SELECTION = {
"ALE": 0.75,
}

/**
* Get Yeast Nutrient Requirement
* @param {string} yeastSelection The yeast identifier
* @return {number} The nutrient requirement for the specific yeast
*/
function getYeastNutrientRequirement(yeastSelection) {
return YEAST_SELECTION[yeastSelection] || 0;
}

/**
* Get Starting Gravity Brix
* @param {number} startingGravity The starting gravity
* @return {number} The gravity brix
*/
function getStartingGravityBrix(startingGravity) {
let startingGravityBrix = 0;
if(startingGravity < 1) {
Expand All @@ -47,6 +57,17 @@ function getStartingGravityBrix(startingGravity) {
return startingGravityBrix || 0;
}

/**
* Get Total Nutrient Need Grams
* @param {number} startingGravityBrix [description]
* @param {number} batchSizeUnit [description]
* @param {number} fruitSpecificGravity [description]
* @param {number} yeastNutrientRequirement [description]
* @param {number} nutrientPreference [description]
* @param {number} batchSize [description]
* @param {number} fruitSugarPercentage [description]
* @return {number} [description]
*/
function getTotalNutrientNeedGrams({
startingGravityBrix,
batchSizeUnit,
Expand Down Expand Up @@ -75,10 +96,26 @@ function getTotalNutrientNeedGrams({
return totalNutrientNeedGrams || 0;
}

/**
* Get Total Nutrient Need Oz
* @param {number} totalNutrientNeedGrams [description]
* @return {number} [description]
*/
function getTotalNutrientNeedOz(totalNutrientNeedGrams) {
return totalNutrientNeedGrams * 0.0352739619;
}

/**
* Get Yeast Need
* @param {number} batchSize [description]
* @param {number} startingGravity [description]
* @param {number} batchSizeUnit [description]
* @param {number} overrideYeastPitchRate [description]
* @param {number} yeastPitchRate [description]
* @param {number} metricYeastPitchRateOverride [description]
* @param {number} recommendedYeastPitchRateLt [description]
* @return {number} [description]
*/
function getYeastNeed({
batchSize,
startingGravity,
Expand Down Expand Up @@ -114,33 +151,69 @@ function getYeastNeed({
return yeastNeed;
}

/**
* Get Go Ferm Need Oz
* @param {number} yeastNeed [description]
* @return {number} [description]
*/
function getGoFermNeedOz(yeastNeed) {
return (yeastNeed * 1.25) * 0.0352739619;
}

/**
* Get Go Ferm Water Need Lt
* @param {number} goFermNeedGram [description]
* @return {number} [description]
*/
function getGoFermWaterNeedLt(goFermNeedGram) {
return goFermNeedGram * 0.02;
}

/**
* Get Go Ferm Need Gram
* @param {number} yeastNeed [description]
* @return {number} [description]
*/
function getGoFermNeedGram(yeastNeed) {
return yeastNeed * 1.25;
}

/**
* Get Go Ferm Water Need Ml
* @param {number} goFermNeedGram [description]
* @return {number} [description]
*/
function getGoFermWaterNeedMl(goFermNeedGram) {
return goFermNeedGram * 20;
}

/**
* Get Nutrient Step Grams
* @param {number} totalNutrientNeedGrams [description]
* @return {number} [description]
*/
function getNutrientStepGrams(totalNutrientNeedGrams) {
return totalNutrientNeedGrams / 4;
}

/**
* Get Nutrient Step Oz
* @param {number} totalNutrientNeedGrams [description]
* @return {number} [description]
*/
function getNutrientStepOz(totalNutrientNeedGrams) {
return (totalNutrientNeedGrams / 4) * 0.0352739619;
}

/**
* Get Yeast Pitch Rate
* @param {number} batchSize [description]
* @param {number} startingGravity [description]
* @return {number} [description]
*/
function getYeastPitchRate({
batchSize,
startingGravity,
startingGravity
}) {
let yeastPitchRate = 0;

Expand All @@ -165,9 +238,15 @@ function getYeastPitchRate({
return yeastPitchRate;
}

/**
* Get Fruit Sugar Percentage
* @param {number} fruitSpecificGravity [description]
* @param {number} startingGravity [description]
* @return {number} [description]
*/
function getFruitSugarPercentage({
fruitSpecificGravity,
startingGravity,
startingGravity
}) {
let fruitSugarPercentage = 0;

Expand All @@ -180,6 +259,11 @@ function getFruitSugarPercentage({
return fruitSugarPercentage;
}

/**
* Get Sugar Break
* @param {number} startingGravity [description]
* @return {number} [description]
*/
function getSugarBreak(startingGravity) {
let sugarBreak = 0;

Expand All @@ -196,6 +280,12 @@ function getSugarBreak(startingGravity) {
return sugarBreak;
}

/**
* Get Recommended Yeast Pitch Rate Lt
* @param {number} batchSize [description]
* @param {number} startingGravity [description]
* @return {number} [description]
*/
function getRecommendedYeastPitchRateLt({
batchSize,
startingGravity
Expand Down Expand Up @@ -223,6 +313,10 @@ function getRecommendedYeastPitchRateLt({
return recommendedYeastPitchRateLt;
}

/**
* The module for the mead nutrient calculations.
* @module calc
*/
export default {
getStartingGravityBrix,
getTotalNutrientNeedGrams,
Expand Down
3 changes: 2 additions & 1 deletion src/form/radio/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
}

.input-radio-group .input-group input {
order: -1;
height: auto;
margin: auto 0.5em;
order: -1;
}

.input-radio-group .input-group input,
Expand Down
2 changes: 1 addition & 1 deletion src/form/select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function Select(props) {
</span>
<select
id={props.id}
name={props.name}
name={props.id}
value={props.value}
required={props.required}
onChange={props.onChange}
Expand Down
Loading

0 comments on commit c39a6b4

Please sign in to comment.