A New Mash Chemistry and Brewing Water Calculator

When I started helping Brewer’s Friend as a technical adviser I couldn’t help but notice that the mash pH predicted by its brewing water calculator was way off. Since I have done extensive work on brewing water and mash chemistry already I took this as an opportunity to develop a new Mash Chemistry and Brewing Water Calculator from scratch. The goal was to build something that provides a simple and intuitive user interface yet implements the underlying chemistry to at a level of accuracy that is generally not done in brewing water calculators. In fact the only calculator that goes to that extent is A.J deLange’s NUBWS (Nearly Universal Brewing Water Spreadsheet).

Since Brewer’s Friend is an online recipe calculator the new calculator would also become an online tool. This worked very well in its favor since it is very cumbersome to model complex systems in spreadsheets. PHP, or any other programming language for that matter, makes that type of modeling much easier. In addition to that modern web browser technology makes it simple to create dynamic forms that can readily adjust the form to only asking the user for information that is actually needed based on the context.

That was 3 months ago and after many long nights of coding, re-coding, testing and even running more mash pH experiments version 1.0 has finally been released and is available on Brewer’s Friend.

When you first open the calculator it presents itself like any other basic water with sections for source water, salt additions, grist, mash pH and final water report following this flow chart:

Flow chart for basic use of the calculator

Flow chart for basic use of the calculator

But that’s not all. For those who need want to do more complex water treatment calculations, the full flow chart looks more like this:

Full flow chart for brewing water and mash chemistry calculator.

Full flow chart for brewing water and mash chemistry calculator.

All these additional section are hidden by default and can be shown on demand.

Sceenshot

Screenshot

The first release features makes these features available:

  • Blending of two water sources
  • Bicarbonate/carbonate content can be set from either alkalinity or bicarbonate. pH can also be entered for increased accuracy
  • Electrical balance (ion balance) of the source water
  • Simple GH&KH measurements can be used as a crude way of specifying the source water.
  • Report of basic and advanced water parameters of the source water. Among the advanced properties are temporary/permanent hardness and CO2 partial pressure
  • supports all major salts (including magnesium chloride) as well as the hydroxides slaked lime and lye
  • Alkalinity reduction through boiling and slaked lime. These are features that rely on a more accurate implementation of the water’s carbo system
  • Wide range of supported acids including the less commonly used citric, tartaric and acetic acid.
  • Salt and acid additions can be made to all water or only the strike (mash) water
  • A different water source can be used for sparge water. In most cases that might be reverse osmosis water when the tap water is suitable for mashing.
  • Salt additions to sparge water or kettle
  • Sparge water acidification with a wide range of acids.
  • Detailed report of the treated mash water
  • Support for undissolved chalk.
  • Grist pH properties can be estimated from beer color or malt bill
  • Mash pH prediction based on balancing the various weak and strong acid systems that might be present (carbo system, weak acids and grist)
  • overall water report based on the mash and sparge water profile
  • target water comparison of the overall water report

For now this tool is only available as a stand-alone calculator but Brewer’s Friend is planning to integrate it into the recipe editor. This will eliminate duplicate entry of the beer’s malt bill. It will also allow the user to use saved source water profile(s).

Go ahead and give it a try. If you have feedback, positive or negative, please let me know:

Mash Chemistry and Brewing Water Calculator

In subsequent posts I’m planning to write more about some of the discoveries I made while writing this tool and how it’s mash pH prediction does compared to actual mash pH data that I have.

 

47 thoughts on “A New Mash Chemistry and Brewing Water Calculator

  1. Thanks Kai! I can’t wait to test it out. As much as I love Brun’water, it will be so nice to have this integrated into Brewer’s Friend. Working off a spreadsheet is a PITA when I have everything else at my fingertips online.

    • Eric,

      I’m with you on this. I have stopped using my spreadsheet a while ago since it was always a hassle to open yet another tool. I’m looking forward to the integration into the recipe editor so I don’t have to enter the grist twice. We also plan to support actual malt pH properties for custom malt entries in case brewers have them. If they are available they don’t have to be estimated from color and malt type.

      • Kai,
        How come there’s always such a difference in the mash pH when switching back and forth between SRM and malt bill. I always do both and they always come out .4-.5 different between the two with the same grain bill.

        • Glenn,

          When you change SRM, are you also correctly specifying the percentage of color that comes from roasted malts? That can make a huge difference in the estimated mash pH since roasted malts have less acidity per Lovibond than crystal malts.

  2. Thanks for your efforts on this! It looks great! I gave it a trial run and when I put my water profile in from Ward Labs, which is all in ppm, I get zero for the resulting water profile except for SO4. When I change to mg/l everything comes out as I would expect. I thought ppm is the same as mg/l. Is this a bug, or am I missing something?

    • yep, using “ppm” is not working. I’ll get this fixed ASAP. For now mg/l will do.

      That’s what I get for supporting two units that are essentially the same :)

  3. Requests for future updates: a larger text box for “malt name”, and the ability to enter quantity of malt in ounces. This may become a nonissue once the calculator is integrated with the recipe design portion of the software.

  4. The malt name is only for your own reference. When this is intergarted into the recipe editor you will not use that form anyway. I’ll make a note to make the field a little larger.

    supporting oz for malt weight should be simple. Supporting bot lb and oz entry is more difficult since it takes another box.

  5. I have been trying the calculator out and I very impressed but have a question.

    When I use it to assess the impact of boiling the water my Alkalinity goes down from 147 as CaCO3 to 38.8.

    However, in you article ‘Mash pH Control’ you state “This method [boiling] is able to lower alkalinity to about 50-65 ppm”. This new calculator seems to be using a lower figure than this (indeed it says 38.8).

    Please can you shed a little light on how the calculator assesses the the change in Alkalinity due to boiling.

    Thanks.

    • I’ll have to update this wiki article. While the calculator shows an ideal result I do have experimental results that lie between the calculator’s prediction and the limit I’m citing in the wiki article. I currently have an additional feature for the calculator on the back burner which would allow the user to enter actual GH&KH measurements of the post treatment water to account for a less then ideal alkalinity precipitation.

      To find the alkalinity precipitation for boiling the calculator assumes that the resulting CO2 content of the water will match the atmospheric CO2 partial pressure. To satisfy this it allows CO2 to escape and precipitates all CaCO3 that exceeds the solubility product for Ca and CO3. This is the most compute intensive function in the calculator.

      Kai

  6. Kai, tremendous job so far. Thanks a bunch, I really appreciate it (like a horde of the rest of us )!!
    But it would be also nice, just for reference – to include info about SO4 : Cl ratio (something like in EZ water calc).
    Thanks again for awesome help!

    • Thanks. What you are looking for is available in the overall water report section. It’s one of the two lines printed at the bottom of that section.

  7. It’s me again:) I’m a metric guy, following ‘issue’ is not big problem for me, but possibility of using “,” instead of “.” would be nice too 😉

      • Oh man, I really don’t wanna look like I’m spamming that entry. But as you’ve seen, I’m ‘struggling’ with that awesome calc :) Could you help me or give at lest some critics to my calculations? What I’m trying to brew, would be also sort of BIAB pilot batch (water check). Mild, OG 1.036, FG 1.012. Liquid:Grist ~ 4:1. SO4:Cl 1:2.
        And here’s my water report: KXTTYY8.
        My biggest doubt, is using lactic acid with a ‘sparge’ (I’ll dunk sparge -BIAB) water. Should I use it or just pass, only with some eventual small addiction into mash for pH correction?
        What do you think? I’d really appreciate your input on it :) Thanks again :)

        • OK, I actually did that test batch. My pH results were almost in a ballpark, as predicted in the calc :) Awesome job Kai, thank you ! It really makes brew day more interesting and more satisfying. It’s nice to have finally, some few factors under control :)

  8. Kai, just listened to you & James Spencer on BBR and tried this out… except I don’t get the same result as Martin Brungard’s spreadsheet. For the same inputs, I saw a difference of about 0.2 pH units (Martin: 5.35, Kai: 5.54) Why such a discrepancy?

    • This is because Martin’s spreadsheet uses a different model than mine. There is no definitive model for mash pH and different spreadsheets/calculators may implement different models and/or use different assumptions for the predictions.

      Kai

      • Thanks, Kai. Martin’s spreadsheet predicts my mash pH well. But if you’re saying that there’s no definitive model, would your model predict pH better (than Martin’s) for someone else, theoretically? I guess I’m trying to understand by brewing science wouldn’t be converging on one model.

        • Andrew, For a number of pH measurements (experiments and actual brewed batches) I have compared Martin’s spreadsheet and my new water calculator. There are a number of water and grist configuration where BW does poorly with respect to mash pH prediction. Especially when you get into the extremes. But in many cases it does good enough. So I do see that it works for most brewers.

          One of the reasons why the models diverge is that the Brewer’s Friend calculator implements the underlying water chemistry more accurately. It actually takes the behavior of the various weak aids into account. Spreadsheets have a problem with that since math that is involved is difficult to implement and debug in a spreadsheet.

          I recently added the ability to enter base malts with their distilled water pH. That helps brewers who know that parameter since base malt pH is the largest factor in mash prediction uncertainty.

          Would you be interested in having a spreadsheet import function for the Brewer’s Friend water calculator to make it easier to get a 2nd opinion on mash pH? I have been thinking about that feature and it should not be all that difficult to implement.

          • Hi Kai. A spreadsheet import function would probably be unnecessary; it’s fairly short work, and your site does save the info via cookies, which is awesome.

            I did some additional checking, and I noticed that the your calculator presents a different result based on malt bill vs beer color (SRM) options. Calculated, via the SRM option (for a British mild I just brewed, 17.8 SRM), you predict pH 5.42, whereas via the malt bill option for the same beer, you predict 5.57. Martin’s spreadsheet predicts 5.48. Tested with my calibrated pH56 unit, I got 5.44.

            The ion concentrations for both your calculator & Martins’ spreadsheet are exactly the same, and RA (ppm as CaCO3) is only slightly different (you: 98.2; Martin: 97). Any thoughts?

            Thanks for your comments. I’m just trying to better understand brewing water nuances. Cheers!

          • good questions and I’m happy to answer them. The SRM based prediction has to make some assumptions that the malt bill based prediction doesn’t have to which is why it tends to be less precise. But in the end both the malt based and SRM based prediction are based on color. RA will be lightly different since my calculator represents alkalinity as carbonic acid, bicarbonate and carbonate. That’s where the slight difference comes from. I think you entered the bicarbonate ion
            concentration and depending on pH there was some small amount of carbonate necessary. The bicarbonate + carbonate gives you slightly more alkalinity than the standard approach of using only bicarbonate to calculate alkalinity.

            Another experiment you can do is to add baking soda vs. sodium hydroxide to get to the same alkalinity and then look at the different pH predictions. With the same alkalinity sodium hydroxide raises mash pH more than baking soda since baking soda is the salt of a weak acid (carbonic acid). The difference gets more significant as you get closer to mash pH 6.0.

            The calculator does not store the water calculations as a cookie. It stored them in an internal database. That way they don’t get lost when you clear out your cookies. BF will soon add the ability to see all your stored water calculations when you sign up for a trial or full membership. That makes organizing them a bit easier. Right now you can use bookmarks.

  9. It would be great if there would be “Print” or “Save” bottom, so we can save current report and keep in our recipe base.
    I used Martin’s sheet so far and I exported water profile so I can repeat it if I am satisfied with result.
    As for pH, Brunwater gave me best results so far (max 0.1 error).. looking forward to see how this calculator will predict it.
    Cheers and thanks!

    • The current version has the ability to save the settings and gives a link to retrieve that record. There will also be more bookkeeping options for Brewer’s Friend users that will make it easier to keep track of water profiles and treatment. There is no print option. If we add this, it would be part of the Brewer’s Friend recipe editor print function.

      • After registering “Save/Reload” button is showed. I am pleased with code option, we can save just code and retrieve profile simply by pasting code..
        Many thanks for this, keep up the good work!

  10. I have been using the calculator and it is predicting my mash pHs fairly well. However, I have noticed something odd in predicting the water ion content. If I have CRS/AMS selected but leave the “Acid Amount:” as 0 ml and press “Update calculation” it doubles the Cl- and SO4+2 concentrations. This seems odd because I have not added any ions yet. Also, if I put a value in for “Acid Amount:” in ml/g it says that it can’t do the calculation.

    • The bug was a typo in the code and it only shows up when there are already ions in the water. That’s why I missed it in testing. The strong acids (HCl, H2SO4 and CRS) are not all that popular in the US which is why I think you were the first to run into this. It will be fixed in the next release.

  11. Thanks for looking into the bug.

    While we are on the subject of acids I would like to ask your advice. I was trying out CRS because I am in an area with moderately hard water and got fed up with boiling when making lighter coloured ales. However, I don’t really like that fact that the anion content is increased so much, especially the chloride level. Reading around the forums people seem put off using lactic acid because of the risk of sour flavours and also worry about interfering with the malt phosphates if they add phosphoric acid.

    So my question to you is given the choice of CRS, lactic acid or phosphoric acid to reduce the alkalinity of the water by about 150 ppm for British style ales that predominantly use Maris Otter which would you choose?

    Sorry if this is out of place here.

  12. Hello again Kai

    I think I have spotted another small error in your water calculator.

    In the target water section the order for the ions is Ca, Mg, Na, SO4, Cl

    In the Overall Water Report section the SO4 and Cl are switched around.

    When playing with the salt additions I seemed to notice that the Range Check indicators under each ion in the Overall Water Report section are in the wrong order.

    That is, when the chloride is too high the sulphate has a warning and via versa.

  13. Kai,

    A quick question. I’m taking the lazy way out this weekend and making an extract brew instead of all grain, but had a question on the calculator. I am attempting to add salts to my water to match your “Light Colored and Hoppy” profile. When entering the water volume, I’ve entered it all into sparge. Should I be entering my pre-boil volume or the amount after the boil? Even though it’s an extract recipe, I am doing a full wort boil. It’ seems I should be entering the target post boil volume to get the concentrations correct. Is that right?

    • Kev,

      Chalk can only be handled by the calculator when there is a mash, which requires grain to be specified. I’ll need to add some warning for that case. The issue with chalk is that it does not dissolve much in plain water.

      I should add a note for this to the overall water report when a user added chalk but no grist.

  14. Pingback: pH – Martin vs. Kai | Unlucky Brewing

  15. This spreadsheet is beautiful, Kai! I have one question in regards to malted (white) wheat. I’ve read that the pH of white wheat in distilled water is 6.04, which is a little higher than most base malts. How can I account for this in the spreadsheet? Thank you, sir!

  16. Hi Kai, I use this calculator regularly and think it’s great, except for the fact that calcium sulfate isn’t included. It’s a salt I regularly use and so find myself checking the molar values for oxygen and hydrogen and having to calculate the difference between gypsum and plain old CaSO4, then work out how much I’ll need. I hope any future revisions can include it!

  17. Kai,

    Enjoy the calculator! When using things like flaked barely for a stout, how would I enter it into the calculator? Also, the Dublin water profile…is that a actually a profile to mimic for a dry stout? Even with the dark grain the ph doesn’t get in the right range without adding more acid to the mash; then your lowering the bicarbonates anyways?

  18. Hi Kai,
    I’m about to use that wonderful calculator for the first time and I have a question concerning sparge water.
    Does the estimated ph water value (and needed acid additions) change between “batch” and “fly” sparge techinques?
    Because in batch sparge, where you mix again the grains with the sparge water in the lauter tun, in theory, some of the water retained by the grains from the first run-off (which is supposed to be at ph 5.4) is mixed with a certain fixed amount of sparge water. Since the grains retain an amount of water between 0.8 and 1 lt/kg, in my opinion is an high quantity of water to accout for but maybe I’m missing some point.
    Since I do batch sparge and I’m going to acidify sparge water, should I correct in some way the estimated amount of needed acid to target the right ph?

    Andrea Berardi

Leave a Reply

Your email address will not be published. Required fields are marked *


five × 3 =