shock_highorder

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/con_bias [real,private/optional/default=0.1]
  • shock/div_threshold [real,private/optional/default=0.0]
  • shock/dt_div_pow [real,private/optional/default=0.0]
  • shock/dtfactor [real,private/optional/default=1.0]
  • shock/idiag_gshockmax [integer,private/optional/default=0]

    DIAG_DOC: $maxleft|nablanu_{shock}right|$

  • shock/idiag_shockm [integer,private/optional/default=0]

    DIAG_DOC:

  • shock/idiag_shockmax [integer,private/optional/default=0]

    DIAG_DOC:

  • shock/idiag_shockmin [integer,private/optional/default=0]

    DIAG_DOC:

  • shock/idiag_shockmx [integer,private/optional/default=0]

    YZAVG_DOC:

  • shock/idiag_shockmy [integer,private/optional/default=0]

    XZAVG_DOC:

  • shock/idiag_shockmz [integer,private/optional/default=0]

    XYAVG_DOC:

  • shock/ishock_max [integer,private/optional/default=1]
  • shock/ivel [integer,private]
  • shock/ivelx [integer,private]
  • shock/ively [integer,private]
  • shock/ivelz [integer,private]
  • shock/lconvergence_bias [logical,private/optional/default=.true.]
  • shock/lconvergence_only [logical,private/optional/default=.true.]
  • shock/lfix_re_mesh [logical,private/optional/default=.false.]
  • shock/lforce_periodic_shockviscosity [logical,private/optional/default=.false.]
  • shock/lgaussian_smooth [logical,private/optional/default=.false.]
  • shock/lmax_shock [logical,private/optional/default=.true.]
  • shock/lrewrite_shock_boundary [logical,private/optional/default=.false.]
  • shock/lshock_linear [logical,private/optional/default=.false.]
  • shock/maximum_shock [private]
  • shock/shock_div_pow [real,private/optional/default=1.0]
  • shock/shock_divu_perp [private]
  • shock/shock_linear [real,private/optional/default=0.01]
  • shock/smooth_factor (1 + 2 * nghost,1 + 2 * nghost,1 + 2 * nghost) [real,private]
  • shock/smooth_shock [private]
  • shock/tmp (*,*,*) [real,private/allocatable]
  • shock/wave_speed [private]

Subroutines and functions

subroutine  shock/register_shock()

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

Use :

farraymanager, messages (svn_id())

Called from:

register_modules()

Call to:

svn_id(), register_report_aux(), fatal_error(), smoothing_kernel(), warning(), calc_diagnostics_shock(), max_mn_name(), yzsum_mn_name_x(), xzsum_mn_name_y(), xysum_mn_name_z(), boundconds_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), boundconds_y(), boundconds_z(), div(), bb_unitvec_shock(), calc_shock_profile(), gij(), curl_mn(), get_bext()

subroutine  shock/initialize_shock(f)

20-nov-02/tony: coded

Parameters:

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

Use :

messages (fatal_error(), warning()), sub (register_report_aux(), smoothing_kernel()), general (itoa())

Called from:

register_modules(), initialize_modules()

Call to:

register_report_aux(), fatal_error(), smoothing_kernel(), warning(), calc_diagnostics_shock(), max_mn_name(), yzsum_mn_name_x(), xzsum_mn_name_y(), xysum_mn_name_z(), boundconds_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), boundconds_y(), boundconds_z(), div(), bb_unitvec_shock(), calc_shock_profile(), gij(), curl_mn(), get_bext()

subroutine  shock/read_shock_run_pars(iomsg)
Parameters:

iomsg [character,out]

Use :

file_io (parallel_unit())

Call to:

calc_diagnostics_shock(), max_mn_name(), yzsum_mn_name_x(), xzsum_mn_name_y(), xysum_mn_name_z(), boundconds_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), boundconds_y(), boundconds_z(), div(), bb_unitvec_shock(), calc_shock_profile(), gij(), curl_mn(), get_bext()

subroutine  shock/write_shock_run_pars(unit)
Parameters:

unit [integer,in]

Called from:

get_datadir(), get_snapdir(), read_all_init_pars(), read_all_run_pars(), get_downpars()

Call to:

calc_diagnostics_shock(), max_mn_name(), yzsum_mn_name_x(), xzsum_mn_name_y(), xysum_mn_name_z(), boundconds_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), boundconds_y(), boundconds_z(), div(), bb_unitvec_shock(), calc_shock_profile(), gij(), curl_mn(), get_bext()

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]

Use :

diagnostics, farraymanager (farray_index_append())

Called from:

register_modules(), initialize_modules(), finalize_modules(), choose_pencils(), rprint_list()

Call to:

calc_diagnostics_shock(), max_mn_name(), yzsum_mn_name_x(), xzsum_mn_name_y(), xysum_mn_name_z(), boundconds_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), boundconds_y(), boundconds_z(), div(), bb_unitvec_shock(), calc_shock_profile(), gij(), curl_mn(), get_bext()

subroutine  shock/get_slices_shock(f, slices)

Write slices for animation of shock variable.

26-jul-06/tony: coded

Parameters:
Use :

slices_methods (assign_slices_scal())

Called from:

wvid_prepare(), wvid()

Call to:

calc_diagnostics_shock(), max_mn_name(), yzsum_mn_name_x(), xzsum_mn_name_y(), xysum_mn_name_z(), boundconds_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), boundconds_y(), boundconds_z(), div(), bb_unitvec_shock(), calc_shock_profile(), gij(), curl_mn(), get_bext()

subroutine  shock/pencil_criteria_shock()

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

20-11-04/anders: coded

Called from:

register_modules(), initialize_modules(), finalize_modules(), choose_pencils()

Call to:

calc_diagnostics_shock(), max_mn_name(), yzsum_mn_name_x(), xzsum_mn_name_y(), xysum_mn_name_z(), boundconds_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), boundconds_y(), boundconds_z(), div(), bb_unitvec_shock(), calc_shock_profile(), gij(), curl_mn(), get_bext()

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]

Called from:

register_modules(), initialize_modules(), finalize_modules(), choose_pencils()

Call to:

calc_diagnostics_shock(), max_mn_name(), yzsum_mn_name_x(), xzsum_mn_name_y(), xysum_mn_name_z(), boundconds_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), boundconds_y(), boundconds_z(), div(), bb_unitvec_shock(), calc_shock_profile(), gij(), curl_mn(), get_bext()

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

Called from:

pde(), write_diagnostics(), calc_all_module_diagnostic_auxiliaries(), perform_diagnostics(), finalize_diagnostics()

Call to:

calc_diagnostics_shock(), max_mn_name(), yzsum_mn_name_x(), xzsum_mn_name_y(), xysum_mn_name_z(), boundconds_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), boundconds_y(), boundconds_z(), div(), bb_unitvec_shock(), calc_shock_profile(), gij(), curl_mn(), get_bext()

subroutine  shock/calc_diagnostics_shock(p)
Parameters:

p [pencil_case]

Use :

diagnostics

Called from:

pde(), write_diagnostics(), calc_all_module_diagnostic_auxiliaries(), register_shock(), initialize_shock(), read_shock_run_pars(), write_shock_run_pars(), rprint_shock(), get_slices_shock(), pencil_criteria_shock(), pencil_interdep_shock(), calc_pencils_shock()

Call to:

max_mn_name(), yzsum_mn_name_x(), xzsum_mn_name_y(), xysum_mn_name_z(), boundconds_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), boundconds_y(), boundconds_z(), div(), bb_unitvec_shock(), calc_shock_profile(), gij(), curl_mn(), get_bext()

subroutine  shock/calc_shock_profile(f)

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

23-nov-02/tony: coded 17-dec-08/ccyang: add divergence threshold

Parameters:

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

Use :

boundcond (boundconds_x(), boundconds_y(), boundconds_z()), mpicomm (initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), mpiallreduce_max(), mpi_comm_pencil()), magnetic (bb_unitvec_shock()), sub (div())

Called from:

register_shock(), initialize_shock(), read_shock_run_pars(), write_shock_run_pars(), rprint_shock(), get_slices_shock(), pencil_criteria_shock(), pencil_interdep_shock(), calc_pencils_shock(), calc_shock_profile(), calc_diagnostics_shock(), shock_before_boundary()

Call to:

boundconds_x(), initiate_isendrcv_bdry(), finalize_isendrcv_bdry(), boundconds_y(), boundconds_z(), div(), bb_unitvec_shock(), calc_shock_profile(), gij(), curl_mn(), get_bext()

subroutine  shock/shock_before_boundary(f)
Parameters:

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

Called from:

pde(), write_diagnostics(), calc_all_module_diagnostic_auxiliaries(), perform_diagnostics(), finalize_diagnostics()

Call to:

calc_shock_profile(), gij(), curl_mn(), get_bext()

subroutine  shock/calc_shock_profile_simple(f)

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

12-apr-05/tony: coded

Parameters:

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

Called from:

pde(), write_diagnostics(), calc_all_module_diagnostic_auxiliaries(), perform_diagnostics(), finalize_diagnostics()

Call to:

gij(), curl_mn(), get_bext()