shock

Module

Description

$Id$

This modules implements viscous heating and diffusion terms here for shock viscosity

nu_total = nu + nu_shock*dx^2*smooth(max5(-(div u))))

NOTE: this works and has been tested for periodic boundaries. With the current version, if your shock fronts reach a non-periodic boundary, unexpected things may happen, so you should monitor the behavior on the boundaries in this case.

** AUTOMATIC CPARAM.INC GENERATION ************************ Declare (for generation of cparam.inc) the number of f array variables and auxiliary variables added by this module

CPARAM logical, parameter :: lshock = .true.

MVAR CONTRIBUTION 0 MAUX CONTRIBUTION 1 COMMUNICATED AUXILIARIES 1

PENCILS PROVIDED shock; gshock(3); shock_perp; gshock_perp(3)


Quick access

Variables:

con_bias, div_scaling, div_threshold, dt_div_pow, dtfactor, idiag_gshockmax, idiag_shockm, idiag_shockmax, idiag_shockmax_perp, idiag_shockmin, idiag_shockmx, idiag_shockmy, idiag_shockmz, ishock_max, ivel, ivelx, ively, ivelz, lcommunicate_uu, lconvergence_bias, lconvergence_only, lfix_re_mesh, lforce_periodic_shockviscosity, lgauss_integral, lgauss_integral_comm_uu, lgaussian_smooth, lmax_shock, lrewrite_shock_boundary, lshock_first, lshock_linear, lshock_max3_interp, lshock_max5, lshock_modulation_z, lwith_extreme_div, maximum_shock, shock_div_pow, shock_divu_perp, shock_linear, shock_max3, shock_max3_interp, shock_smooth, smooth_factor, smooth_shock, tmp, wave_speed, width_shock, z_shock

Routines:

bcshock_per_x(), bcshock_per_y(), bcshock_per_z(), calc_diagnostics_shock(), calc_pencils_shock(), calc_shock_profile(), calc_shock_profile_external(), calc_shock_profile_internal(), calc_shock_profile_simple(), get_slices_shock(), initialize_shock(), pencil_criteria_shock(), pencil_interdep_shock(), read_shock_run_pars(), register_shock(), rprint_shock(), scale_and_chop(), scale_and_chop_internalboundary(), shock_before_boundary(), shock_divu_farray(), shock_divu_pencil(), shock_divu_perp_pencil(), shock_max3_farray(), shock_max3_pencil(), shock_max3_pencil_interp(), shock_max5(), shock_max5_pencil(), shock_smooth_cube_diamond7(), shock_smooth_farray(), shock_smooth_octagon7(), shock_smooth_pencil(), write_shock_run_pars()

Needed modules

Variables

  • shock/div_scaling [real,private/optional/default=1.0]
  • shock/div_threshold [real,private/optional/default=0.0]
  • shock/idiag_shockmax [integer,private/optional/default=0]
  • shock/ivel [integer,private]
  • shock/ivelx [integer,private]
  • shock/ively [integer,private]
  • shock/ivelz [integer,private]
  • shock/lcommunicate_uu [logical,private/optional/default=.true.]
  • shock/lforce_periodic_shockviscosity [logical,private/optional/default=.false.]
  • shock/lgauss_integral [logical,private/optional/default=.false.]
  • shock/lgauss_integral_comm_uu [logical,private/optional/default=.false.]
  • shock/lshock_first [logical,private/optional/default=.true.]
  • shock/lshock_max3_interp [logical,private/optional/default=.false.]
  • shock/lshock_max5 [logical,private/optional/default=.false.]
  • shock/lshock_modulation_z [logical,private/optional/default=.false.]
  • shock/lwith_extreme_div [logical,private/optional/default=.false.]
  • shock/shock_divu_perp [private]
  • shock/shock_max3 [private]
  • shock/shock_max3_interp [private]
  • shock/shock_smooth [private]
  • shock/smooth_factor (3,3,3) [real,private]
  • shock/width_shock [real,private/optional/default=0.1]
  • shock/z_shock [real,private/optional/default=0.0]

Subroutines and functions

subroutine  shock/register_shock()

19-nov-02/tony: coded 24-jan-05/tony: modified from visc_shock.f90

Use :

farraymanager

Call to:

fatal_error(), calc_diagnostics_shock(), max_mn_name(), calc_shock_profile(), shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/initialize_shock(f)

20-nov-02/tony: coded

Parameters:

f (,,*,*) [real,inout,contiguous]

Call to:

fatal_error(), calc_diagnostics_shock(), max_mn_name(), calc_shock_profile(), shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/read_shock_run_pars(iomsg)
Parameters:

iomsg [character,out]

Use :

file_io (parallel_unit())

Call to:

calc_diagnostics_shock(), max_mn_name(), calc_shock_profile(), shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/write_shock_run_pars(unit)
Parameters:

unit [integer,in]

Call to:

calc_diagnostics_shock(), max_mn_name(), calc_shock_profile(), shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/rprint_shock(lreset[, lwrite])

Writes ishock to index.pro file

24-nov-03/tony: adapted from rprint_ionization

Parameters:
  • lreset [logical]

  • lwrite [logical,in,]

Use :

diagnostics (parse_name())

Call to:

calc_diagnostics_shock(), max_mn_name(), calc_shock_profile(), shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/get_slices_shock(f, slices)

Write slices for animation of shock variable.

26-jul-06/tony: coded

Parameters:
  • f (,,*,*) [real,in,contiguous]

  • slices [slice_data]

Use :

slices_methods (assign_slices_scal())

Call to:

calc_diagnostics_shock(), max_mn_name(), calc_shock_profile(), shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/pencil_criteria_shock()

All pencils that the Viscosity module depends on are specified here.

20-11-04/anders: coded

Call to:

calc_diagnostics_shock(), max_mn_name(), calc_shock_profile(), shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/pencil_interdep_shock(lpencil_in)

Interdependency among pencils from the Viscosity module is specified here.

20-11-04/anders: coded

Parameters:

lpencil_in (npencils) [logical]

Call to:

calc_diagnostics_shock(), max_mn_name(), calc_shock_profile(), shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/calc_pencils_shock(f, p)

Calculate Viscosity pencils. Most basic pencils should come first, as others may depend on them.

20-11-04/anders: coded

Parameters:
  • f (,,*,*) [real,in,contiguous]

  • p [pencil_case,inout]

Use :

sub (grad())

Call to:

calc_diagnostics_shock(), max_mn_name(), calc_shock_profile(), shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/calc_diagnostics_shock(p)
Parameters:

p [pencil_case]

Use :

diagnostics (max_mn_name())

Call to:

max_mn_name(), calc_shock_profile(), shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/shock_before_boundary(f)
Parameters:

f (,,*,*) [real,contiguous]

Call to:

calc_shock_profile(), shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/calc_shock_profile_simple(f)

Calculate divu based shock profile to be used in viscosity and diffusion type terms.

23-nov-02/tony: coded

for debug use Debug_IO

Parameters:

f (,,*,*) [real,contiguous]

Call to:

shock_divu(), shock_max5(), bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()

subroutine  shock/calc_shock_profile(f)

Calculate divu based shock profile to be used in viscosity and diffusion type terms.

12-apr-05/tony: coded

Parameters:

f (,,*,*) [real,contiguous]

Use :

boundcond, mpicomm, sub, magnetic (bb_unitvec_shock())

Call to:

bcshock_per_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), bcshock_per_y(), bcshock_per_z(), boundconds_y(), boundconds_z(), boundconds_x(), shock_divu(), bb_unitvec_shock(), erfunc(), not_implemented(), scale_and_chop()