Skip to content

Commit

Permalink
Incorporation of Xi_shear to scale the shear heating
Browse files Browse the repository at this point in the history
  • Loading branch information
victorsacek committed Oct 29, 2023
1 parent 9d36cad commit 51e2852
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DMSwarm2mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ extern PetscScalar *inter_H;
extern PetscInt periodic_boundary;

extern PetscInt WITH_SHEAR_H;
extern PetscReal Xi_shear;

extern double visc_MIN;

Expand Down Expand Up @@ -156,7 +157,7 @@ PetscErrorCode Swarm2Mesh_2d(){
if (rz<0 || rz>1) {printf("weird rz=%f , Swarm2Mesh\n",rz); exit(1);}

if (WITH_SHEAR_H == 1){
inter_H_aux = inter_H[layer_array[p]] + 4*geoq_fac[p]*strain_rate_fac[p]*strain_rate_fac[p]/inter_rho[layer_array[p]];
inter_H_aux = inter_H[layer_array[p]] + Xi_shear*4*geoq_fac[p]*strain_rate_fac[p]*strain_rate_fac[p]/inter_rho[layer_array[p]];
}
else {
inter_H_aux = inter_H[layer_array[p]];
Expand Down
1 change: 1 addition & 0 deletions src/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ PetscScalar sp_d_c = 0.0;
PetscInt WITH_NON_LINEAR = 0; // 1=True, 0=False
PetscInt WITH_ADIABATIC_H = 0; // 1=True, 0=False
PetscInt WITH_SHEAR_H = 0; // 1=True, 0=False
PetscReal Xi_shear = 1; //scale factor
PetscInt WITH_RADIOGENIC_H = 0; // 1=True, 0=False
PetscInt PLASTICITY = 1; // 1=True, 0=False
PetscInt direct_solver = 1; // 1=direct, 0=iterative
Expand Down
3 changes: 3 additions & 0 deletions src/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ extern int bcT_back;
extern PetscInt WITH_NON_LINEAR;
extern PetscInt WITH_ADIABATIC_H;
extern PetscInt WITH_SHEAR_H;
extern PetscReal Xi_shear;
extern PetscInt WITH_RADIOGENIC_H;
extern PetscInt PLASTICITY;
extern PetscReal denok_min;
Expand Down Expand Up @@ -267,6 +268,7 @@ PetscErrorCode reader(int rank, const char fName[]){
else if (strcmp(tkn_w, "non_linear_method") == 0) {WITH_NON_LINEAR = check_a_b(tkn_w, tkn_v, "on", "off");}
else if (strcmp(tkn_w, "adiabatic_component") == 0) {WITH_ADIABATIC_H = check_a_b(tkn_w, tkn_v, "on", "off");}
else if (strcmp(tkn_w, "shear_heating") == 0) {WITH_SHEAR_H = check_a_b(tkn_w, tkn_v, "on", "off");}
else if (strcmp(tkn_w, "Xi_shear") == 0) {Xi_shear = atof(tkn_v);}
else if (strcmp(tkn_w, "radiogenic_component") == 0) {WITH_RADIOGENIC_H = check_a_b(tkn_w, tkn_v, "on", "off");}
else if (strcmp(tkn_w, "plasticity") == 0) {PLASTICITY = check_a_b(tkn_w, tkn_v, "on", "off");}
else if (strcmp(tkn_w, "top_normal_velocity") == 0) {bcv_top_normal = check_a_b(tkn_w, tkn_v, "fixed", "free");}
Expand Down Expand Up @@ -408,6 +410,7 @@ PetscErrorCode reader(int rank, const char fName[]){
MPI_Bcast(&WITH_NON_LINEAR,1,MPI_INT,0,PETSC_COMM_WORLD);
MPI_Bcast(&WITH_ADIABATIC_H,1,MPI_INT,0,PETSC_COMM_WORLD);
MPI_Bcast(&WITH_SHEAR_H,1,MPI_INT,0,PETSC_COMM_WORLD);
MPI_Bcast(&Xi_shear,1,MPIU_REAL,0,PETSC_COMM_WORLD);
MPI_Bcast(&WITH_RADIOGENIC_H,1,MPI_INT,0,PETSC_COMM_WORLD);
MPI_Bcast(&PLASTICITY,1,MPI_INT,0,PETSC_COMM_WORLD);
MPI_Bcast(&bcv_top_normal,1,MPI_INT,0,PETSC_COMM_WORLD);
Expand Down

0 comments on commit 51e2852

Please sign in to comment.