MindTheGap-ERC / CarboKitten.jl

Julia implementation of carbonate platform model
https://mindthegap-erc.github.io/CarboKitten.jl/
GNU General Public License v3.0
0 stars 0 forks source link

Include chemical erosion #5

Open jhidding opened 10 months ago

jhidding commented 10 months ago
xyl96 commented 9 months ago

Chapter 1: Chemical erosion equation

The details could be found in paper by Kaufman 2002, Terra Nova. link is here

Limestone is made of CaCO3, easily dissolved. This depends mainly on precipitation (rainfall) and temperature. The paper used equation 1 to quantify this process.

$(dh/dt) = 0.001 kc qi/Ai$

Herein dh/dt is the chemical weathering rate and the unit is in m/s. Other parameters are defined as: qi is the discharge of water at a certain cell. Ai is the surface area od the cell. If we assume there would be no surface water on land, the qi reduces to precipitation – evaporation. Let’s set it to 400mm/y for now. Therefore equation 1 could be reduced to Equation 2.

$(dh/dt) = 0.001 kc I$

The parameter kc is a dimensionless parameter and should be described by equation 3:

$kc = 40 1000 [Ca2+]eq/ρ$

Parameter ρ is density of calcite, and we choose 2700 kg/m3 here. The [Ca2+]eq is defined in equation 4:

$[Ca2+]eq = (PCO2 (K1 KC KH) / (4 K2 γCa (γHCO3)^2))^{(1/3)}$

These K1, K2, KC, KH depends on temperature. PCO2 could be between 10^(-1.5) to 10^(-3.5).

Other parameters could be found in the following figure.

image

The author then used 0.000007 m/yr in their demo. We can try this number at the beginning stage.

xyl96 commented 9 months ago

The Chapter 1 only solve the question about the superficial carbonate being dissolved. However, as rainwater percolating the carbonates, they may also dissolve deeper rocks. However, personally, I have no idea which method is more suitable to be applied in our context. This is because the maximum capability of the percolated rainwater to dissolve carbonate rocks depends on the amount and equilibrium concentration of the fluid (which has already been described by Chapter 1, depending on temp and pCO2, etc.). Therefore, as long as the carbonate dissolves quite fast (which is clearly true) and the percolating pathway is relatively long (not easily defined), and thus the fluid reaches equilibrium before draining into the ocean, it really does not matter how much subsurface dissolution is happening.

xyl96 commented 9 months ago

Chapter 2 Dissolution at depth

The following Paper describes this: click here and/or click here

Ideally, a reactive transport model should be most accurate but it needs more calculation resources. So herein, the author just suggested the dissolution rates of rocks depend on the depth. This makes sense as the deeper you go the more concentrated you are. Also, this does not consider diffusion in this chapter.

The dissolution rate of carbonate follows linear rate laws of: $F = α (ceq-c(z))$

The rate law is a common expression way to describe the kinetics of certain chemical reactions and click hier for more info

F is the dissolution rate, α is constant (kinetic co-efficient), ceq is the concentration in fluid when equilibrium is reached (i.e., no more dissolution, which is [Ca2+]eq in Chapter 1), c(z) is the current concentrationion at depth of z in the fluid. This equation then expands to

$I dc = α (ceq-c(z)) L dz$

This equation indicates that the concentration increases in the infiltrated water equals the dissolution of rocks in the thickness of 'dz'. 'L' is the specific length of fractures/porosities (units: m/m^2, we can try 100 at the first place). I.e., this term defines the relative reactive surface of the subsurface rocks, or how much surface is actually dissolving? This term is difficult to determine. 'I' is infiltration, but slightly different as chapter 1: this I is the I in each rain event according to the paper. We certainly do not gonna know how this parameter works, so we just set it the same as in chapter 1?

However, to solve this equation we still need to know c(z).

If assuming the initial percolating water has c(0) = 0, then we could get the following equation (as the c is related to depth):

$c(z) = ceq * (1 - e^{(-z/λ)})$

Herein, λ = I/αL.

Therefore the $Daverage = (I ceq/ρ) (1 – (λ/z0) * (1 – e^{(-z0/λ)}))$

α used in this article is α = 2·10^{−6} or 3.5·10^{−7} cm/s (for temp at 298K). This is indeed a controversial parameter TBH. We can try different values and see what happens.

how we gonna implement this?

Some idea: we fist calculate the ceq (or [Ca2+]eq), and calculate the thickness of the carbonates needed for c(z) to reach 80% of ceq (Generally, the paper said if c(z) is > 80% of ceq, it means 'saturated'). If the thickness is enough, we just use the chemical weathering rate in chapter 1, if not we use the Daverage in Chapter 2.

In this chapter, many parameters are uncertain, like α, L, so we might need to play around it.

xyl96 commented 7 months ago

first runnable draft of chemical dissolution in here. Please give me feedback if you have time to look at it, thx.

EmiliaJarochowska commented 7 months ago

I've been trying now for several days and I still cannot make it work. I always get some variant of:

[ Info: Precompiling CarboKitten [690c6d5c-626a-429f-a06b-981a1dae1c19]
ERROR: LoadError: UndefVarError: `carb_dissolution` not defined

[...]

LoadError: Failed to precompile CarboKitten

When I initiate the project, I always get:

ERROR: The following 1 direct dependency failed to precompile:

CarboKitten [690c6d5c-626a-429f-a06b-981a1dae1c19]

this prevents running the examples you produced.

I will seek some help with this but in the meantime I noticed some unrelated things that need fixing:

  1. the files related to reading SL from external files are still in this branch. This means, when it is merged, they will go into main, whereas we agreed they should go into a separate repo. So please delete them. It is best to keep one branch for one feature.
  2. Some potential mess with entangled: You modified code without running the entangled daemon so the documentation will not be updated. Also you copied entangled tags into new files, for example:
    # ~/~ begin <<docs/src/ca-with-production.md#examples/caps-osc.jl>>[init]

    into caps-test.jl but it's copied from caps-osc.jl. These tags should be unique, so either this file should not be included in the documentation (it isn't at the moment) or it should have its own tag. Two copies of the same tag in different code chunks might be a nice test for entangled's robustness though ;-)

Probably best for you is to make a decision if you want to develop code with documentation and then use entangled all the time or develop code without documentation and... I don't know? Have undocumented code?

EmiliaJarochowska commented 3 months ago

Has this issue become redundant with #16 ? Can you confirm @xyl96 and close if yes?