1 Introduction

Ammonia (NH3) is one of the chemically and biologically reactive nitrogen (N) compounds that is associated with adverse effects to the environment including damage to N-sensitive ecosystems and contributing to visibility impairment and degradation of air quality through the formation of ammonium containing aerosols when released to the atmosphere [1, 2]. Thus, it is imperative to manage NH3 in sources like animal agriculture that contribute to its loss to the atmosphere. Minimizing or preventing NH3 loss to the atmosphere is not only good for the environment but also results in preserving the N content and fertilizer value of stored manure [3, 4]. This study uses as a reference, dairy farms, where the three primary sources of NH3 are animal housing, manure storage, and crop or pasture lands. Specifically, the study addresses N-cycling in manure during storage. Developing appropriate mitigation strategies to prevent NH3 losses from stored manure to the atmosphere starts with the knowledge of the quantity of NH3 produced and released [5, 6].

Methods for quantifying NH3 losses from on-farm sources include direct measurements, emission factors, empirical models, and process-based models (PBMs) [6, 7]. Direct measurement is the most desirable method for quantifying NH3 losses; however, implementing it can be challenging and expensive, depending on the site and the equipment and skill level required to set up and conduct the work [8, 9]. Using emission factors and empirical model approaches to estimate NH3 losses are convenient but are sometimes unreliable because of the differences in management practices and weather conditions (e.g., temperature, wind speed, relative humidity, etc.) that influence NH3 emission at study locations compared to the application site [6]. The National Research Council (NRC), 2003 [6], recommended using PBMs to overcome the challenges in quantifying NH3 emissions. The NRC stated that PBMs developed using well-defined and known physical and biogeochemical processes occurring in manure during storage provide a better mathematical understanding and simulation of the dynamics of the NH3 emission process. Since the NRC recommendation about using PBM was published, many scientists have developed variants of PBMs to estimate NH3 emission from animal feeding operations [10,11,12,13,14], some of which include modules for manure storage. Briefly, the published PBMs pertinent to this study include manure denitrification–decomposition (Manure-DNDC) [12], integrated farm system model (IFSM) [14], dairy gas emissions model (DairyGEM) [13], process-based ammonia emission model (PBAEM) [11], and farm emissions model (FEM) [10]. In general, these models use sub-models (sub-modules) to simulate the various components or functions of a dairy farm (e.g., feedlot, housing, and manure storage structure) to estimate NH3 emissions from the whole farm. Specific to manure storage, the storage sub-model of the Manure-DNDC simulates the transformation of manure carbon (C) and nitrogen (N) during storage and then uses the resulting by-products to estimate emissions of NH3 and other manure gases, i.e., carbon dioxide (CO2), methane (CH4), and nitrous oxide (N2O), nitric oxide (NO), and dinitrogen (N2). Similarly, the IFSM and the DairyGEM storage sub-model also estimate the emissions of multiple pollutants NH3, N2O, CH4, CO2, hydrogen sulfide (H2S), and volatile organic compounds (VOC) by simulating the C, N, and sulfur (S) transformation in the stored manure. In contrast, the PBAEM and the FEM storage sub-models estimate only NH3 emission from stored manure.

In this study, the common PBMs currently used to estimate NH3 emissions are considered non-compartmental. Briefly, non-compartmental PBMs assume and consider stored manure as a single homogenous material with uniform properties and characteristics. In reality, this assumption is not accurate. The conditions in manure storages are heterogeneous and diverse, with spatial variability in physical, chemical, and biological aspects. Missing to address the spatial variability of the manure characteristics such as temperature and total ammonia nitrogen (TAN) concentration during storage [3, 15, 16] is a potential cause of inadequate quantification of nitrogen by the models. Given the knowledge that manure continuously undergoes a series of microbial and biogeochemical reactions and is exposed to variable and changing weather conditions, the assumptions of the non-compartmental PBM need adjustment. This study uses a compartmental PBM approach to capture the spatial variation in pertinent parameters that impact ammonia production and emissions in a manure storage pit as a method to improve the accuracy of model output. The compartmental PBM considers the stored manure as a series of smaller, vertically layered compartments with different characteristics that interact with each other. Implementing the compartmental PBMs in this manner has the potential to improve the accuracy of models due to the ability to estimate and to use the spatially varying parameters in the overall calculation of material emitted [17].

The objective of this study was to develop a new approach for estimating the production and emission rates of NH3 from liquid dairy manure during storage in a tank or pit using a compartmental PBM method to replace the current non-compartmental PBM. The two modeling approaches used similar fundamental equations and processes that describe NH3 production, release, and emissions from manure pit during storage. We assessed the performance of the models by comparing their outputs, i.e., the ability to predict the quantity of NH3 emitted and the associated manure characteristics (temperature and TAN) during the storage period.

2 Model development

2.1 Models description and processes pertinent to NH3 production and emission

Manure storages are complex dynamic systems that integrate simultaneous physical and biogeochemical processes that enhance the degradation of manure resulting in the release of manure gases to the atmosphere. The processes (physical and biogeochemical) considered in developing models for NH3 production and emission during the storage period are in Fig. 1. Ideally, the models should calculate the (1) required storage volume, changes in stored manure volume and depth, and material balance; (2) heat exchange or transfer within the stored manure; (3) manure organic nitrogen (Org-N) mineralization; (4) diffusion of total ammonium nitrogen (TAN) in the bulk stored manure; and (5) NH3 volatilization from the surface of the stored manure. Although not listed explicitly, the influence of pH on NH3 release is included in the calculations of the fraction F, during ammonia volatilization. In this study, the equations describing similar processes in the compartmental and non-compartmental PBMs were the same and also identical to those used in implementing NH3 emissions estimates in the commonly used PBMs, such as Manure-DNDC [12], IFSM [14], and PBAEM [11].

Fig. 1
figure 1

Biological, chemical, and physical processes pertinent to ammonia production and emission from stored liquid dairy manure considered in developing the process-based models

The compartmental PBM included all the subroutines listed above, while the non-compartmental PBM had four subroutines: storage size, manure volume/depth change, manure TAN, and ammonia volatilization. The input parameters and their units used in both the compartmental and non-compartmental PBMs are in Table 1. The processes and the flow diagram for implementing the compartmental PBM are in Figs. 2 and 3, and the flow diagram for the non-compartmental PBM is in Fig. 4. The models calculated the size of a storage tank required using the basic equations for standard geometrical (circular, rectangular) shapes based on model inputs. The manure volume introduced into storage each day was used for material (manure and water) balance calculations to estimate the changes in the total depth of manure in the storage structure at each time step. In the compartmental model, the heat transfer subroutine predicted the temperatures at various depths of the stored manure. The estimated temperatures were used in the TAN subroutine to calculate the rates of Org-N mineralization and TAN concentration at different depths at each time step. The distribution of spatially in the stored manure is driven by the concentration gradient, which is estimated by the NH3 transfer subroutine. Lastly, the NH3 volatilization subroutine calculates the NH3 loss from the surface of stored manure to the atmosphere. Unlike the compartmental PBM, the non-compartmental PBM does not include sub-models (heat transfer and ammonia transfer) to estimate the spatial distribution of manure temperature and TAN.

Table 1 List of the input parameters for compartmental and non-compartmental models
Fig. 2
figure 2

Physical and biogeochemical processes simulated in the compartmental process-based model

Fig. 3
figure 3

Flowchart for implementing the compartmental process-based model

Fig. 4
figure 4

Flowchart for implementing the non-compartmental process-based model

2.2 Processes and model equations

2.2.1 Materials balance in manure storage

The model simulated the process of storing manure for 6 months. The material balances considered daily averages of manure scraped from the barn floors, precipitation, evaporation, and storage effluent removed for land application. The tank capacity or size required was calculated using the American Society of Agricultural and Biological Engineers (ASABE) guidelines, i.e., the Manure Storages standard ASAE EP393.3 [18] and Manure Production Characteristics standard ASAE D384.2 [19]. Material balance for manure and water from rainfall at each time step followed the mass balance equations outlined in Zhang et al. [11]. The assumptions for completing the material balance included impermeable bottom and sidewalls of the storage tank; minimal material loss through biologically mediated gases, e.g., CH4, CO2, and H2S, similar to [11]; and no recycled wash liquid used when scraping manure from barn floors. The manure depth in the storage tank changes daily, depending on the quantities of materials fed or removed from storage. The sidewalls of the storage structure were perpendicular to the ground surface.

2.2.2 Heat transfer and temperature profile in stored manure

The manure temperature at different depths was estimated using the transient heat conduction equation by Nellis and Klein [20] assuming that heat transfer occurs only vertically along the depth profile (z-direction); temperature variation in the horizontal direction is negligible; and manure properties (density, heat capacity, thermal conductivity, and internal heat generation) remain constant in space and time. We used the one-dimensional (1-D) transient heat transfer Eq. (1), discretized by the finite difference method. Using the 1-D approach for temperature simulation has been reported as adequate by Rennie et al. [21]. The finite difference method used to discretize the heat transfer equation presents adequate computational tractability and ease of application to the geometry resulting from accumulating manure during the storage period.

$$\frac{\partial T}{\partial t} = \frac{k}{\rho \,c}\left( {\frac{{\partial^{2} T}}{{\partial \,z^{2} }}} \right) + \frac{Q}{\rho \,c}$$
(1)

where k is the thermal conductivity of manure (W m−1 °C−1), Q is the internal heat generation rate per unit volume (W m−3), ρ is the density of manure (kg m−3), c is the specific heat of manure (J kg−1 °C−1), T is the temperature (°C), z is the depth of manure (m), and t is time (h).

Discretization entailed dividing the manure depth into sections with defined points (nodes) to solve the heat Eq. (1). The discretization process resulted in forming a grid containing i layers (elements) of the stored manure with a thickness of ∆z and corresponding i + 1 nodes. The manure storage structure was assumed to be open to the atmosphere. The manure temperature at the surface (interface with the ambient air) depends on external factors, e.g., ambient air temperature and wind speed. These external factors were estimated using the average daily ambient air temperature, Eq. (2), described by Stefan and Preud’Homme [22].

$$T_{\text{S}} = 5.0 + 0.75\;T_{\text{A}}$$
(2)

where TS is the surface temperature of the stored manure (°C) and TA is the ambient air temperature (°C).

The model assumed that the temperature of the manure at the bottom of the storage tank (boundary value) was the same as the surrounding soil temperature. The soil temperature at the bottom of the stored manure was estimated using the sinusoidal function by Hillel [23].

2.2.3 Ammonia production and diffusion in stored manure

The TAN concentration in a layer included quantities generated from the mineralization process of organic nitrogen (Org-N) and preexisting quantities in the stored manure. The TAN concentration was calculated using Eq. (3) similar to Zhang et al. [11].

$$C_{{{\text{TAN}},i,n}} = C_{{{\text{TAN}},i,n - 1}} + k_{{\text{ON}}_{20}} \theta^{{(T_{i,n} - 20)}} C_{{{\text{ON}},i,n}}$$
(3)

where \(C_{{{\text{TAN}},i,n}}\) is the concentration of TAN in the ith layer at the end of nth time step (kg N m−3), \(C_{{{\text{TAN}},i,n - 1}}\) is the concentration of TAN in the ith layer at the beginning of nth time step (kg N m−3), \(k_{{{\text{ON}}_{20} }}\) is the rate constant of mineralization at 20 °C (d−1), θ is the temperature coefficient, \(C_{{{\text{ON}},i,n}}\) is the concentration of Org-N in ith layer at nth time step, and \(T_{i,n}\) is the temperature of manure in the ith layer at nth time step (°C).

The changes in TAN concentration in the layers of stored manure occur mainly through diffusion. The diffusion process followed Fick’s second law (Eq. 4) for unsteady-state conditions [24]. In this study, NH3(g) volatilization or loss to the atmosphere occurs from the surface layer and triggers the diffusion process. Briefly, NH3(g) loss to the atmosphere occurs when the concentration of NH3(aq) at the surface layer is lower than the concentration in bulk of the stored manure, creating a gradient. This concentration gradient then triggers the process of NH3 diffusion from the bottom to the top layers of the stored manure. The finite difference method and discretization techniques similar to that used in the heat transfer section were used to solve the partial differential Eq. (4) to calculate the concentration at each node along the z-direction.

$$\frac{\partial C}{\partial t} = D\left( {\frac{{\partial^{2} C}}{{\partial z^{2} }}} \right)$$
(4)

where D is the diffusion coefficient of NH3 (m2 h−1), C is the concentration of NH3 (kg N m−3), z is the depth of manure (m), and t is time step (h).

2.2.4 Ammonia volatilization

The volatilization or loss of NH3(g) from the surface of the stored manure to the atmosphere followed the two-phase boundary layer process described by De Visscher et al. [25]. This process follows a two-step mass transfer process involving diffusion of NH3(aq) from manure bulk liquid to liquid–gas interface and convective NH3(g) transfer from the liquid–gas interface to the atmosphere governed by Eq. (5).

$$M_{{{\text{NH}}_{3} }} = K_{\text{L}} (F\,C_{\text{L}} - C_{\text{A}} )$$
(5)

where \(M_{{{\text{NH}}_{3} }}\) MNH3 is the NH3 emission rate from manure surface (kg m−2 s−1), CL is the concentration of TAN in the top layer of stored manure (kg m−3), CA is the concentration of TAN in the air (kg m−3), F is the fraction of free ammonia present as TAN, and KL is the mass transfer coefficient (m s−1).

The mass transfer coefficient (KL) of NH3 was calculated using Eq. (6). The details on how to calculate Henry’s constant (H) and mass transfer coefficients of NH3 in the liquid phase (kL) and gas phase (kG) are in [25].

$$K_{\text{L}} = \frac{{k_{\text{L}} H\,k_{\text{G}} }}{{k_{\text{L}} + H\,k_{\text{G}} }}$$
(6)

where H is Henry’s constant, kL is the mass transfer coefficient of NH3 in the liquid phase (m s−1), and kG is the mass transfer coefficient of NH3 in the gas phase (m s−1).

3 Selecting computational platform and model algorithm development

The codes for compartmental and non-compartmental PBMs were developed in MATLAB software (MATLAB 2016a version 9.0). The MATLAB platform provides a convenient and amenable programming environment that allows quick algorithm testing without recompilation. The flowcharts providing the basis for the algorithms used for the compartmental and non-compartmental PBM are in Figs. 3 and 4, respectively. The compartmental PBM (Fig. 3) assumes that manure depth in the storage structure changes with new material added daily. The manure added each day was considered to spread uniformly over the top layer of the stored manure with no mixing between layers. The geometry used for heat transfer and material balance changes with the addition of new manure daily. The model assumes that 0.3 m of manure is present in the storage tank at the beginning of the storage period and new material added once every day (24-h period). The change in manure depth during the storage period depends on the flow of materials depicted in Fig. 5. The geometry used for heat and material balance calculations was modified on a daily (1 day or 24 h) time step. In applying the compartmental PBM, the manure in storage was discretized by setting the thickness (∆z) of each manure layer to 0.01 m and nodes defined at the boundaries (Fig. 5). At each time step, a new geometry was created by adding a new layer of manure to the quantity at the previous time step and new sets of manure properties calculated. The process repeats for 180 days, i.e., the time assumed for the manure storage to fill up before being emptied. For the non-compartmental PBM, the incoming manure is mixed in with the existing batch, and new material balances and other manure characteristics and model attributes are calculated for the entire new volume (Fig. 4).

Fig. 5
figure 5

Representation of modeled material flows, manure layers, and manure depth during storage

4 Model evaluation

The model evaluation comprised calibration and performance assessments using data from a field study at a lagoon in a dairy farm in Jasper Co., Indiana, by Grant and Boehm [26]. We divided the experimental data into two periods, May 29 to August 17, 2009 (Period I), and March 12 to April 27, 2009 (Period II). The data from Period I and Period II were used for model calibration and performance assessment, respectively. The number of data points was 81 and 47 for Periods I and II, respectively. Although not ideal, the dataset used was the most complete we found in the literature to calibrate and perform assessments of our model. The experimental data reported daily NH3 emissions (g m−2 day−1), average ambient air temperature, and manure pH. We obtained other model input parameters, such as wind speed, relative humidity, and precipitation, not reported as part of the dataset from NCEP [27].

First, we calibrated the models by fine-tuning the parameters pertinent to NH3 diffusion, NH3 volatilization, and heat transfer within the manure listed in Table 2, before undertaking the model performance. Each calibration step entailed defining three levels (low, medium, and high) for each model parameter presented in Table 2. The model calibration started by setting all the parameters at their lowest levels and running the simulation with input parameters similar to those of Period I of the field study (i.e., the days of data collection). The values of the parameters were changed one at a time, at the end of every simulation run. The final parameter value was then selected based on the defined model performance criteria. We assessed the model performance using the magnitudes of the Pearson’s correlation coefficient, r, Eq. (7), and the normalized mean square error, NMSE, Eq. (8) resulting from comparing the model estimated and experimentally derived NH3 emission rates [32]. Typically, values of r range from − 1 to 1, with values close to 1, suggesting excellent model performance and a strong positive relationship between experimentally derived and predicted values. The NMSE is a measure of the overall deviation between experimental and predicted values. NMSE values of zero indicate a perfect model, while NMSE values < 0.25 imply adequate model performance.

$$r = \frac{{\sum\nolimits_{i = 1}^{n} {\left( {Y_{\text{Oi}} - \overline{Y}_{\text{O}} } \right)\left( {Y_{\text{Pi}} - \overline{Y}_{P} } \right)} }}{{\sqrt {\sum\nolimits_{i = 1}^{n} {\left[ {\left( {Y_{Oi} - \overline{Y}_{O} } \right)^{2} } \right]\left[ {\sum\nolimits_{i = 1}^{n} {\left( {Y_{Pi} - \overline{Y}_{P} } \right)^{2} } } \right]} } }}$$
(7)
$${\text{NMSE}} = \frac{{\sum\nolimits_{i = 1}^{n} {\left( {Y_{\text{Pi}} - Y_{\text{OI}} } \right)^{2} } }}{{n\overline{Y}_{\text{O}} \overline{Y}_{\text{P}} }}$$
(8)

where r is the Pearson’s correlation coefficient, NMSE is the normalized mean square error, YOi is the experimentally derived NH3 emission rate (g m−2 day−1), YPi is the predicted NH3 emission rate (g m−2 day−1), \(\bar{Y}_{\text{O}}\) is the average of experimentally derived NH3 emission rates (g m−2 day−1), \(\overline{Y}_{\text{P}}\) is the average of predicted NH3 emission rates (g m−2 day−1), and n is the number of observations.

Table 2 Range of parameters values used in model calibration and the selected parameter values after calibration

The model performance was conducted by running simulations to generate NH3 emission rates using the calibrated model parameters and the weather data corresponding to Period II (March 12 to April 27, 2009) of the field study (Table 3). The r and NMSE were calculated to evaluate the agreement between the experimental and model estimated NH3 emissions data for Period II. The differences between the experimentally derived ammonia emission rates and the predicted ammonia emission rates by the compartmental and non-compartmental PBMs were calculated, and statistical significance tested using a t test, with the p value set at 0.05.

Table 3 Summary of input data used for model verification

4.1 Sensitivity analysis

Sensitivity analysis to ascertain the contribution of the input parameters and their interactions to the variance of outputs of the compartmental and non-compartmental PBMs was conducted using the global sensitivity analysis (GSA) approach by Saltelli et al. [34]. We ran a total of 100,000 Monte Carlo simulations using model input parameters randomly drawn from their expected ranges (Table 4). The input parameter values were considered uniformly distributed within the listed ranges. The results from the Monte Carlo simulations were used to calculate the sensitivity coefficients of the input parameters and their interactions to assess their impact on the model output [34, 39]. The sensitivity coefficients were ranked by order (e.g., first order, second order) and magnitude. In general, the influence of parameters or parameter interactions on the model output is directly proportional to the size of the coefficient, i.e., the larger the factor, the more significant the impact.

Table 4 Model input parameter variables and their ranges used for the sensitivity analysis

4.2 Scenario analysis

A scenario analysis was performed to compare the NH3 emission rates from manure during storage predicted by the compartmental and non-compartmental PBMs for a 100 milking herd dairy farm. The farm location was assumed to be Rockingham County, Virginia. The NH3 emission rates were estimated for two storage periods designated as “warm” (May to October) and “cool” (November to April), consistent with the typical farm operations in Rockingham County. The daily manure production of 68 kg (150 lbs) for a 635 kg (1400 lbs) lactating cow as listed in the Manure Production Characteristics standard ASAE D384.2 [19] was used. The farm was considered to use a scrape system to move manure from the barn floors and to a concrete storage tank with enough capacity to store manure for 6 months (180 days). The model assumed the pit was full on April 30, the end of the cool period, and empty on May 01 to start the Warm period. The same assumption was made for the transition from the warm to the cool period in October/November. We acknowledge that in real life, emptying manure pits may take days to be completed. Our assumption was a simplification to implement the first edition of the model. The manure properties used were obtained from Collins et al. [40], a study that collected and characterized manure for a biogas digester on a dairy farm in Virginia. Historical weather data, namely average daily ambient air temperature, relative humidity, wind speed, and total precipitation for Rockingham County, Virginia from January 01, 1979, to July 31, 2014, was obtained from the National Centers for Environmental Prediction (NCEP) [27] for use in the study. The average value for each weather parameter was calculated for each Julian day (from Jan 01 to Dec 31) from the dataset and used as model input parameters in the scenario analysis. The average daily NH3 emission rates, manure spatial TAN concentrations, and manure temperatures predicted by the two models for each storage period recorded from the model runs. The daily NH3 emission rates predicted by the compartmental and non-compartmental PBMs were compared using paired t-tests.

5 Results and discussion

5.1 Model evaluation and sensitivity analysis

The calibrated model parameter values used in the model simulations are presented in Table 2. The magnitudes of most of the calibrated parameters fell in the upper range of literature values. The average daily NH3 emission rates estimated by the PBMs compared to those derived empirically from measurements at the manure storage at the dairy farm in Jasper Co. Indiana [26] are presented in Fig. 6. The magnitudes and trends of NH3 emissions rates by the three methods were similar during the March 12–April 27, 2009, measurement period when the data used for model evaluation were obtained. The experimentally derived and modeled NH3 emission rates tracked the ambient air temperature, TA. No discernible trends were observed between the average NH3 emissions rates and wind speed, relative humidity, and precipitation (Fig. 6). The average NH3 emissions rates estimated from experimental data, compartmental PBM, and non-compartmental PBM during the measurement period were not significantly different (p > 0.05) from each other with absolute values of 2.1 (± 0.1), 1.5 (± 0.2), and 2.2 (± 0.6) g m−2 day−1, respectively. The NH3 emission rates predicted by both PBMs were close in magnitude to the experimentally derived rates, especially when the ambient air temperature was ≤ 10 °C. However, when the ambient air temperatures were above 10 °C (e.g., after April 22), the NH3 emissions rates predicted by both models were much larger than the experimentally derived. In fact, at ambient air temperatures above 10 °C, the non-compartmental PBM predicted more than double the estimates by the compartmental PBM and empirically derived values. The corresponding average ambient air temperature, relative humidity, wind speed, and precipitation during the period data for verification collected were 7.8 (± 0.8)  °C, 80 (± 1.3)  %, 4.3 (± 0.3) ms−1, and 0.47 (± 0.11) cm, respectively.

Fig. 6
figure 6

Pertinent weather data and ammonia emission rates by the compartmental model, non-compartmental model, and experimentally derived for a dairy lagoon in Jasper County, IN during Period II (March 12, 2009 to April 27, 2009) of the field measurements

The r-values for the differences between the empirically derived and modeled average daily NH3 emission rates were positive, based on the model performance criteria defined for this study. The r-values were 0.49 and 0.54 for the compartmental and non-compartmental PBMs, respectively. According to ASTM [32], r-values close to 1.0 denotes excellent model performance. Thus, we presume an average performance by both PBMs in this study, based on these r-values. The NMSE for the model performance generated by comparing experimentally derived NH3 emission rates to those predicted by the compartmental and non-compartmental PBMs were 0.75 and 2.65, respectively. These NMSE values suggest both the compartmental and non-compartmental PBMs did not have a strong performance based on the criteria outlined in [32], i.e., NMSE values ≤ 0.25 for strong performance. However, the lower NMSE value for the compartmental model suggests a better performance compared to the non-compartmental PBM. Since the main improvement to the compartmental PBM was the incorporation of spatial heterogeneity compared to the non-compartmental PBM, this result suggests that enhancement of the compartmental PBM has the potential of improving the accuracy of estimating NH3 emissions from stored manure. Also, model performance depends on the accuracy of the measured data and estimates of model parameters. The Grant and Boehm [26] dataset used in this study reported measurement errors of up to 24%. The errors reported for the measured field dataset and those inherent in the model parameter estimates may have contributed to the lack of strong model performance obtained in this study. However, because this is a comparative study of a compartmental and non-compartmental modeling approaches, the consistency and closeness between the modeled and experimentally derived results were used to judge model performance. The results of the comparisons suggest that the compartmental PBM is suitable for use as a predictive tool for estimating ammonia emission rates because it was consistently closer to the measured data compared to the non-compartmental PBM results. We acknowledge and caution careful use of the model for dynamic systems like manure pits where changes may happen in unanticipated ways, being biological nature and management. Additionally, we also acknowledge the need to verify and challenge the model with data collected beyond over a more extended period than the single year as used in this study. Still, we consider the result of this study satisfactory given this was the first generation of the model.

The sensitivity analysis coefficients (Table 5) indicate how the input parameters and their interactions affected the outputs of the compartmental and non-compartmental PBMs. The sensitivity analysis coefficients for both models were identical for each parameter and indicated that ambient air temperature, manure pH, wind speed, and the concentration of TAN in the lagoon were the most critical model input parameters (in that order). For both models, the single-input parameters accounted for 65% of the model variance of the average daily NH3 emission rates, and the two- and three-way input parameter interactions accounted for 30% and 5% of the variability of the average daily NH3 emission rates, respectively. The ambient air temperature (used to estimate manure temperature) had the highest total effect in both models, explaining 23% of model output variance, supporting the observation that NH3 emission rates (measured and modeled) tracked TA (Fig. 5). Manure pH, wind speed (Uz), and TAN concentration of manure (CTAN) contributed 19%, 17.5%, and 4%, respectively, to the variance of output of both the models. Interaction of ambient air temperature and pH (TA pH), ambient air temperature and wind speed (TA Uz), and wind speed and pH (Uz pH) had more influence on variance of model output compared to other second-order interactions. These results are qualitatively similar to GSA for a non-compartmental PBM for ammonia emissions for a swine manure lagoon reported by Ogejo et al. [39]. Although pH is an essential factor in the dynamics of ammonia emissions from manure, its role becomes substantial at values above 9.2 when the volatile fraction of TAN, i.e., NH3 present in a solution, is 50% [41]. At the manure pH range used in this study, i.e., 6.5–7.5, less than 10% of TAN is present as NH3, perhaps reflected in the magnitude of sensitivity coefficient obtained in this study. We acknowledge that if it is necessary for future versions of the model to consider a subroutine for pH as part of the model improvement, some of the ideas presented by Hafner and Bisogni [42] could be used to guide that process.

Table 5 Global sensitivity analysis coefficients for the model input parameters

5.2 Scenario analysis

5.2.1 Ammonia emission rates

The estimated NH3 emission rates from stored manure during the warm and cold periods by the compartmental and non-compartmental PBMs are in Figs. 7 and 8, respectively. The NH3 emission rates tracked the ambient air temperature for both models, while no discernible patterns were observable for wind speed, RH, and precipitation (Figs. 7 and 8). In general, the compartmental PBM always predicted lower ammonia emissions compared to the non-compartmental PBM (Figs. 7 and 8). However, during the colder months between November and March (Fig. 8), the emissions predicted by both models were almost similar. The average NH3 emission rates predicted by the compartmental and non-compartmental PBMs for the warm period (May to October) were 0.91 g m−2 day−1 and 1.37 g m−2 day−1, respectively. During the cold period (November to April), the predicted average NH3 emission rates were 0.33 g m−2 day−1 and 0.46 g m−2 day−1 for the compartmental and non-compartmental PBMs, respectively. The NH3 emission rates increased with ambient air temperatures and vice versa. This outcome is similar to observations made during the model evaluation process, and the results from sensitivity analysis reflecting the models were most sensitive to ambient air temperature. Both models predicted higher NH3 flux during the warm period compared to the cold period, a result consistent with the average ambient air temperatures, 19.1 (± 0.3) and 4.5 (± 0.3)  °C during the warm and cold periods, respectively. Overall, the results showed high correlations between the ambient air temperature and NH3 emissions during both the warmer and colder periods (Pearson correlation coefficient (r) greater than 0.9 for both the models), a result consistent with findings reported by [43]. There were no discernable trends between NH3 flux with the RH, wind speed, and precipitation (Figs. 7 and 8). The estimated ammonia emission rates predicted by both the compartmental and non-compartmental PBMs in this study were less than the values reported in the literature (i.e., 5–6.5 g m−2 day−1) for warm periods of the year at different locations around the world (35, 37, 38, 45, 47, 48). This difference may be due to the limited data used in developing the model concept presented in this study. Another potential factor contributing to the difference is the differences in the weather conditions at the locations reported in the literature and the farms used in the scenario analysis. Thus, we acknowledge that further evaluation of the model in this study is necessary before their full deployment and use.

Fig. 7
figure 7

Pertinent weather data and ammonia emission rates estimated by the compartmental model and non-compartmental model for the described scenario dairy manure storage in Rockingham County, VA during the warm period (May 01 to October 31)

Fig. 8
figure 8

Pertinent weather data and ammonia emission rates estimated by the compartmental model and non-compartmental model for the described scenario dairy manure storage in Rockingham County, VA during the cold period (November 01 to April 30)

5.2.2 Manure temperature and TAN concentrations

Examples of manure temperature and TAN concentrations predicted by the compartmental and non-compartmental PBMs during each storage period simulated are presented in Figs. 9 and 10. The compartmental PBM showed spatial and temporal changes in manure temperature and TAN concentrations during the storage period (Figs. 9a and 10a). On the other hand, the non-compartmental PBM predicted changes in temporal manure temperature and TAN concentrations that were uniform throughout the bulk of the stored manure at any given time, for the entire bulk of the stored manure at any given time (Figs. 9b and 10b). The compartmental PBM captures and reflects the influence of ambient air temperatures on stored manure temperatures, as would be expected, at different depths during the storage period. Under normal circumstances, temperature differences between the top and bottom layers of stored liquids in open structures are expected, and the compartmental PBM developed in this study was able to capture this phenomenon. During the warm period (between May and October), the temperature of the manure in the top layer is higher than the bottom layers (May to August) when ambient air temperatures are typically high. As the ambient air temperatures cool off, the bottom layers of the stored manure become warmer than the top layer. The reverse of the temperature differential process between the top and bottom layers of stored manure happens during the cool storage period. These modeled results are consistent with results studies that have reported temperature variability by depth in manure pits [15, 21] and lagoons [44].

Fig. 9
figure 9

Temperatures and total ammonia nitrogen (TAN) concentration of stored manure estimated by the compartmental and non-compartmental process-based model for the scenario dairy manure storage in Rockingham County, VA during the warm period (May 01 to October 3)

Fig. 10
figure 10

Temperatures and total ammonia nitrogen (TAN) of stored manure estimated by the compartmental and non-compartmental process-based model for the scenario dairy manure storage in Rockingham County, VA during the cold period (November 01 to April 30)

The compartmental PBM predicts differentiated manure TAN concentration at different depths (layers) during the storage period, while the non-compartmental PBM predicts uniform TAN concentration in the manure pit (Figs. 8 and 9). The compartmental PBM showed that manure TAN concentrations were higher in the bottom compared to the top layers during storage. This result is qualitatively similar to observations by VanderZaag et al. [45] and computer simulations and laboratory results reported by Muck and Steenhuis [3] for dairy manure storage and Zhang et al. [46] for swine manure pit. Higher TAN concentration at lower depths can be attributed to the slow diffusion of NH3 thorough manure [3, 46] and ammonification of organic nitrogen in the bottom layers due to the settling process. Further, during the cooler period, the stored manure TAN concentration was lower compared to warmer months. This could be due to decreased biological activities (e.g., mineralization of Org-N) contributing to generations of TAN at a lower temperature.

6 Conclusion

This study successfully developed a compartmental process-based model to estimate NH3 emission rates from stored liquid dairy manure. The ability of the compartmental process-based models to predict the factors that affect NH3 production and emission spatially and temporally provides a tool that enables the depiction of and potentially improving our understanding of the differentiation of the manure physical and chemical properties and their impacts on the biogeochemical processes that affect NH3 production and release. Thus, the implementation of compartmental process-based models will add value in the tasks of (1) designing mitigation methods, (2) farm-scale models for nitrogen accounting, and (3) life cycle assessment models that include manure storages. The incorporation and depiction of the heterogeneity of environmental factors, manure characteristics, and biogeochemical reactions in the compartmental process-based model provided a realistic and better representation of NH3 emissions from manure storages. Although the magnitudes of NH3 emission rates predicted by the compartmental process-based model were generally lower compared to the commonly used non-compartmental process-based modeling approach, the results should be interpreted with caution. The work presented in this study represents the beginning and a demonstration of a method to estimate NH3 emissions from manure pits that capture spatial variability. Indeed, more work is needed to include to verify further and refine the spatial variability concept to include other factors not reported in this study such as microbial communities, manure solids, crusting at the surface of stored manure, and other nutrients impact the rate of biogeochemical reactions related to production and emission of NH3, need to be studied and used to improve the model.