33 if (!solver->
flag_ib)
return(0);
39 double inv_gamma_m1 = 1.0 / (param->gamma - 1.0);
41 double ramp_fac = 1.0;
42 if (param->t_ib_ramp > 0) {
43 double x = t/param->t_ib_ramp;
50 double r = param->t_ib_ramp/param->t_ib_width;
51 ramp_fac = (a*exp(c*r)+b*exp(r*x))/(exp(c*r)+exp(r*x));
55 fprintf(stderr,
"Error in NavierStokes3DImmersedBoundary():\n");
56 fprintf(stderr,
" Ramp type %s not recognized.\n", param->ib_ramp_type);
61 for (n=0; n<nb; n++) {
63 int node_index = boundary[n].p;
64 double *alpha = &(boundary[n].interp_coeffs[0]);
65 int *nodes = &(boundary[n].interp_nodes[0]);
66 double factor = boundary[n].surface_distance / boundary[n].interp_node_distance;
71 v[k] += ( alpha[j] * u[_MODEL_NVARS_*nodes[j]+k] );
75 double rho, uvel, vvel, wvel, energy, pressure;
78 double rho_gpt, uvel_gpt, vvel_gpt, wvel_gpt, energy_gpt, pressure_gpt;
89 double rho_ib_target, uvel_ib_target, vvel_ib_target, wvel_ib_target, pressure_ib_target;
91 pressure_ib_target = pressure;
92 uvel_ib_target = -uvel * factor;
93 vvel_ib_target = -vvel * factor;
94 wvel_ib_target = -wvel * factor;
96 double rho_ib, uvel_ib, vvel_ib, wvel_ib, energy_ib, pressure_ib;
97 rho_ib = ramp_fac * rho_ib_target + (1.0-ramp_fac) * rho_gpt;
98 pressure_ib = ramp_fac * pressure_ib_target + (1.0-ramp_fac) * pressure_gpt;
99 uvel_ib = ramp_fac * uvel_ib_target + (1.0-ramp_fac) * uvel_gpt;
100 vvel_ib = ramp_fac * vvel_ib_target + (1.0-ramp_fac) * vvel_gpt;
101 wvel_ib = ramp_fac * wvel_ib_target + (1.0-ramp_fac) * wvel_gpt;
102 energy_ib = inv_gamma_m1*pressure_ib
103 + 0.5*rho_ib*(uvel_ib*uvel_ib+vvel_ib*vvel_ib+wvel_ib*wvel_ib);
133 if (!solver->
flag_ib)
return(0);
139 double inv_gamma_m1 = 1.0 / (param->gamma - 1.0);
141 double ramp_fac = 1.0;
142 if (param->t_ib_ramp > 0) {
143 double x = t/param->t_ib_ramp;
150 double r = param->t_ib_ramp/param->t_ib_width;
151 ramp_fac = (a*exp(c*r)+b*exp(r*x))/(exp(c*r)+exp(r*x));
155 fprintf(stderr,
"Error in NavierStokes3DImmersedBoundary():\n");
156 fprintf(stderr,
" Ramp type %s not recognized.\n", param->ib_ramp_type);
161 for (n=0; n<nb; n++) {
163 int node_index = boundary[n].p;
164 double *alpha = &(boundary[n].interp_coeffs[0]);
165 int *nodes = &(boundary[n].interp_nodes[0]);
166 double factor = boundary[n].surface_distance / boundary[n].interp_node_distance;
171 v[k] += ( alpha[j] * u[_MODEL_NVARS_*nodes[j]+k] );
175 double rho, uvel, vvel, wvel, energy, pressure, temperature;
177 temperature = pressure / rho;
179 double rho_gpt, uvel_gpt, vvel_gpt, wvel_gpt, energy_gpt, pressure_gpt, temperature_gpt;
189 temperature_gpt = pressure_gpt / rho_gpt;
191 double rho_ib_target,
192 uvel_ib_target, vvel_ib_target, wvel_ib_target,
194 temperature_ib_target;
195 temperature_ib_target = (1.0+factor)*param->T_ib_wall - factor * temperature;
196 if ( (temperature_ib_target < param->T_ib_wall/param->ib_T_tol)
197 || (temperature_ib_target > param->T_ib_wall*param->ib_T_tol) ) {
198 temperature_ib_target = param->T_ib_wall;
200 pressure_ib_target = pressure;
201 rho_ib_target = pressure_ib_target / temperature_ib_target;
202 uvel_ib_target = - factor * uvel;
203 vvel_ib_target = - factor * vvel;
204 wvel_ib_target = - factor * wvel;
206 double rho_ib, uvel_ib, vvel_ib, wvel_ib, energy_ib, pressure_ib;
207 rho_ib = ramp_fac * rho_ib_target + (1.0-ramp_fac) * rho_gpt;
208 pressure_ib = ramp_fac * pressure_ib_target + (1.0-ramp_fac) * pressure_gpt;
209 uvel_ib = ramp_fac * uvel_ib_target + (1.0-ramp_fac) * uvel_gpt;
210 vvel_ib = ramp_fac * vvel_ib_target + (1.0-ramp_fac) * vvel_gpt;
211 wvel_ib = ramp_fac * wvel_ib_target + (1.0-ramp_fac) * wvel_gpt;
212 energy_ib = inv_gamma_m1*pressure_ib
213 + 0.5*rho_ib*(uvel_ib*uvel_ib+vvel_ib*vvel_ib+wvel_ib*wvel_ib);
#define _NavierStokes3DGetFlowVar_(u, stride, rho, vx, vy, vz, e, P, gamma)
#define _ArraySetValue_(x, size, value)
3D Navier Stokes equations (compressible flows)
Structure defining an immersed boundary node.
Structure containing variables for immersed boundary implementation.
Structures and function definitions for immersed boundaries.
#define _IB_RAMP_SMOOTHEDSLAB_
MPI related function definitions.
Contains structure definition for hypar.
int NavierStokes3DIBIsothermal(void *s, void *m, double *u, double t)
#define _IB_RAMP_DISABLE_
int NavierStokes3DIBAdiabatic(void *s, void *m, double *u, double t)
Structure containing variables and parameters specific to the 3D Navier Stokes equations. This structure contains the physical parameters, variables, and function pointers specific to the 3D Navier-Stokes equations.
Some basic definitions and macros.
Contains macros and function definitions for common array operations.
int MPIExchangeBoundariesnD(int, int, int *, int, void *, double *)
Structure of MPI-related variables.
Structure containing all solver-specific variables and functions.
static const int _NavierStokes3D_stride_