Skip to content

Commit

Permalink
Merge pull request #93 from KratosMultiphysics/convdiff/RK-validation
Browse files Browse the repository at this point in the history
[Conv Diff] Add space and time tests
  • Loading branch information
riccardotosi authored Nov 23, 2021
2 parents 679434b + 108d5b8 commit 0f2b0fa
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,4 @@ Unit tests should *not* be uploaded to this repository. Please put them in the `
- [Convection gaussian hill problem](convection_diffusion/validation/gaussian_hill_explicit)
- [Convection-Diffusion gaussian hill problem](convection_diffusion/validation/gaussian_hill_with_diffusion_explicit)
- [Rotating pulse problem](convection_diffusion/validation/rotating_pulse_explicit)
- [Space and time convergence tests](convection_diffusion/validation/space_time_convergence_test)
1 change: 1 addition & 0 deletions convection_diffusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
- [Convection gaussian hill problem](validation/gaussian_hill_explicit)
- [Convection-Diffusion gaussian hill problem](validation/gaussian_hill_with_diffusion_explicit)
- [Rotating pulse problem](validation/rotating_pulse_explicit)
- [Space and time convergence tests](validation/space_time_convergence_test)
1 change: 1 addition & 0 deletions convection_diffusion/validation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ This folder contains the validation cases:
- [Convection gaussian hill problem](gaussian_hill_explicit)
- [Convection-Diffusion gaussian hill problem](gaussian_hill_with_diffusion_explicit)
- [Rotating pulse problem](rotating_pulse_explicit)
- [Space and time convergence tests](space_time_convergence_test)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Space and time convergence tests

**Author:** [Riccardo Tosi](https://github.com/riccardotosi)

**Kratos version:** 9.0

**Source files:** [section 2.7 of [1]](https://github.com/KratosMultiphysics/Documentation/blob/master/Resources_files/convection_diffusion_explicit_elements/Eulerian_convection_diffusion_explicit_element.pdf)

## Space convergence

We solve the transient convection diffusion equation
<img src="https://render.githubusercontent.com/render/math?math=\frac{\partial \phi}{\partial t} %2B v \cdot \nabla \phi %2B \phi \nabla \cdot v - \nabla \cdot k \nabla \phi = f"> and validate its reference implementation. We refer to section 2.7.1 of [1] for details.

We validate the implementation by computing the <img src="https://render.githubusercontent.com/render/math?math=l^2"> norm of the error as <img src="https://render.githubusercontent.com/render/math?math=\varepsilon = \sqrt{\int_{\Omega} (\phi - \phi_h)^2 }">, where <img src="https://render.githubusercontent.com/render/math?math=h"> is the mesh size, <img src="https://render.githubusercontent.com/render/math?math=\phi"> and <img src="https://render.githubusercontent.com/render/math?math=\phi_h"> are the analytic and FEM solutions, respectively.

<p align="center">
<img src="convergence_error_convection_diffusion_explicit_solution.jpg"alt="velocity" style="width: 500px;"/>
</p>

The figure shows that the error <img src="https://render.githubusercontent.com/render/math?math=\varepsilon"> converges as expected for both quasi-static ASGS and quasi-static OSS.

## Time convergence

We solve the transient convection diffusion equation
<img src="https://render.githubusercontent.com/render/math?math=\frac{\partial \phi}{\partial t} %2B v \cdot \nabla \phi %2B \phi \nabla \cdot v - \nabla \cdot k \nabla \phi = f"> and validate its reference implementation. We refer to section 2.7.2 of [1] for details.

The analytic solution at time <img src="https://render.githubusercontent.com/render/math?math=t"> is <img src="https://render.githubusercontent.com/render/math?math=\phi(t) = x - \sin(t)">. Therefore, it is possible to compute the <img src="https://render.githubusercontent.com/render/math?math=l^2"> norm of the error as
<img src="https://render.githubusercontent.com/render/math?math=\varepsilon = \sqrt{\int_{\Omega} (\phi - \phi_h)^2 }">, where <img src="https://render.githubusercontent.com/render/math?math=h"> is the mesh size, <img src="https://render.githubusercontent.com/render/math?math=\phi"> and <img src="https://render.githubusercontent.com/render/math?math=\phi_h"> are the analytic and FEM solutions, respectively. It is expected to obtain an order four accuracy for the Runge-Kutta 4 time integration scheme.

<p align="center">
<img src="convergence_error_time_convection_diffusion_bar.jpg"alt="velocity" style="width: 500px;"/>
</p>

The figure shows that the time accuracy is of order four, as expected.


## References

[1] Tosi, R. (2020). Eulerian convection diffusion explicit elements (p. 27). p. 27. Retrieved from https://github.com/KratosMultiphysics/Documentation/blob/master/Resources_files/convection_diffusion_explicit_elements/Eulerian_convection_diffusion_explicit_element.pdf
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0f2b0fa

Please sign in to comment.