Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
wortiz committed Jul 3, 2024
1 parent 5230681 commit d1bdb58
Show file tree
Hide file tree
Showing 21 changed files with 1,256 additions and 21 deletions.
18 changes: 18 additions & 0 deletions include/mm_as_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@ struct Element_Variable_Pointers {
dbl *sh_sat_3[MDE]; /* Porous shell saturation layer 3 */

dbl *eddy_nu[MDE]; /* Eddy viscosity for turbulent flow */
dbl *turb_k[MDE]; /* Turbulent Kinetic Energy */
dbl *turb_diss[MDE]; /* Turbulent Dissipation */
};

/*___________________________________________________________________________*/
Expand Down Expand Up @@ -698,6 +700,8 @@ struct Element_Stiffness_Pointers {
dbl **sh_sat_3; /* Porous shell saturation layer 3 */

dbl **eddy_nu; /* Eddy viscosity for turbulent flow */
dbl **turb_k; /* Turbulent kinetic energy */
dbl **turb_diss; /* Turbulent dissipation */

/*
* These are for debugging purposes...
Expand Down Expand Up @@ -1733,6 +1737,8 @@ struct Field_Variables {
dbl sh_sat_3; /* Porous shell saturation layer 3 */

dbl eddy_nu; /* Eddy viscosity for turbulent flow */
dbl turb_k; /* Turbulent kinetic energy */
dbl turb_diss; /* Turbulent dissipation */
dbl wall_distance; /* Distance to nearest wall */
dbl multi_contact_line_distance; /* Distance to multi contact line points */

Expand Down Expand Up @@ -1784,6 +1790,8 @@ struct Field_Variables {
dbl grad_sh_sat_3[DIM]; /* Gradient of porous shell saturation layer 3 */

dbl grad_eddy_nu[DIM]; /* Gradient of Eddy viscosity */
dbl grad_turb_k[DIM]; /* Gradient of turbulent kinetic energy */
dbl grad_turb_diss[DIM]; /* Gradient of turbulent dissipation */
dbl grad_wall_distance[DIM]; /* Distance to nearest wall */

/*
Expand Down Expand Up @@ -2122,6 +2130,8 @@ struct Diet_Field_Variables {
dbl sh_sat_3; /* Porous shell saturation layer 3 */

dbl eddy_nu; /* Eddy viscosity for turbulent flow */
dbl turb_k;
dbl turb_diss;

dbl grad_em_er[DIM][DIM]; /* EM wave Fields */
dbl grad_em_ei[DIM][DIM]; /* EM wave Fields */
Expand Down Expand Up @@ -2166,6 +2176,8 @@ struct Diet_Field_Variables {
dbl grad_restime[DIM]; /* Gradient of the Residence time field */

dbl grad_moment[MAX_MOMENTS][DIM];
dbl grad_turb_k[DIM];
dbl grad_turb_diss[DIM];
};

struct Rotation_Vectors {
Expand Down Expand Up @@ -3032,6 +3044,8 @@ struct stress_dependence {
double pf[DIM][DIM][MAX_PHASE_FUNC][MDE];
double degrade[DIM][DIM][MDE];
double eddy_nu[DIM][DIM][MDE];
double turb_k[DIM][DIM][MDE];
double turb_diss[DIM][DIM][MDE];
};
typedef struct stress_dependence STRESS_DEPENDENCE_STRUCT;

Expand Down Expand Up @@ -3081,6 +3095,8 @@ struct viscosity_dependence {
double pf[MAX_PHASE_FUNC][MDE]; /* phase function */
double degrade[MDE]; /* amount of degradation */
double eddy_nu[MDE]; /* Turbulent viscosity */
double turb_k[MDE]; /* Turbulent viscosity */
double turb_diss[MDE]; /* Turbulent viscosity */
double sh_t[MDE]; /* shell temperature */
};
typedef struct viscosity_dependence VISCOSITY_DEPENDENCE_STRUCT;
Expand Down Expand Up @@ -3150,6 +3166,8 @@ struct pspg_dependence {
double v[DIM][DIM][MDE]; /* velocity dependence. */
double T[DIM][MDE]; /* temperature dependence. */
double eddy_nu[DIM][MDE];
double turb_k[DIM][MDE];
double turb_diss[DIM][MDE];
double P[DIM][MDE]; /* pressure dependence. */
double C[DIM][MAX_CONC][MDE]; /* conc dependence. */
double X[DIM][DIM][MDE]; /* mesh dependence. */
Expand Down
43 changes: 43 additions & 0 deletions include/mm_fill_turbulent.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,53 @@
#include "mm_as_structs.h"
#include "std.h"

struct turb_dependence {
double d_diss[MDE];
double d_k[MDE];
double d_v[DIM][MDE];
double d_mesh[DIM][MDE];
};

struct k_omega_sst_const {
double gamma1;
double gamma2;
double sigma_k1;
double sigma_k2;
double sigma_omega1;
double sigma_omega2;
double beta1;
double beta2;
double beta_star;
double kappa;
double a1;
double CD_komega_min;
double Plim_factor;
};

EXTERN int assemble_spalart_allmaras(dbl time_value, /* current time */
dbl tt, /* parameter to vary time integration from
explicit (tt = 1) to implicit (tt = 0) */
dbl dt, /* current time step size */
const PG_DATA *pg_data);

int assemble_turbulent_kinetic_energy_sst(dbl time_value, /* current time */
dbl tt, /* parameter to vary time integration from
explicit (tt = 1) to implicit (tt = 0) */
dbl dt, /* current time step size */
const PG_DATA *pg_data);

int assemble_turbulent_dissipation_sst(dbl time_value, /* current time */
dbl tt, /* parameter to vary time integration from
explicit (tt = 1) to implicit (tt = 0) */
dbl dt, /* current time step size */
const PG_DATA *pg_data);


void set_k_omega_sst_const_2003(struct k_omega_sst_const *k_omega_sst);

void sst_viscosity(const struct k_omega_sst_const *constants,
dbl *mu_turb,
struct turb_dependence *d_mu_turb);

#endif

1 change: 1 addition & 0 deletions include/mm_mp_const.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ extern int Num_Var_Init_Mat[MAX_NUMBER_MATLS]; /* number of variables to overwri
/* Turbulent viscosity models for Reynolds Averaged NS */
#define TURBULENT_SA 52 /* Spallart Allmaras */
#define TURBULENT_SA_DYNAMIC 53 /* Spallart Allmaras */
#define TURBULENT_K_OMEGA_SST 54 /* Spallart Allmaras */

/*
* Heat source modeling
Expand Down
58 changes: 48 additions & 10 deletions include/mm_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -7228,6 +7228,36 @@ struct BC_descriptions BC_Desc[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},
SINGLE_PHASE,
DVI_SINGLE_PHASE_DB},
{"TURB_K",
"TURB_K_BC",
DIRICHLET,
TURB_K_BC,
R_TURB_K,
SCALAR,
NO_ROT,
{0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},
SINGLE_PHASE,
DVI_SINGLE_PHASE_DB},

};

Expand Down Expand Up @@ -7501,14 +7531,16 @@ struct Equation_Names EQ_Name[] = {
{"R_VSTAR", "VSTAR", R_VSTAR},
{"R_WSTAR", "WSTAR", R_WSTAR},
{"R_EDDY_NU", "EDDY_NU", R_EDDY_NU},
{"R_TURB_K", "TURB_K", R_TURB_K},
{"R_TURB_DISS", "TURB_DISS", R_TURB_DISS},

/*
* Note -> these entries must remain until we get rid
* of putting the species unknowns after V_LAST
* There must be at least as many of these as there
* are species in the problem
*/
{"R_Y0", "Y0", V_LAST + 0}, /* 200 */
{"R_Y0", "Y0", V_LAST + 0}, /* 217 */
{"R_Y1", "Y1", V_LAST + 1},
{"R_Y2", "Y2", V_LAST + 2},
{"R_Y3", "Y3", V_LAST + 3},
Expand All @@ -7518,7 +7550,7 @@ struct Equation_Names EQ_Name[] = {
{"R_Y7", "Y7", V_LAST + 7},
{"R_Y8", "Y8", V_LAST + 8},
{"R_Y9", "Y9", V_LAST + 9},
{"R_Y10", "Y10", V_LAST + 10}, /* 201 */
{"R_Y10", "Y10", V_LAST + 10}, /* 227 */
{"R_Y11", "Y11", V_LAST + 11},
{"R_Y12", "Y12", V_LAST + 12},
{"R_Y13", "Y13", V_LAST + 13},
Expand All @@ -7528,7 +7560,7 @@ struct Equation_Names EQ_Name[] = {
{"R_Y17", "Y17", V_LAST + 17},
{"R_Y18", "Y18", V_LAST + 18},
{"R_Y19", "Y19", V_LAST + 19},
{"R_Y20", "Y20", V_LAST + 20}, /* 211 */
{"R_Y20", "Y20", V_LAST + 20}, /* 237 */
{"R_Y21", "Y21", V_LAST + 21},
{"R_Y22", "Y22", V_LAST + 22},
{"R_Y23", "Y23", V_LAST + 23},
Expand All @@ -7537,20 +7569,20 @@ struct Equation_Names EQ_Name[] = {
{"R_Y26", "Y26", V_LAST + 26},
{"R_Y27", "Y27", V_LAST + 27},
{"R_Y28", "Y28", V_LAST + 28},
{"R_Y29", "Y29", V_LAST + 29}, /* 229 */
{"R_Y29", "Y29", V_LAST + 29}, /* 246 */

/*
* Add extra equation names for vector fields that can be rotated
*/
{"R_MOM_NORMAL", "DN", R_MOM_NORMAL}, /* 230 */
{"R_MOM_NORMAL", "DN", R_MOM_NORMAL}, /* 247 */
{"R_MOM_TANG1", "DT1", R_MOM_TANG1},
{"R_MOM_TANG2", "DT2", R_MOM_TANG2},
{"R_MESH_NORMAL", "VN", R_MESH_NORMAL},
{"R_MESH_TANG1", "VT1", R_MESH_TANG1},
{"R_MESH_TANG2", "VT2", R_MESH_TANG2}, /* 235 */
{"R_MESH_TANG2", "VT2", R_MESH_TANG2}, /* 252 */
{"R_SOLID_NORMAL", "SN", R_SOLID_NORMAL},
{"R_SOLID_TANG1", "ST1", R_SOLID_TANG1},
{"R_SOLID_TANG2", "ST2", R_SOLID_TANG2} /* 238 */
{"R_SOLID_TANG2", "ST2", R_SOLID_TANG2} /* 255 */
};
int Num_EQ_Names = sizeof(EQ_Name) / sizeof(struct Equation_Names);

Expand Down Expand Up @@ -7801,9 +7833,11 @@ struct Equation_Names Var_Name[] = {
{"VSTAR", "USY", VSTAR},
{"WSTAR", "USZ", WSTAR},
{"EDDY_NU", "EDDY_NU", EDDY_NU}, // 214
{"TURB_K", "TURB_K", TURB_K}, // 215
{"TURB_DISS", "TURB_DISS", TURB_DISS}, // 216

{"MESH_POSITION1", "X", MESH_POSITION1},
{"MESH_POSITION2", "Y", MESH_POSITION2}, /* 216 */
{"MESH_POSITION2", "Y", MESH_POSITION2}, /* 218 */
{"MESH_POSITION3", "Z", MESH_POSITION3},

{"VEL_NORM", "VN", VEL_NORM},
Expand All @@ -7817,14 +7851,14 @@ struct Equation_Names Var_Name[] = {

{"D_X1_DT", "XDOT", D_X1_DT},
{"D_X2_DT", "YDOT", D_X2_DT},
{"D_X3_DT", "ZDOT", D_X3_DT}, /* 227 */
{"D_X3_DT", "ZDOT", D_X3_DT}, /* 229 */
{"D_S_DT", "SDOT", D_S_DT},

{"D_P_DT", "PDOT", D_P_DT},

{"SOLID_POSITION1", "X_RS", SOLID_POSITION1},
{"SOLID_POSITION2", "Y_RS", SOLID_POSITION2},
{"SOLID_POSITION3", "Z_RS", SOLID_POSITION3} /* 232 */
{"SOLID_POSITION3", "Z_RS", SOLID_POSITION3} /* 234 */
};

int Num_Var_Names = sizeof(Var_Name) / sizeof(struct Equation_Names);
Expand Down Expand Up @@ -8072,6 +8106,8 @@ struct Equation_Names Exo_Var_Names[] = {
{"V Int.", "USY", VSTAR},
{"W Int.", "USZ", WSTAR},
{"Eddy Turbulence Viscosity.", "EDDY_NU", EDDY_NU},
{"Turbulent Kinetic Energy.", "TURB_K", TURB_K},
{"Turbulent Dissipation.", "TURB_DISS", TURB_DISS},
};

int Num_Exo_Var_Names = sizeof(Exo_Var_Names) / sizeof(struct Equation_Names);
Expand Down Expand Up @@ -8379,6 +8415,8 @@ struct Equation_Names Var_Units[] = {
{"VSTAR", "[1]", VSTAR},
{"WSTAR", "[1]", WSTAR},
{"EDDY_NU", "[1]", EDDY_NU},
{"TURB_K", "[1]", TURB_K},
{"TURB_DISS", "[1]", TURB_DISS},
};

int Num_Var_Units = sizeof(Var_Units) / sizeof(struct Equation_Names);
Expand Down
2 changes: 2 additions & 0 deletions include/rf_bc_const.h
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,8 @@
#define VELO_SLIP_ROT_FLUID_BC 964910000

#define EDDY_NU_BC 966666666
#define TURB_K_BC 966666667
#define TURB_DISS_BC 966666668

/* Structural Shells */
#define SH_K_BC 970000000
Expand Down
6 changes: 5 additions & 1 deletion include/rf_fem_const.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@
#define VSTAR 212
#define WSTAR 213
#define EDDY_NU 214
#define TURB_K 215
#define TURB_DISS 216
/*
* define a variable to hold an external field which will be
* held fixed in the problem but parametered by the basis functions
Expand Down Expand Up @@ -925,7 +927,9 @@
#define R_VSTAR 212
#define R_WSTAR 213
#define R_EDDY_NU 214
#define V_LAST 215
#define R_TURB_K 215
#define R_TURB_DISS 216
#define V_LAST 217

/* MMH
* This is used for those parts of the code that want to ensure
Expand Down
10 changes: 10 additions & 0 deletions src/bc_colloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2587,6 +2587,16 @@ int load_variable(double *x_var, /* variable value */
var = EDDY_NU;
*d_x_var = 1.;
break;
case TURB_K:
*x_var = fv->turb_k;
var = TURB_K;
*d_x_var = 1.;
break;
case TURB_DISS:
*x_var = fv->turb_diss;
var = TURB_DISS;
*d_x_var = 1.;
break;
case LIGHT_INTP:
*x_var = fv->poynt[0];
var = LIGHT_INTP;
Expand Down
Loading

0 comments on commit d1bdb58

Please sign in to comment.