1389 Commits

Author SHA1 Message Date
6e20fa26a9 Rename LICENSE to LICENSE.md.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-06-15 21:55:59 -03:00
7947b7126d Rename README to README.md.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-06-15 21:55:10 -03:00
f7ef45c559 MESH: Fix indices to fill the borders in restrict_block().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-06-08 20:13:43 -03:00
4a5cec8168 EVOLUTION: No need to initialize fluxes in update_fluxes().
The fluxes are already initialized in update_flux().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-06-05 19:09:46 -03:00
95deee8113 SCHEMES: Initialize fluxes in update_flux() subroutines.
Make the flux f(:,:,:,:) output argument only.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-06-05 19:07:30 -03:00
ff9483e95c MESH: Fill the block borders in restrict_block().
Since the borders are undefined, it is better to fill them with the copy
of the last available boundary layers. Even though they will be later
updated by the boundary update, it eliminates the possibilty of
propagating NaNs inside the blocks.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-06-05 18:59:31 -03:00
a42e6a0a16 EQUATIONS: Fill the block borders in update_primitive_variables().
This should not be normally required, but it helps to avoid the
unexpected appearance of NaNs and the code execution termination due
to the floating point exceptions.

This should also help with more advanced open boundary conditions (such
as the conditions which keep the divergence or curl of vector fields
zero).

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-06-05 18:41:39 -03:00
8678de92f5 EVOLUTION: Initialize array %f(:,:,:,:,:) in update_fluxes().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-27 18:22:55 -03:00
769e69d704 EVOLUTION: Initialize array du in update_increment().
We do not update all elements of array du(:,:,:,:) in
update_increment(), therefore some of its elements may be NaNs. Make
sure that all elements have arithmetic representation by initializing
du(:,:,:,:) with zeros.

Also, indicate that array du(:,:,:,:) is only output argument.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-27 17:58:30 -03:00
309b6b2e0b UTILS: Add assert_array_3d() to assert interface.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-27 16:33:03 -03:00
59ffba724d UTILS: New module with utility subroutines.
The initial version provides assertion subroutines.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-27 15:34:23 -03:00
4534110d28 EQUATIONS: Pass time and time increment to update_shapes().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-16 15:58:01 -03:00
c48aa3ee8a EVOLUTION: Update shapes after updating boundaries.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-16 10:31:16 -03:00
8bc24eeb80 SCHEMES: In HD and MHD we reconstruct states using primitive variables.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-11 10:38:09 -03:00
2e4dfbdc09 EVOLUTION: Move boundary_variables() to update_variables().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-11 07:33:29 -03:00
b1f397e7f8 SHAPES: Calculate conserved variables for jet only once.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-11 07:03:24 -03:00
190f1ba644 INTERPOLATIONS: Rename limiter() to limiter_tvd().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-10 10:12:20 -03:00
408760bf15 INTERPOLATIONS: Make the prolongation limiter independent.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-10 10:05:22 -03:00
f574dc2a33 INTERPOLATIONS: Make the extrema clipping limiter independent.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-10 09:43:39 -03:00
9c7962915d INTERPOLATIONS: Apply TVD reconstruction to clipped extrema.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-10 08:33:26 -03:00
99cc1ca2ab INTERPOLATIONS: Make sure MC, VL, and SB limiters do not overshoot.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-10 08:09:43 -03:00
573873f76b EQUATIONS: Use pressure from energy in lower bracket estimation.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-04 12:35:29 -03:00
38a89bad1c EQUATIONS: Use maximum estimated root as the lower bracket.
In nr_initial_brackets_srmhd_adi() we estimate the lower bracket, which
guarantees the physical solution, from the pressure positivity derived
from both, the equation of state and the total energy. We take the
maximum of them as the lower bracket.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-04 11:03:41 -03:00
12fc4838fe EQUATIONS: Print input parameters if the bracket solution fails.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-02 13:07:04 -03:00
62d224dbee EQUATIONS: Use energy equation to calculate pressure.
In cons2prim_srmhd_adi() we use the energy equation to calculate the
pressure. If the enthalpy was calculated exactly, this the energy
equation gives pressure equal to the one obtained from the equation of
state. If the physical state couldn't be solved, the returned enthalpy
guarantees that the state is physical (v<1, p>0), but the solution
violates the equation of state.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-02 13:00:37 -03:00
366dbdbd38 EQUATIONS: Use energy equation to find the lower bracket for W.
The equation for total energy gives another condition for the positivity
of pressure which is a cubic function.  This condition is somewhat
stronger than the condition coming from the pressure equation and
costs less computationally.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-02 12:43:28 -03:00
61ca7eae12 EQUATIONS: Check pressure positivity in cons2prim_srmhd_adi().
If the pressure is negative or zero, print a warning and set it to the
minimum allowed value pmin.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-05-02 11:47:24 -03:00
e47d7dc28a EQUATIONS: Fix mistake in coefficients in nr_initial_brackets_srmhd_adi().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-30 18:49:01 -03:00
04e82700d0 EQUATIONS: Rewrite nr_function_srmhd_adi_1d().
This rewrite removes the dependency on |v|² and its derivative in the
energy function and replaces it with the Lorentz factor. It also
slightly simplifies the energy function.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-30 16:48:07 -03:00
755207cda1 EQUATIONS: Use wl, if the solution is uphysical.
If the energy function is positive for the lower bracket, it means that
the solution for energy function is unphysical (p<0). In this case use
the lower bracket which guarantees that the cell is physical.

The total energy should be corrected in this case, but this will be done
later.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-29 10:21:13 -03:00
12f5ea74f2 EQUATIONS: Just warn if the convergence was not reached.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-27 19:00:04 -03:00
85d89d947b EQUATIONS: Use the new subroutine in 2D(W,u) method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-27 18:55:05 -03:00
f9ab91c093 EQUATIONS: Use the new subroutine in 2D(W,v) method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-27 18:52:40 -03:00
81f17e5995 EQUATIONS: Use the new subroutine in 1D(W) method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-27 18:49:12 -03:00
84dabc30d5 EQUATIONS: Add subroutine to find the initial brackets and guess.
The new subroutine finds the initial brackets and estimates the root
value of the enthalpy which are used in the primitive variables solver
for SRMHD.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-27 18:42:43 -03:00
4c7e526a4b EQUATIONS: Fix calculation of the fluxes in SRMHD.
The fluxes of the momenta had the second terms wrongly calculated. The
new calculation uses equations from Mignone & Bodo (2006).

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-25 17:13:39 -03:00
8aa56efe21 EQUATIONS: Correct the interface in the Riemann problem.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-25 13:11:37 -03:00
c7f52cec15 PROBLEMS: Implement general 1D Riemann test problem.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-25 13:02:45 -03:00
945bf1cc16 EQUATIONS: Set the boundary values from the parameter file.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-25 12:14:58 -03:00
434420f33a EQUATIONS: Add array to store boundary values.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-25 11:49:51 -03:00
5363c0a722 Merge branch 'master' into srmhd
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>

Conflicts:
	src/makefile
2015-04-24 10:27:36 -03:00
dad7d7bafe Makefile: Remove option to create archive.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-04-23 13:11:37 -03:00
53738e00e3 EQUATIONS: Implement SRMHD 2D(W,u²) variable solver.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-02-28 14:22:00 -03:00
0edc75a884 EQUATIONS: Improve brackets for SRHD variable solvers.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-02-27 18:19:40 -03:00
fd4416d673 EQUATIONS: Fix SRMHD 1D(W) variable solver.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-02-27 17:57:29 -03:00
9ae335cd39 EQUATIONS: Implement brackets for SRMHD variable solvers.
This change implements the initial bracketing the enthalpy. The minimum
enthalpy is found by solving the pressure positivity equation, which
guarantees also the physicality of velocity. The upper bracket is found
from the energy equation. Then, the brackets are shifted up until the
root region is found.

The 1D and 2D Newton-Raphson methods have been slightly improved as
well. The 1Dw method use the information about brackets to limit the
next step. If the solution shoots out of the brackets, the bisection
method is applied. In the 2Dwv method, we print warnings when the
variables become unphysical.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-02-27 17:08:12 -03:00
d4962b7393 EQUATIONS: Print more info in case variable solvers fail.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-02-22 20:55:47 -03:00
072e822391 EQUATIONS: Remove unneeded function calculation in bracket estimation.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-02-22 19:38:06 -03:00
62fb668053 EQUATIONS: Print error if the physical variables cannot be found.
If the primitive variable solvers cannot find the physical solution,
print an error message together with the values of the conservative
variables for a problematic cell.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-02-22 19:31:28 -03:00
e077a985ea EQUATIONS: Print warning in the case of the unphysical variables.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2015-02-22 19:14:40 -03:00