Concentration Gradients of Ammonia, Methane, and Carbon Dioxide at the Outlet of a Naturally Ventilated Dairy Building

: In natural ventilation system-enabled dairy buildings (NVDB), achieving accurate gas emission values is highly complicated. The external weather affects measurements of the gas concentration of pollutants ( c P ) and volume ﬂow rate ( Q ) due to the open-sided design. Previous research shows that increasing the number of sensors at the side opening is not cost-effective. However, accurate measurements can be achieved with fewer sensors if an optimal sampling position is identiﬁed. Therefore, this study attempted to calibrate the outlet of an NVDB for the direct emission measurement method. Our objective was to investigate the c P gradients, in particular, for ammonia ( c NH 3 ), carbon dioxide ( c CO 2 ), and methane ( c CH 4 ) considering the wind speed ( v ) and their mixing ratios ([c CH 4 /c NH 3 ]) at the outlet, and assess the effect of sampling height (H). The deviations in each c P at six vertical sampling points were recorded using a Fourier-transform infrared (FTIR) spectrometer. Additionally, wind direction and speed were recorded at the gable height (10 m) by an ultrasonic anemometer. The results indicated that, at varied heights, the average c NH 3 ( p < 0.001), c CO 2 ( p < 0.001), and c CH 4 ( p < 0.001) were signiﬁcantly different and mostly concentrated at the top (H = 2.7). Wind ﬂow speed information revealed drastic deviations in c P , for example up to + 105.1% higher c NH 3 at the top (H = 2.7) compared to the baseline (H = 0.6), especially during low wind speed ( v < 3 m s − 1 ) events. Furthermore, [c CH 4 /c NH 3 ] exhibited signiﬁcant variation with height, demonstrating instability below 1.5 m, which aligns with the average height of a cow. In conclusion, the average c CO 2 , c CH 4 , and c NH 3 measured at the barn’s outlet are spatially dispersed vertically which indicates a possibility of systematic error due to the sensor positioning effect. The outcomes of this study will be advantageous to locate a representative gas sampling position when measurements are limited to one constant height, for example using open-path lasers or low-cost devices.


Introduction 1.Contribution of Dairy Production in the Global Anthropogenic Emissions
Livestock production emits greenhouse gases (GHG), namely carbon dioxide (c CO 2 ), methane (c CH 4 ), and nitrous oxide (c N 2 O ), which are the primary source of air pollution, with negative consequences for the environment, including humans and animals [1].As per FAO data, c CH 4 accounts for approximately 50% of global GHG emissions from livestock, while c N 2 O and c CO 2 each contribute around 25%. Enteric c CH 4 emissions from ruminants account for roughly one-third of the total anthropogenic emissions [2].Another crucial gaseous pollutant emitted from livestock farming is ammonia (c NH 3 ), which is produced by cow's urine [3,4].About 11% of the c NH 3 emissions in Europe come solely from dairy farming, especially due to their manure management practices [5].Enteric c CH 4 and c CO 2 have a huge global warming potential, whereas c NH 3 leads to environmental issues such as eutrophication, soil acidification, and particulate matter formation in the atmosphere [3].According to IPCC 2019, mitigating c CH 4 , c NH 3 , and c CO 2 emissions from livestock farming are crucial in minimizing global air pollution [6,7].The members of the United Nations have already pledged to mitigate the gaseous emissions that are relevant to climate change [8].In accordance with this, several mitigation strategies to reduce emissions from livestock husbandry and their management practices are already in existence [9].However, the effectiveness of the mitigation strategies can only be assessed with an accurate and precise measuring technique.Correspondingly, the precondition is the accurate measurement of emissions or at least the precise determination of the associated uncertainties of the measurement [10].

Quantification of Emissions from Naturally Ventilated Dairy Buildings
Livestock buildings can be classified as either mechanically or naturally ventilated barns.The former is equipped with mechanical fans and has defined inlets and outlets, whereas the latter eliminates the use of fans with large side openings to allow natural ventilation.The open-sided naturally ventilated dairy barns (NVDB) are popular in temperate climate countries.In Germany, the NVDBs are primarily used for housing dairy cows due to their economic relevance and considered as an animal-friendly housing solution.
However, their open structure makes it difficult to estimate emissions since outside weather conditions have a great interaction with the measurements of the ventilation rate (i.e., volume flow rate) and the target gas concentration of pollutants (c P ) inside the barn [11,12].Principally, the emission of a target gas from NVDB is quantified as the product of Q and c P , hence as the outpointing normal velocity vectors, their associated opening area, and the measured gas concentrations in the volume flow.
According to Wang et al. [13], there are two methods to quantify gas emissions, direct and indirect.In order to estimate emissions by the direct method, the concentration of the target pollutant gas and the velocity of out-flowing air is measured directly at the outlet [14].The volume flow rate (Q) (m 3 h −1 ) can be calculated as the product of the v of the air transporting the pollutant and the A of the outlet.In Equation (1), Q represents the volume flow rate of the pollutant, v is the velocity (m s −1 ) of the pollutant leaving the building, and A is the cross-sectional area (m 2 ) of the flow.
Similarly, the pollutant's concentration in the incoming (c P in ) and outgoing (c P out ) air can be displayed as mass concentration (g m −3 ) and the emission rate (E P ) of the pollutant can be expressed as Equation ( 2).
The indirect method is practiced as an inexpensive alternative, which excludes the usage of velocity sensors to measure the Q [15].In this method, the dilution rate of a tracer with a known release rate is estimated to derive Q.The metabolically produced c CO 2 by cows is commonly used as a natural tracer gas and its rate of release is modeled by the animal heat production [16].In Equation (3), the Q is indirectly calculated by transposing Equation (2), where E T is the release rate (g h −1 ) of tracer gas and c T is the mass concentration (g m −3 ) of tracer gas, corrected by outside concentrations [15].Finally, the indirect ventilation rate formula or Q from Equation ( 3) is substituted in Equation (2), and E P is indirectly estimated as shown in Equation (4).

Challenges in Emissions Quantification and Information Gaps
The main complication in NVDB is the identification of the inlet and outlet due to the large area of side openings [13].Secondly, the external weather impacts the emission estimation as the incoming and outgoing wind is anticipated from all conceivable directions and speeds [17][18][19].The outside ambient and turbulent weather circumstances lead to imperfect gas mixing inside the barn, which can impact both the direct and indirect Q calculations [13,17].
In existing research, investigations using the indirect method in NVDBs have highlighted various factors that introduce uncertainties in emission estimation.For instance, indirect estimation of Q is built upon the assumption of uniform gas distribution within the enclosed barn airspace [15,16].However, this presumption faces challenges due to variables such as animal activity, pregnancy, or milk yield, which impact the modeled heat output and subsequently affect the release rate of c CO 2 , leading to Q estimation uncertainty and potential bias in emission outcomes [20,21].Other studies have also underscored the impact of factors like temperature, relative humidity, and gas sampling positions/strategies on indirect emission estimation in NVDBs [11,19,[22][23][24][25].These factors result in temporally and spatially non-uniform gas release patterns, which, when combined with airflow dynamics, contribute to significant variability in c P [10].Moreover, studies based on VERA [15] demonstrate that gas sampling locations should be 3 m high from the ground and 2 m away from the opening walls [24,25].Notably, while these considerations have been explored in the context of the indirect method, their relevance to the direct method of emission estimation in NVDBs remains largely unexplored to date.
In the direct method, one challenge is to accurately measure the c P and Q at the large side openings that serve as either inlet or outlet based on wind direction.To record spatial fluctuations of c P at the openings, a multitudinous network of sampling lines is required [26].c P can be quantified with a high-frequency gas analyzer like a Fouriertransform infrared spectroscope (FTIR) or a photo-acoustic spectroscope (PAS) equipped with multi-point sampling lines [24,27].But the sampling points in the mentioned gas analyzers are limited to up to 16 ports of the multiplexer, whereby the spatial density is compromised if only one gas analyzer is employed.Similarly, to measure Q in high spatial resolution in parallel to c P sampling locations, it is required to deploy a large number of velocity sensors [13,14].According to De Vogeleer et al. [17] and Janke et al. [26], the measuring accuracy of c P and Q can be improved by increasing the number of sensors at the outlet.However, their high cost is a disadvantage for long-term emission quantification, as it is not economical to add more sensors for recording spatial fluctuations to improve the precision and accuracy of direct measurements [10].

Determining c P Sampling Height for Direct Measurements
Existing literature provides information on the horizontal positioning, i.e., the distance between sensors at side openings [24,28,29].It has been observed that c P measurements exhibit inconsistencies at different horizontal sampling locations within the barn [28].However, limited data is available concerning the vertical spatial variability of c P , specifically at the NVDB side openings.Determining an optimal sampling height has the potential to minimize the measurement of c P across vertical dimensions, particularly in situations where a single sampling line containing multiple critical orifices suffices to capture horizontal fluctuations [29].Furthermore, the selection of sampling height holds significant relevance when utilizing sensors such as open-path lasers, which can only measure at a single, predefined height at a time.

Enhancing Precision in c P Measurement through Gas Mixing Ratio Analysis
In the context of this paper, the mixing ratio is defined as the ratio between the concentrations of two pollutants sampled at a specific time and position; therefore, it is dimensionless.In pursuit of greater precision in the measurement of c P , it is imperative to identify a zone characterized by relatively stable concentrations of all targeted pollutants.This objective can be accomplished through the analysis of mixing ratios within c P .By investigating the gas mixing ratios at various heights, valuable insights can be gained regarding the uniformity of gas distribution at the side opening.Such insights play a pivotal role in the determination of the optimal sensor placement for estimating both the parameters, c P and Q, that are critical factors in enhancing the precision of emission measurements through direct methods [30].
Notably, the information derived from mixing ratios holds significant potential for calibrating the gas sampling height at the outlet when conducting emission measurements through direct methods.Under the assumption of a uniform velocity profile across the measured area for each target gas, it becomes apparent that, even in cases where the average c P values exhibit heterogeneity, their ratios will stabilize at a certain height.This constant ratio serves as a crucial indicator for identifying the optimal sensor position that facilitates simultaneous measurement of the target.

Objective and Hypotheses
Presently, there is no firm recommendation on optimal gas sampling height, which is crucial for accurately quantifying emissions by the direct measurement method.Moreover, the c P ratio can serve as a valuable indicator to identify the optimal c P sampling height, ensuring simultaneous and accurate measurement of all target pollutant gases.Therefore, this study focused mainly on the vertical dispersion of three target pollutants (c P ) which are further referred to as c CO 2 , c CH 4 , and c NH 3 .
To date, there has been no prior investigation into the assessment of gas mixing ratios, particularly at the NVDB outlet, aimed at detecting potential biases in sampling positions.In this paper, the focus is placed on the consideration of mixing ratios between c CH 4 and c NH 3 , considering the distinct emission sources for these gases.c CH 4 is predominantly emitted from the cow's mouth, whereas c NH 3 primarily originates from urination and mixing with feces on the barn floor.Throughout this study, their mixing ratio is denoted as We hypothesized that the average c CO 2 , c CH 4 , and c NH 3 are significantly different between different sampling heights, and that the [c CH 4 /c NH 3 ] is constant across the sampling heights.

Building Description
Experiments were conducted in a naturally ventilated dairy barn (NVDB) situated in Dummerstorf, Mecklenburg-Vorpommern, northeast Germany (54°1 0 N, 12°13 60 E, altitude 43 m).This NVDB was also employed in the studies of König et al. [11], Saha et al. [19], Janke et al. [24].The barn dimensions were 34.2 m × 96.15 m × 4.2 m, with an interior volume of 25,500 m 3 .The triangular roof was made of metal sheets with a gable peak of 10.73 m from the ground (Figure 1).The barn had an open ridge slot (0.5 m) and was entirely open from the sides.It was a free-stall barn with lying cubicles having a straw surface and a feeding table in the middle of the open ridge slot.The flooring was solid concrete, equipped with a profiled rubber floor (Proflex Meadowfloor CL, North Brabant, The Netherlands) that was designed to separate cows' feces and urine.Additionally, automatic scrapers cleaned the floor by scraping the slurry into manure pits every 90 min (Figure 2).Floor plan of the investigated dairy barn depicting the laying cubicles, free walkways, feeding table, and location of gas sampling setups (SS1) and (SS2).

Animal Data and Surrounding Description
During the experimentation, this NVDB accommodated 355 dairy cows (German Holstein) that can freely move on the walkways and are kept all day indoors.The average live weight of the cows was around 680 kg and the average milk production was 39.2 kg per cow per day.The cows were fed a blend of corn and maize silage, referred to as a totally mixed ration.For milking the cows, there was an inbuilt automatic milking system inside the NVDB.Animal data were gathered from the administration department of Gut Dummerstorf GmbH and by Landesforschungsanstalt für Landwirtschaft und Fischerei Mecklenburg-Vorpommern, respectively.
The investigated barn was surrounded by open fields on the southern and western sides, whereas the northern and eastern sides were surrounded by other dairy barns, a forage storage building, and manure storage tanks.Due to the barn's structure, the wind could approach the barn from all possible directions leading to several wind flow regimes.The side openings of the barn are protected by nets to restrict the wind flow during winter.However, during our study, the nets were completely uncovered, because of the autumn season.

Experimental Setup
For the conduction of the experiments, two vertical gas sampling setups, titled SS1 and SS2, were designed and constructed in the laboratory and later fixed at the barn's north side opening on two wooden columns at a horizontal distance of 50 m from each other facing inside the barn.Since there is no obstruction but an open field on the south side of this NVDB, the southern side opening was presumed as the inlet, whereas the northern was presumed as the outlet of the barn.The location of the gas sampling setups remained unchanged for the entire experiment period.Both SS1 and SS2 contained six sampling positions in the vertical dimension (H = 0.6, 0.9, 1.5, 1.8, 2.4, and 2.7 m, from the ground level).There were six individual sampling lines in each setup, arranged in a matrix of 6 × 2. Detailed information about the vertical positioning of sampling positions is depicted in Figure 1.In SS1, each of the lines had a distance of roughly 30 m from the gas analyzer, whereas the lines were approximately 12 m in length in SS2.

Gas Concentration (c P ) Gradients Measurement
A Fourier-transform infrared (FTIR) spectrometer (Gasmet CX4000, Gasmet Technologies Oy, Germany) was employed to measure the c CO 2 , c CH 4 , and c NH 3 with a relative measurement uncertainty of <6% for all gases.The FTIR was coupled with a sequencer containing twelve ports and a vacuum pump that cyclically drew the gases from each sampling point for 3 min (120 s for analysis; 60 s for gas flushing).The FTIR-sequencer was customized to perform the systematic gas sampling by gradually switching the sampling positions, moving from the top (H = 2.7 m) to the bottom (H = 0.6 m) and vice versa for the first and second sampling setups, respectively.The FTIR was calibrated before the experiments and once again after three weeks with three c CO 2 calibrating gases of 400, 500, and 600 ppm, and two c NH 3 calibrating gases of 2 and 5 ppm concentrations to verify that the measurement uncertainty complied with that specified by the manufacturer.

Wind Flow Measurement
The wind flow characteristics were estimated using an ultrasonic anemometer (USA, Windmaster Pro ultrasonic anemometer, Gill Instruments Limited, Lymington, Hampshire, UK) installed approximately 100 m away (towards east) from the investigated barn at a mast 10 m from the ground.The anemometer recorded the velocity components "u" and "v", the zonal (west to east) and meridional (north to south) velocities, respectively, at a frequency of 1 Hz, which were later computed as the wind directions and speeds.The measurement range was 0-65 m s −1 for wind speed and 0-359.9°forwind directions.The resolution was 0.1 m s −1 and 0.1°for wind speed and direction, respectively.

Data Processing and Overview
Measurements were conducted for a period of two months and six days, from 2 September 2021 to 6 November 2021.A total of 31,680 observations were recorded for c CO 2 , c NH 3 , and c CH 4 (in ppm).The wind direction (degrees) and speed (m s −1 ) observations were averaged by 3 min to synchronize with the time series of c P data.The raw data were treated for outliers, and the maximal and minimal values lay within the 1.5 times interquartile range (IQR), which yielded 31,062 observations.As mentioned in Section 2.3, c P measurement setups (SS1 and SS2) were installed on the northern opening presuming it to be the outlet.However, achieving a uniform straight cross-flow in the NVDB, i.e., wind approaching the barn from the southern opening (inlet) and leaving from the northern opening (outlet) is impracticable.Thereby, with the help of data processing tools in R, all the observations were segregated and filtered after the most prevailing wind direction, i.e., southern to southwestern (between 160 • and 270 • ) as per the barn's alignment.After this simplification, a total of 15,113 observations were obtained.The observations recorded under other windward (North, East, West) events were excluded because they result in a more complex flow pattern that was not part of this study.Data were initially segregated by SS1 and SS2.Afterwards, the data were divided into two wind speed levels, high speed (above 3 m s −1 ) and low speed (below 3 m s −1 ).The threshold was based on the mean speed calculated over the investigation period.

Statistical Analysis
The open-source programming language R (version 4.3.0)was used for statistical computing and data analysis, along with an open-source integrated development environment, R-studio (version 2022.12.0+353).For data processing and statistical analysis, packages like dplyr, psych, tidyverse, ggplot2, and ggpubr were used.Prior to conducting the statistical tests, a normality test was conducted, which indicated that all three gases follow a non-normal distribution (Figure 3).For that reason, the hypotheses were tested with non-parametric tests at a 5% significance level.
Kruskal-Wallis tests were conducted for each gas (c CO 2 , c CH 4 , and c NH 3 ), to find the statistical variation in the c P due to the effects of sampling height, horizontal sampling location, and wind flow speed.To find the magnitude of deviations, percentage errors were calculated relative to the baseline (5).Generalized linear regression modeling (GLM) was used to test the relationship between the average c P and the above-mentioned influencing factors.All the statistical tests were repeated for the mixing ratio of [c CH 4 /c NH 3 ].

Relative error (%) =
In Equation ( 5), A is the mean concentration of a target gas at respective sampling heights (H = 0.9, 1.5, 1.8, 2.4, 2.7) and B is the baseline, i.e., the mean concentration of a target gas at the bottom (H = 0.6).

Results
The sub-sections below demonstrate the variations in the respective average c CO 2 , c CH 4 , and c NH 3 caused by the mentioned effects.The results based on the statistical analysis show that the trends (Figure 4) for c CO 2 and c CH 4 , which are directly produced by the animals, show similar behavior, while they differ for c NH 3 , which is formed on the barn floor due to urination and mixing with feces.

Influence of Vertical and Horizontal Gas Sampling Positions
The relationship between average c P and sampling height as well as their location was first tested without considering information about wind flow speed.The results of the Kruskal-Wallis tests showed that the average c P was significantly different at different vertical and horizontal sampling positions for c CO 2 (p < 0.001), c CH 4 (p < 0.001), and c NH 3 (p < 0.001).The graphical summary shows the fluctuation of c P across different sampling heights (Figure 4).Results of generalized linear regression modeling showed that vertical positioning (i.e., gas sampling height) has a significant influence on c P .However, the horizontal positioning (i.e., SS1 and SS2) had no significant effect on a lower height, H = 0.9.The magnitude of the deviations is elaborated in the following sub-sections for each gas.

Effect on c CO 2
The vertical sampling height significantly influenced the c CO 2 and the horizontal sampling position was also a significant co-influencer (p < 0.001).Relative errors estimated by Equation ( 5) for each height are presented in Tables 1 and 2. The line plot in Figure 4a depicts a U-shaped curve for SS1, with a decrease in c CO 2 of up to −6.02% in the middle, i.e., H = 1.5, followed by an increase of −1.4% at the top, i.e., H = 2.7 with respect to the baseline, i.e., H= 0.6.On the other hand, for SS2, the highest deviation in c CO 2 was observed at the top, with an increase of +8.66% compared to the baseline.Both vertical and horizontal sampling positions had a significant influence (p < 0.001, GLM) on the c CH 4 .The statistical test results of c CH 4 corresponded to the c CO 2 results and the line plot also followed a similar U-shaped curve (Figure 4b).Average c CH 4 deviated by −14.29% at the middle and −3.16% at the top, yet lower than the baseline in SS1 (Table 1).But in SS2, the average was +28.17% at the top, i.e., much higher than the baseline (Table 2).

Effect on c NH 3
Similar to the the results of c CO 2 and c CH 4 , the c NH 3 were significantly influenced (p < 0.001, GLM) by vertical and horizontal sampling positions.However, all the coefficients had a positive effect; in other words, the mean c NH 3 increased by increasing the sampling height.The peaking c NH 3 trend is distinct from the U-shaped c CH 4 and c CO 2 trend, as can be noticed in the line plot (Figure 4c).The average c NH 3 increased by +24.56% at the top in SS1 and was further enhanced by +46.44% in SS2 compared to the baseline (Tables 1 and 2).

Influence of Wind Speed
When wind speed information was included as a covariable in statistical tests, the results showed a significant influence (p < 0.001, Kruskal-Wallis) on average c CO 2 , c CH 4 , and c NH 3 .The regression modeling showed that adding wind speed significantly influences average concentrations (p < 0.001, GLM).The following sub-sections illustrate the influence of wind flow speed at each height level on all three gases.

Effect on c CO 2
Two discernible trends can be observed in Figure 5a which correspond to the two different wind speed levels.In the case of high wind speed, the mean c CO 2 decreased as the sampling height increased.Compared to the baseline, average values were reduced by −7.83% and −2.54% for SS1 and SS2, respectively.Conversely, in the case of low wind speed, there was a positive trend where average values increased with sampling height.Specifically, the mean value increased by +7.81% at the top sampling height in SS1 and further increased by +24.5% in SS2 (Tables 3-6).At high wind speeds, a decreasing trend in c CH 4 with increasing sampling height was observed (Figure 5b).This was confirmed by estimated relative errors (Tables 3-6).The average concentration gradually decreased, with mean values of −19.31% and −5.68% at the top sampling height in SS1 and SS2, respectively.Conversely, at low wind speeds, the trend sharply increased to the highest sampling height in both SS1 and SS2.Furthermore, low wind speed led to a significant increase in average concentration at the top, with inflation rates of +24.18% and +81.04% in SS1 and SS2, respectively.

Effect on c NH 3
In contrast to the c CO 2 and c CH 4 graphs, the c NH 3 line plot in Figure 5c displays a distinct positive trend for both high and low wind speeds.The estimated relative errors in Tables 3-6 also indicate an increase in average concentration at the top of the sampling height, with inflation of +5.49% and +10.09% for high speed in SS1 and SS2, respectively.Nevertheless, the inflation was significantly greater for low wind speeds, exhibiting a marked increase of +55.47% and +105.1% in SS1 and SS2, respectively, at the top sampling height versus the baseline.

Effect on Gas Mixing Ratio [c CH 4 /c NH 3 ]
The mixing ratio exhibited a significant variation with respect to sampling heights (p < 0.001, Kruskal-Wallis), which was also demonstrated by the regression models (p < 0.001, GLM).However, wind speed did not exhibit a significant influence on the [c CH 4 /c NH 3 ] (p = 0.060, GLM).There was no significant difference in this trend between high-and low-speed levels (Figure 6b).Moreover, the mixing ratio was highest at H = 0.6 and gradually declined at H = 0.9.This trend was true across SS1 and SS2 sampling heights as well as under different wind speeds (Figure 6a,b).The mixing ratio remained relatively consistent at approximately 5.55 ± 0.2 above H = 1.5, indicating a stable or constant value (Table 7).0.6 0.9 Ratio

Discussion
The research outcomes suggest the presence of a consistent and recurring error linked to the vertical placement of gas sensors.In other words, the sampling height is associated with systematic error and affects the precision of gas concentration measurements.Our findings indicate a significant difference in the average c P measured at both vertical and horizontal positions of the outlet.Therefore, the hypothesis can be considered true.The uneven distribution of gases inside the enclosed barn space [11,13,29], which are carried by the out-flowing wind [18,26], could be one reason for the spatial vertical dispersion of the c P observed at the outlet's interface.

Impact of Sensor Positioning without Considering Wind Speed Data
Both the vertical and horizontal placement of sensors had a significant impact on c P ; this finding aligns with the previous research [26].However, the pattern of gas distribution in our study contradicts [26].It was anticipated that c NH 3 is produced on the barn floor due to urination and feces mixture and would exhibit higher c P at the lower sampling height.Similarly, gases directly emitted by cows, namely c CO 2 and c CH 4 , were expected to be most concentrated in the animal-occupied zone (e.g., H = 0.6 and 0.9).However, these expectations were not aligned with our experimental outcomes.Instead, all gases were primarily concentrated at the highest sampling height (H = 2.7).
As mentioned before, our results diverge from the conclusions of Janke et al. [26], which could be attributed to factors such as the artificial injection of ethane gas using a diffuser in their study.This contrasts with the natural dispersion of c CO 2 , c CH 4 , and c NH 3 gases from cows in our investigation.It is worth noting that, while Janke et al. [26] achieved flow stability in their wind tunnel setup, attaining similar conditions in real-world scenarios is challenging.Correspondingly, variations in atmospheric conditions and flow stability between the two studies may have played a role.Additionally, small-scale turbulence generated by the animals and the barn interior, and the influence of nearby structures may impact airflow patterns and dispersion.These factors were not captured in the wind tunnel experiment, which could partly contribute to the deviations observed in our results.Moreover, the findings from Zhai et al. [31] could be relevant for understanding the complex interplay between factors like wind, buoyancy-driven flows, and gas dispersion patterns.

Impact of Sensor Positioning Considering the Wind Speed Data
The relative errors were greater at low wind speeds compared to high wind speeds.The deviation pattern of c P is apparent and can be explained by increased gas diffusion as wind speed increases [26,32].The results are comparable with Saha et al. [32], which illustrates the dilution of c P due to increasing wind speed.In addition, Equation (2) also explains this dilution; if the emission rate is considered constant, an increase in volumetric flow would result in a decrease in c P .Nonetheless, it is important to note that the validity of this assumption may not be relevant for c NH 3 , where higher near-surface wind speeds and lower near-surface concentrations can lead to an increase in emission strength.
The measurement uncertainties at low wind speeds can also be higher due to the bi-directional flow effect [17].However, our data were filtered for the most prevalent wind direction approaching normal to the inlet and omitted the rest.Thereby, the influence of wind direction was excluded from the experiment.
Moreover, line plots showed approximately identical trends for all three gases, i.e., concentration increases with an increase in sampling height, which is indicative of a bias (see Figure 5).This relationship was negative particularly when wind speed was high.In addition to the two distinct patterns, the mean concentrations consistently dropped at H = 2.4 compared to neighboring sampling heights, irrespective of the wind speed.This trend was exemplary in the case of all three measured gases.This peculiarity could be explained by the vertical velocity gradients.Some studies reported that, because of the opensided wall design of NVDBs, the velocities are higher in the middle of the opening [26,33].Another possible explanation could be the vortex formation resulting from the barn's open wall design which could hinder the gas sampling procedure [18].In general, gases will tend to rise upwards due to buoyancy.However, the relationship between height and buoyant force is a complex phenomenon that can be influenced by a variety of factors such as pressure difference, temperature, and relative humidity [34].
The work by De Vogeleer et al. [17] stands out as the sole investigation to have probed the influence of number of sensors and placement on direct measurement of ventilation rates at the NVB outlet.Their findings suggested that inlets and outlets of NVBs are not uniform due to the interference of external wind flows.In our study, wind flow information was collected at a constant height of 10 m and was subsequently used as an indicator/filter criterion for data selection.
One conceivable limitation of our experiment was the lack of velocity sensors at each gas sampling height and this aspect requires further investigation.The relationship between c P and sampling height is not sufficiently explained by wind speed, due to limitations in sensor deployment at the immediate side opening of the investigated barn.In order to better quantify the effect of external wind flow characteristics on gas dilution, it is necessary to measure velocity gradients at the inlet and outlet of the NVDB.Moreover, improper positioning of velocity sensors can introduce uncertainty into direct emission measurements; therefore, it is crucial to derive a representative location [29].

Utilizing Mixing Ratio Analysis for Calibrating Sampling Height
As exhibited in the results, [c CH 4 /c NH 3 ] was significantly different across sampling heights.However, the ratios were more or less stable above the middle height (H ≥ 1.5).It follows that c CH 4 and c NH 3 are better mixed above the height of animal influence, i.e., their mouth and nose.Ideally, a constant mixing ratio at the barn opening would mean that the gases are properly mixed at any spatial dimension and sensor placement would not bias the accuracy of direct measurements [17].However, in practice, this is difficult to achieve due to various influencing factors such as wind flow, temperature, relative humidity, and, imperatively, animal activity [30].Furthermore, subsequent research should investigate the impact of feeding time, temperature variations, and the frequency of manure removal on the source and emission rates of c CH 4 and c NH 3 .
Improper mixing ratios in NVDB have also been reported in computational fluid dynamics modeling studies, for example Doumbia et al. [25], which suggest that mixed convection flows may be a potential reason for this phenomenon.Based on our test results, the ratios mostly deviated at lower sampling height (H ≤ 0.9), which corresponds to the animal zones, i.e., close to the emission sources such as the animal's mouth for c CH 4 and the barn floor for c NH 3 .This suggests that animal activities like rumination, exhalation, defecation, and urination may affect c P .Our findings align with the results of Mendes et al. [30], who reported unstable [c CH 4 /c NH 3 ] at lower heights inside and near the outlet of an NVDB.Moreover, the stable mixing ratio, H = 1.5 and 2.7, presupposes the animal effect on lower height (H ≤ 0.9).As per the trend of [c CH 4 /c NH 3 ] (6), the present study recommends measuring c CH 4 and c NH 3 at H ≥ 1.5.
Based on our findings, it is evident that the gas sensor positioning plays a critical role in direct emission measurements.The non-homogeneous distributions of c P and [c CH 4 /c NH 3 ] observed in our study highlight the importance of selecting the appropriate sampling height for accurate emission measurements.Our findings demonstrated that sensor positioning considerably affected the average c P as well as [c CH 4 /c NH 3 ] at various heights.To obtain a better understanding of the influence of wind speed, it is crucial to mount velocity sensors parallel to gas sensors to evaluate both gradients.
Overall, our study emphasizes the need for consideration of gas sensors and velocity sensor positioning to obtain accurate and reliable direct emission estimates.With the information on optimal gas sampling height at the NVDB outlet, the predominant gas analyzers like Fourier-transform infrared (FTIR), cavity ring down spectroscopes (CRDSs), and photoacoustic spectroscopes (PASs) can potentially be substituted with measuring devices that do not require sampling lines, for instance, open-path lasers [35] and some newly emerging low-cost gas sensors [36,37].Testing the performance and potential of different sensors can be carried out in future research.

Conclusions
The foreground of this manuscript was to investigate the concentration gradients of gases, particularly c CO 2 , c NH 3 , and c CH 4 as well as their mixing ratio ([c CH 4 /c NH 3 ]), at the outlet of a naturally ventilated dairy barn, by undertaking different wind speed levels.In conclusion, the study indicates that the vertical positioning of gas sensors can influence the accuracy of gas concentration measurements in naturally ventilated dairy barns.Our results indicate large systematic errors in c P depending on the sampling height at the outlet.All three measured gases (c CO 2 , c CH 4 , and c NH 3 ) were highly concentrated at top sampling height (H = 2.7 m) during low wind speed events and vice versa during high speed events.The mixing ratio of ([c CH 4 /c NH 3 ]) was significantly different across the height and unstable below 1.5 m (or above 35% of the outlet's height), which corresponds to the average cow's height.
Our study advances the direct emission estimation method in naturally ventilated dairy barns by emphasizing the crucial role of vertical sensor positioning for accurate c P measurements at the outlet.However, our investigation was limited in its consideration of wind flow dynamics.Notably, the velocity gradients at various vertical levels remain a subject for future inquiry.Exploration of complex airflow patterns is recommended, including velocity sensor positioning parallel to gas sensors across various vertical dimensions.This can provide a more comprehensive understanding of gas dispersion at the barn openings, which is crucial for deriving an optimal sensor positioning.

Figure 1 .
Figure 1.Sectional view of the investigated NVDB showing the gas sampling setups (SS1 and SS2), sampling position (SP), and the southwest inflow wind direction (WD).

Figure 2 .
Figure 2.Floor plan of the investigated dairy barn depicting the laying cubicles, free walkways, feeding table, and location of gas sampling setups (SS1) and (SS2).

Figure 3 .
Figure 3. Q-Q plot showing the normality of the data distribution.

Figure 4 .
Figure 4. Line plots showing mean values of (a) c CO 2 , (b) c CH 4 , and (c) c NH 3 at different heights and sampling setups.

Figure 5 .
Figure 5. Line plots showing mean values of (a) c CO 2 , (b) c CH 4 , and (c) c NH 3 at different heights and sampling setups, including the two levels of wind speed, i.e., high (v > 3 m s −1 ) and low (v < 3 m s −1 ) in green and blue color, respectively.

3 )Figure 6 .
Figure 6.Line plots showing mean values of mixing ratio [c CH 4 /c NH 3 ] at each height and sampling setup: (a) without adding wind speed effect and (b) adding wind speed effect as two levels i.e., high and low in brown and violet color, respectively. a)

Table 1 .
Average c P (in ppm) and percentage errors (in %) in SS1.

Table 2 .
Average c P (in ppm) and percentage errors (in %) in SS2.

Table 3 .
Average c P (in ppm) and percentage errors (in %) in SS1 for high wind speed.

Table 4 .
Average c P (in ppm) and percentage errors (in %) in SS2 for high wind speed.

Table 5 .
Average c P (in ppm) and percentage errors (in %) in SS1 for low wind speed.

Table 6 .
Average c P (in ppm) and percentage errors (in %) in SS2 for low wind speed.

Table 7 .
Average ratios of [c CH 4 /c NH 3 ] (dimensionless) and percentage errors (in %) grouped by height in SS1 and SS2.