Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More details about Crank-Nicolson method #2

Open
kongdd opened this issue Jan 27, 2024 · 0 comments
Open

More details about Crank-Nicolson method #2

kongdd opened this issue Jan 27, 2024 · 0 comments

Comments

@kongdd
Copy link

kongdd commented Jan 27, 2024

Dear @gbonan,

could you give more details about Crank-Nicolson method.

case 'Crank-Nicolson'
for i = 2:soilvar.nsoi-1
m = soilvar.cv(i) * soilvar.dz(i) / dt;
a(i) = -0.5 * tk_plus_onehalf(i-1) / soilvar.dz_plus_onehalf(i-1);
c(i) = -0.5 * tk_plus_onehalf(i) / soilvar.dz_plus_onehalf(i);
b(i) = m - a(i) - c(i);
d(i) = m * soilvar.tsoi(i) + 0.5 * (f(i) - f(i-1));

In the book, Table 5.1 is only for implicit formulation. The Crank-Nicolson method is more complex, but has no details, except Eq. 5.13.

Further references is appreciated.

Regards,
Dongdong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant