Commit 8ad6bb53 authored by Udo Ziegler's avatar Udo Ziegler
Browse files

version 4.1 update

parent 4ec5669a
......@@ -6,7 +6,7 @@
*
* Category: Numerics.User
*
* Version: 4
* Version: 4.1
*
* Public functions: configUser()
*/
......@@ -27,6 +27,7 @@ void configUser(GRD **gm)
*
* @note Testproblem: MHD/problem4: Spherical blast wave
* (cf. Ziegler 12, SIAM J. SCI. COMPUT. 34, C102)
* - modified to test B-splitting
*/
{
GRD *g;
......@@ -43,6 +44,13 @@ bx0=_C.param[0];
by0=_C.param[1];
bz0=_C.param[2];
if(B_FIELD_SPLITTING)
{
bx0-=_C.param[6];
by0-=_C.param[7];
bz0-=_C.param[8];
}
r0=_C.param[3]; /* EXPLOSION RADIUS */
for(il=_C.level; il>=0; il--)
......@@ -117,10 +125,11 @@ for(il=_C.level; il>=0; il--)
g->rho[iz][iy][ix]=1.;
g->mx[iz][iy][ix]=g->my[iz][iy][ix]=g->mz[iz][iy][ix]=0.;
g->e[iz][iy][ix]=xc*xc+yc*yc+zc*zc<r0*r0 ? 5.e4/g1 : 1./g1;
g->e[iz][iy][ix]=xc*xc+yc*yc+zc*zc<r0*r0 ? 1.e3/g1 : 1./g1;
if(_C.mf)
{
dy=(g->yc[iy]-g->y[iy])*g->dyi;
bx=g->bx[iz][iy][ix]+(g->bx[iz][iy][ix+1]
-g->bx[iz][iy][ix])*(g->xc[ix]-g->x[ix])*g->dxi;
by=g->by[iz][iy][ix]+(g->by[iz][iy+1][ix]
......
......@@ -39,7 +39,7 @@ PPMMMM >bc[0-5]:{I,O,A,M,R,C,P,D,F,U}
0.00000e+00 0.00000e+00 0.00000e+00 >param[6-8] /
0.00000e+00 0.00000e+00 0.00000e+00 >param[9-11] /
0.00000e+00 0.00000e+00 0.00000e+00 >param[12-14] /
1 0 0 0 0 0 0 0 >flag[0-7] / noe
0 0 0 0 0 0 0 0 >flag[0-7] /
>SOLVER SPECIFICATIONS ---------------------------------------------------------------------------
RK3 CU CCT 3.0e-01 >mhd_solver_{time,flux,ef},mhd_courant
STD 4.0e-01 >viscosity_{solver,courant}
......
......@@ -39,7 +39,7 @@ PPMMMM >bc[0-5]:{I,O,A,M,R,C,P,D,F,U}
0.00000e+00 0.00000e+00 0.00000e+00 >param[6-8] /
0.00000e+00 0.00000e+00 0.00000e+00 >param[9-11] /
0.00000e+00 0.00000e+00 0.00000e+00 >param[12-14] /
1 0 0 0 0 0 0 0 >flag[0-7] / noe
0 0 0 0 0 0 0 0 >flag[0-7] /
>SOLVER SPECIFICATIONS ---------------------------------------------------------------------------
RK3 CU CCT 3.0e-01 >mhd_solver_{time,flux,ef},mhd_courant
STD 4.0e-01 >viscosity_{solver,courant}
......
/** @file nirvana.par
*
* @brief NIRVANA parameter file
*
* Specification of basic code parameter for a problem.
*
* Copyright (C) 2020 Udo Ziegler
*
* Category: Infrastructure.Kernel
*
* Version: 4
*
* @author Udo Ziegler, AIP
*
* @note Testproblem: MHD/problem4: Spherical blast wave
*/
>SIMULATION I/O ----------------------------------------------------------------------------------
NEW ./NIRLAST >mode:{NEW,RES,MOD,ANA},fname
005000 5.00e-02 >mod_max,time_max
0010 00100 91005 3.60e+03 >freq_{log,nir,ana},freq_walltime
>GEOMETRY ----------------------------------------------------------------------------------------
CART 0.00e+00 0.00e+00 0.00e+00 >geometry:{CART,CYL,SPH},omega[0-2]
>DOMAIN SETTINGS ---------------------------------------------------------------------------------
-1.00000000e+00 1.00000000e+00 0128 >lo[0],up[0],dim[0]
-1.00000000e+00 1.00000000e+00 0128 >lo[1],up[1],dim[1]
-1.00000000e+00 1.00000000e+00 0128 >lo[2],up[2],dim[2]
SLOCK 1 1 0 >partitioning_type:{SFC,BLOCK # # #}
>BOUNDARY CONDITIONS -----------------------------------------------------------------------------
PPPPPP >bc[0-5]:{I,O,A,M,R,C,P,D,F,U}
>MESH REFINEMENT ---------------------------------------------------------------------------------
0 0 >imr,amr
3.0e-01 5.0e-01 -3.0e-01 4.0e-01 2.0e-01 >amr_eps[0-4] / refinement thresholds
0.0e-00 1.0e-01 0.0e+00 3.0e-01 1.0e-02 >rhoref,vref,eref,Bref,Cref
0.6e+00 0.5e+00 >amr_{d1,exp}
2.0e-01 0.0e+00 -0.2e+00 >amr_{Jeans,dJeans,Field}
>USER-SPECIFIC PARAMETERS ------------------------------------------------------------------------
5.00000e+00 5.00000e+00 5.00000e+00 >param[0-2] / bx,by,bz
0.15000e+00 0.00000e+00 0.00000e+00 >param[3-5] / r0
1.00000e+01 1.00000e+01 1.00000e+01 >param[6-8] / B0x,B0y,B0z (split field)
0.00000e+00 0.00000e+00 0.00000e+00 >param[9-11] /
0.00000e+00 0.00000e+00 0.00000e+00 >param[12-14] /
0 0 0 0 0 0 0 0 >flag[0-7] /
>SOLVER SPECIFICATIONS ---------------------------------------------------------------------------
RK3 HLLD CT 4.0e-01 >mhd_solver_{time,flux,ef},mhd_courant
STD 4.0e-01 >viscosity_{solver,courant}
STD 4.0e-01 >diffusion_{solver,courant}
STD 4.0e-01 >conduction_{solver,courant}
STD 4.0e-01 >APdiffusion_{solver,courant}
0.1 >heatloss_max_change
0.1 0.1 >reactions_max_change{X,T}
1. >dt0_reduce:{<=1.}
>PHYSICS SPECIFICATIONS --------------------------------------------------------------------------
Y 7.94e+05 >mf,permeability_rel
N 0.00e+00 >viscosity{,_coeff}
N 0.00e+00 >diffusion{,_coeff}
N 0.00e+00 0.00e+00 0.00e+00 >conduction{,_coeff,_coeff_perp,_sat}
N 0.00e+00 >APdiffusion{,_coeff}
Y 0.01 >energy,energy_dual_sw:[0,1]
N >force
N >gravity
ADI 1.67e+00 1.00e+00 1.00e+00 >eos,gamma,poly_const,temperature
N >heatloss
0 >tracer
0 >fields
N N N 1.0 0.0 >species,reac,energy_reac,mmw,mean_ionization
>>END INPUT --------------------------------------------------------------------------------------
/** @file nirvanaUser.h
*
* @brief User-controllable NIRVANA header
*
* NIRVANA header file containing user-controllable macros.
*
* Copyright (C) 2020 Udo Ziegler
*
* Category: Infrastructure.User
*
* Version: 4.1
*
* @author Udo Ziegler, AIP
*
* @note DO NOT REMOVE ANY MACRO
*/
/* NUMERICS-RELATED PARAMETERS ---------------------------------------------- */
#define SPACE_ORDER 2 /* {2} */
#define LIM(a) VL(a) /* SLOPE LIMITER:{MM,MC,VL} */
#define LIM_MULTI_DIM YES /* {YES,NO} */
#define PSI 0.9 /* PARAMETER IN MULTI_D_LIMITER:[0.5,1] */
#define MAXLEVEL 24 /* MAXIMUM REFINEMENT LEVEL: (<128) */
#define MG_ITMAX 80 /* MULTI-GRID: MAX ITERATIONS */
#define MG_TYPE MULT /* MULTI-GRID: TYPE:{MULT} */
#define MG_TOL 1.e-6 /* MULTI-GRID: ERROR TOLERANCE */
#define RKL_COURANT_EXPL 0.25 /* RKL: EXPL COURANT NUMBER: <0.5 */
#define RKL_MAX_COURANT 1.e3 /* RKL: MAX COURANT NUMBER: <=1000 */
#define RKL_DT_LIM 0.10 /* RKL: DT/DT_DYN LIMIT */
#define HEATLOSS_TOL 1.e-4 /* HEATLOSS SOLVER: REL. ERR TOL */
#define HEATLOSS_ATOL 0.01 /* HEATLOSS SOLVER: ABS. ERR TOL */
#define REACTIONS_TOL 1.e-5 /* REACTIONS SOLVER: REL. ERR TOL */
#define REACTIONS_ATOL_X 0. /* REACTIONS SOLVER: ABS. ERR TOL_X */
#define REACTIONS_ATOL_T 0.01 /* REACTIONS SOLVER: ABS. ERR TOL_T */
#define HLLD_PRESSURE_CORR NO /* HLLD: LOW MACH CORRECTION:{NO,YES} */
#define BORIS_CORR NO /* BORIS CORRECTION:{NO,YES,AUTO} */
#define BORIS_CRED 2.0 /* BORIS: RED. C */
#define BORIS_CRED_MIN -2. /* BORIS: MIN RED. C IN UNITS 2|v|+cs */
#define BORIS_AUTO_CA_MAX 5. /* BORIS: MAX CA IN UNITS 2|v|+cs */
/* PHYSICS-RELATED PARAMETERS ----------------------------------------------- */
#define CENTRIFUGAL_FORCE YES /* CENTRIFUGAL FORCE TERM:{YES,NO} */
#define COND_FORCE_ISO NO /* ISOTROPY IN CONDUCTION:{YES,NO} */
#define B_FIELD_SPLITTING NO /* MAGNETIC FIELD SPLITTING:{YES,NO} */
/* NCCM-RELATED PARAMETERS -------------------------------------------------- */
#define CR_IH 1.75e-16 /* H CR IONISATION RATE STD: 2.5e-17
Indriolo & McCall: 1.75e-16 */
#define TDUST 10. /* DUST TEMPERATURE */
#define ADUST 1. /* DUST ABUNDANCE REL. TO MILKY WAY */
#define ISRF_G 0.03 /* ISRF HABING STRENGTH (STD=1.13) */
#define DBNCCM YES /* NCCM DATA BASE AVAILABILITY FLAG */
#define CHECK_REACTIONS YES /* CHECK REACTIONS ? {YES,NO} */
/* ANALYTIC EOS-RELATED MACROS ---------------------------------------------- */
#define PUSR(rho,eth) (0.*(rho)+0.*(eth))
#define CS2USR(rho,eth) (0.*(rho)+0.*(eth))
#define TUSR(rho,eth) (0.*(rho)+0.*(eth))
#define ETUSR(rho,eth) (0.*(rho)+0.*(eth))
/** @file nirvanaUser.h
*
* @brief User-controllable NIRVANA header
*
* NIRVANA header file containing user-controllable macros.
*
* Copyright (C) 2020 Udo Ziegler
*
* Category: Infrastructure.User
*
* Version: 4.1
*
* @author Udo Ziegler, AIP
*
* @note DO NOT REMOVE ANY MACRO
*/
/* NUMERICS-RELATED PARAMETERS ---------------------------------------------- */
#define SPACE_ORDER 2 /* {2} */
#define LIM(a) VL(a) /* SLOPE LIMITER:{MM,MC,VL} */
#define LIM_MULTI_DIM YES /* {YES,NO} */
#define PSI 0.9 /* PARAMETER IN MULTI_D_LIMITER:[0.5,1] */
#define MAXLEVEL 24 /* MAXIMUM REFINEMENT LEVEL: (<128) */
#define MG_ITMAX 80 /* MULTI-GRID: MAX ITERATIONS */
#define MG_TYPE MULT /* MULTI-GRID: TYPE:{MULT} */
#define MG_TOL 1.e-6 /* MULTI-GRID: ERROR TOLERANCE */
#define RKL_COURANT_EXPL 0.25 /* RKL: EXPL COURANT NUMBER: <0.5 */
#define RKL_MAX_COURANT 1.e3 /* RKL: MAX COURANT NUMBER: <=1000 */
#define RKL_DT_LIM 0.10 /* RKL: DT/DT_DYN LIMIT */
#define HEATLOSS_TOL 1.e-4 /* HEATLOSS SOLVER: REL. ERR TOL */
#define HEATLOSS_ATOL 0.01 /* HEATLOSS SOLVER: ABS. ERR TOL */
#define REACTIONS_TOL 1.e-5 /* REACTIONS SOLVER: REL. ERR TOL */
#define REACTIONS_ATOL_X 0. /* REACTIONS SOLVER: ABS. ERR TOL_X */
#define REACTIONS_ATOL_T 0.01 /* REACTIONS SOLVER: ABS. ERR TOL_T */
#define HLLD_PRESSURE_CORR NO /* HLLD: LOW MACH CORRECTION:{NO,YES} */
#define BORIS_CORR NO /* BORIS CORRECTION:{NO,YES,AUTO} */
#define BORIS_CRED 2.0 /* BORIS: RED. C */
#define BORIS_CRED_MIN -2. /* BORIS: MIN RED. C IN UNITS 2|v|+cs */
#define BORIS_AUTO_CA_MAX 5. /* BORIS: MAX CA IN UNITS 2|v|+cs */
/* PHYSICS-RELATED PARAMETERS ----------------------------------------------- */
#define CENTRIFUGAL_FORCE YES /* CENTRIFUGAL FORCE TERM:{YES,NO} */
#define COND_FORCE_ISO NO /* ISOTROPY IN CONDUCTION:{YES,NO} */
#define B_FIELD_SPLITTING YES /* MAGNETIC FIELD SPLITTING:{YES,NO} */
/* NCCM-RELATED PARAMETERS -------------------------------------------------- */
#define CR_IH 1.75e-16 /* H CR IONISATION RATE STD: 2.5e-17
Indriolo & McCall: 1.75e-16 */
#define TDUST 10. /* DUST TEMPERATURE */
#define ADUST 1. /* DUST ABUNDANCE REL. TO MILKY WAY */
#define ISRF_G 0.03 /* ISRF HABING STRENGTH (STD=1.13) */
#define DBNCCM YES /* NCCM DATA BASE AVAILABILITY FLAG */
#define CHECK_REACTIONS YES /* CHECK REACTIONS ? {YES,NO} */
/* ANALYTIC EOS-RELATED MACROS ---------------------------------------------- */
#define PUSR(rho,eth) (0.*(rho)+0.*(eth))
#define CS2USR(rho,eth) (0.*(rho)+0.*(eth))
#define TUSR(rho,eth) (0.*(rho)+0.*(eth))
#define ETUSR(rho,eth) (0.*(rho)+0.*(eth))
/** @file sourceB0User.c
*
* @brief User-defined reference magnetic field in B-field splitting
*
* Copyright (C) 2020 Udo Ziegler
*
* Category: Numerics.User
*
* Version: 4.1
*
* Public functions: sourceB0User()
*/
#include <nirvana.h>
/*############################################################################*/
void sourceB0User(double *B0, double x, double y, double z)
/**
* Template for a user-defined reference magnetic field function in B-field
* splitting.
*
* @param B0 pointer to magnetic field vector (B0[0],B0[1],B0[2])
* @param x,y,z coordinates
*
* @author Udo Ziegler, AIP
*
* @note please specify here the components B0x,B0y,B0z of the reference
* magnetic field in the B-field splitting scheme as a function of the
* space coordinates x,y,z.
*
* Testproblem: MHD/problem4: Spherical blast wave
*/
{
double bx0,by0,bz0;
bx0=_C.param[6];
by0=_C.param[7];
bz0=_C.param[8];
/* B0 X-COMPONENT */
B0[0]=GRID_SPH ? sin(y)*(bx0*cos(z)+by0*sin(z))+bz0*cos(y)
: (GRID_CYL ? bz0 : bx0);
/* B0 Y-COMPONENT */
B0[1]=GRID_SPH ? cos(y)*(bx0*cos(z)+by0*sin(z))-bz0*sin(y)
: (GRID_CYL ? bx0*cos(z)+by0*sin(z) : by0);
/* B0 Z-COMPONENT */
B0[2]=GRID_CART ? bz0 : -bx0*sin(z)+by0*cos(z);
return;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment