Reconciling the units of pH calculation As part of a simulation I am developing I have an acid in aqueous solution represented as a concentration field of mass density (units g/L) at various points in space (denoted $[S]$). I want to calculate the pH of the solution. I am attempting to use the method for weak acids outlined here, but am struggling with the dimensionality of the variables,

$$[H]^2 + K_a [H] - K_a C_a = 0.$$

Looking at the quadratic equation, and knowing that $K_a$ has no units, it implies that $[H]$ and $C_a$ are also dimensionless. Does this mean that $[H]$ is in fact the activity of the the solution, and not the $H^+$ concentration? And is the relationship between $C_a$ and $[S]$ $$C_a = \gamma \frac{[S]}{M(S)c^\ominus},$$

where $\gamma$ is the activity coefficient, $M(S)$ is the molar mass of the acid, and $c^\ominus = 1$M is the standard amount concentration?

Followup question:

The solution to the quadratic equation is

$$[H] = \frac{-K_a \pm \sqrt{K_a^2 + 4K_a C_a}}{2},$$

thus $[S] = 0 \implies [H] = \frac{-K_a \pm K_a}{2} = -K_a$ or $0$.

As $pH = -\log_{10}\left([H]\right)$ and $K_a &gt; 0$  there is no real solution, but logic would dictate that $pH = 7$ in this case. Where am I going wrong?
$K_a$ is not unitless (in this case). Some equilibrium constants may have their units totally cancel, but the acidity constant has units of concentration:

$$K_a = \dfrac{[\ce{H+}][\ce{A-}]}{[\ce{HA}]}\implies\dfrac{\frac{\text{mol}}{\text{L}}\cdot\frac{\text{mol}}{\text{L}}}{\frac{\text{mol}}{\text{L}}}=\frac{\text{mol}}{\text{L}}$$

I have used moles per liter (molarity) as it is a common concentration unit.

In this case, $K_a$ and $[\ce{H+}]$ both have concentration units, as does $C_a$, so your initial equation $[\ce{H+}]^2 + K_a [\ce{H+}]+ K_a C_a =0$ is valid (at least for units. 

If you recast $K_a$ and $C_a$ in terms of activities, then you need to replace $[\ce{H+}]$ with $\alpha_{\ce{H+}}$ (which is unitless).