Go to the documentation of this file.00001 #include "../copyright.h"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <stdio.h>
00014 #include <stdlib.h>
00015 #include "../defs.h"
00016 #include "../athena.h"
00017 #include "../globals.h"
00018 #include "../prototypes.h"
00019 #include "prototypes.h"
00020
00021
00022
00023
00024
00025
00026
00027 void integrate_diff(MeshS *pM)
00028 {
00029 GridS *pG;
00030 int nl,nd;
00031 Real dtmin_expl;
00032
00033
00034
00035 #ifdef RESISTIVITY
00036 for (nl=0; nl<(pM->NLevels); nl++){
00037 for (nd=0; nd<(pM->DomainsPerLevel[nl]); nd++){
00038 if (pM->Domain[nl][nd].Grid != NULL) {
00039
00040 pG=pM->Domain[nl][nd].Grid;
00041
00042 get_eta(pG);
00043 }
00044 }
00045 }
00046 #endif
00047
00048 dtmin_expl = diff_dt(pM);
00049
00050
00051
00052
00053 pM->dt = MIN(pM->dt, dtmin_expl);;
00054
00055 for (nl=0; nl<(pM->NLevels); nl++){
00056 for (nd=0; nd<(pM->DomainsPerLevel[nl]); nd++){
00057 if (pM->Domain[nl][nd].Grid != NULL) {
00058 pG=pM->Domain[nl][nd].Grid;
00059 pG->dt = pM->dt;
00060
00061
00062
00063
00064 #ifdef THERMAL_CONDUCTION
00065 conduction(&(pM->Domain[nl][nd]));
00066 #endif
00067
00068 #ifdef RESISTIVITY
00069 resistivity(&(pM->Domain[nl][nd]));
00070 #endif
00071
00072 #ifdef VISCOSITY
00073 viscosity(&(pM->Domain[nl][nd]));
00074 #endif
00075 }
00076 }
00077 }
00078
00079 return;
00080 }
00081
00082
00083
00084
00085
00086
00087 void integrate_diff_init(MeshS *pM)
00088 {
00089
00090
00091
00092 #ifdef THERMAL_CONDUCTION
00093 if ((kappa_iso + kappa_aniso) <= 0.0)
00094 ath_error("[diff_init] coefficents of thermal conduction not set\n");
00095 conduction_init(pM);
00096 #endif
00097
00098 #ifdef VISCOSITY
00099 if ((nu_iso + nu_aniso) <= 0.0)
00100 ath_error("[diff_init] coefficents of viscosity not set\n");
00101 viscosity_init(pM);
00102 #endif
00103
00104 #ifdef RESISTIVITY
00105 if ((eta_Ohm + Q_Hall + Q_AD) <= 0.0)
00106 ath_error("[diff_init] coefficents of resistivity not set\n");
00107 resistivity_init(pM);
00108 #endif
00109
00110 return;
00111 }
00112
00113
00114
00115
00116 void integrate_diff_destruct()
00117 {
00118 #ifdef THERMAL_CONDUCTION
00119 conduction_destruct();
00120 #endif
00121 #ifdef RESISTIVTY
00122 resistivity_destruct();
00123 #endif
00124 #ifdef VISCOSITY
00125 viscosity_destruct();
00126 #endif
00127 }