Lines Matching +full:- +full:t

1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
4 // SPDX-License-Identifier: BSD-2-Clause
32 * If wall_dist > prof_wd[-1], then the interpolation takes the values at prof_wd[-1]
43 const CeedInt nprofs = stg_ctx->nprofs; in InterpolateProfile()
44 const CeedScalar *prof_wd = &stg_ctx->data[stg_ctx->offsets.wall_dist]; in InterpolateProfile()
45 const CeedScalar *prof_eps = &stg_ctx->data[stg_ctx->offsets.eps]; in InterpolateProfile()
46 const CeedScalar *prof_lt = &stg_ctx->data[stg_ctx->offsets.lt]; in InterpolateProfile()
47 const CeedScalar *prof_ubar = &stg_ctx->data[stg_ctx->offsets.ubar]; in InterpolateProfile()
48 const CeedScalar *prof_cij = &stg_ctx->data[stg_ctx->offsets.cij]; in InterpolateProfile()
49 CeedInt idx = -1; in InterpolateProfile()
59 CeedScalar coeff = (wall_dist - prof_wd[idx - 1]) / (prof_wd[idx] - prof_wd[idx - 1]); in InterpolateProfile()
61 …ubar[0] = prof_ubar[0 * nprofs + idx - 1] + coeff * (prof_ubar[0 * nprofs + idx] - prof_ubar[0 * n… in InterpolateProfile()
62 …ubar[1] = prof_ubar[1 * nprofs + idx - 1] + coeff * (prof_ubar[1 * nprofs + idx] - prof_ubar[1 * n… in InterpolateProfile()
63 …ubar[2] = prof_ubar[2 * nprofs + idx - 1] + coeff * (prof_ubar[2 * nprofs + idx] - prof_ubar[2 * n… in InterpolateProfile()
64 …cij[0] = prof_cij[0 * nprofs + idx - 1] + coeff * (prof_cij[0 * nprofs + idx] - prof_cij[0 * npro… in InterpolateProfile()
65 …cij[1] = prof_cij[1 * nprofs + idx - 1] + coeff * (prof_cij[1 * nprofs + idx] - prof_cij[1 * npro… in InterpolateProfile()
66 …cij[2] = prof_cij[2 * nprofs + idx - 1] + coeff * (prof_cij[2 * nprofs + idx] - prof_cij[2 * npro… in InterpolateProfile()
67 …cij[3] = prof_cij[3 * nprofs + idx - 1] + coeff * (prof_cij[3 * nprofs + idx] - prof_cij[3 * npro… in InterpolateProfile()
68 …cij[4] = prof_cij[4 * nprofs + idx - 1] + coeff * (prof_cij[4 * nprofs + idx] - prof_cij[4 * npro… in InterpolateProfile()
69 …cij[5] = prof_cij[5 * nprofs + idx - 1] + coeff * (prof_cij[5 * nprofs + idx] - prof_cij[5 * npro… in InterpolateProfile()
70 *eps = prof_eps[idx - 1] + coeff * (prof_eps[idx] - prof_eps[idx - 1]); in InterpolateProfile()
71 *lt = prof_lt[idx - 1] + coeff * (prof_lt[idx] - prof_lt[idx - 1]); in InterpolateProfile()
73 ubar[0] = prof_ubar[1 * nprofs - 1]; in InterpolateProfile()
74 ubar[1] = prof_ubar[2 * nprofs - 1]; in InterpolateProfile()
75 ubar[2] = prof_ubar[3 * nprofs - 1]; in InterpolateProfile()
76 cij[0] = prof_cij[1 * nprofs - 1]; in InterpolateProfile()
77 cij[1] = prof_cij[2 * nprofs - 1]; in InterpolateProfile()
78 cij[2] = prof_cij[3 * nprofs - 1]; in InterpolateProfile()
79 cij[3] = prof_cij[4 * nprofs - 1]; in InterpolateProfile()
80 cij[4] = prof_cij[5 * nprofs - 1]; in InterpolateProfile()
81 cij[5] = prof_cij[6 * nprofs - 1]; in InterpolateProfile()
82 *eps = prof_eps[nprofs - 1]; in InterpolateProfile()
83 *lt = prof_lt[nprofs - 1]; in InterpolateProfile()
95 * @param[in] kcut Mesh-induced cutoff wavenumber
96 * @param[in] ke Energy-containing wavenumber
102 …const CeedScalar feta_x_fcut = exp(-Square(12 * kappa / keta) - Cube(4 * Max(kappa - 0.9 * kcut, 0… in Calc_qn()
103 …return pow(kappa / ke, 4.) * pow(1 + 2.4 * Square(kappa / ke), -17. / 6) * feta_x_fcut * dkappa * … in Calc_qn()
111 *keta = 2 * M_PI * pow(Cube(nu) / eps, -0.25); in SpectrumConstants()
130 const CeedInt nmodes = stg_ctx->nmodes; in CalcSpectrum()
131 const CeedScalar *kappa = &stg_ctx->data[stg_ctx->offsets.kappa]; in CalcSpectrum()
137 const CeedScalar dkappa = n == 0 ? kappa[0] : kappa[n] - kappa[n - 1]; in CalcSpectrum()
147 * @brief Calculate u(x,t) for STG inflow condition
149 * @param[in] X Location to evaluate u(X,t)
150 * @param[in] t Time to evaluate u(X,t)
154 * @param[out] u Velocity at X and t
157 CEED_QFUNCTION_HELPER void StgShur14Calc(const CeedScalar X[3], const CeedScalar t, const CeedScala… in StgShur14Calc() argument
159 const CeedInt nmodes = stg_ctx->nmodes; in StgShur14Calc()
160 const CeedScalar *kappa = &stg_ctx->data[stg_ctx->offsets.kappa]; in StgShur14Calc()
161 const CeedScalar *phi = &stg_ctx->data[stg_ctx->offsets.phi]; in StgShur14Calc()
162 const CeedScalar *sigma = &stg_ctx->data[stg_ctx->offsets.sigma]; in StgShur14Calc()
163 const CeedScalar *d = &stg_ctx->data[stg_ctx->offsets.d]; in StgShur14Calc()
168 xhat[0] = (X[0] - stg_ctx->u0 * t) * Max(2 * kappa[0] / kappa[n], 0.1); in StgShur14Calc()
184 * @brief Calculate u(x,t) for STG inflow condition
186 * @param[in] X Location to evaluate u(X,t)
187 * @param[in] t Time to evaluate u(X,t)
195 * @param[out] u Velocity at X and t
198 CEED_QFUNCTION_HELPER void StgShur14Calc_PrecompEktot(const CeedScalar X[3], const CeedScalar t, co… in StgShur14Calc_PrecompEktot() argument
202 const CeedInt nmodes = stg_ctx->nmodes; in StgShur14Calc_PrecompEktot()
203 const CeedScalar *kappa = &stg_ctx->data[stg_ctx->offsets.kappa]; in StgShur14Calc_PrecompEktot()
204 const CeedScalar *phi = &stg_ctx->data[stg_ctx->offsets.phi]; in StgShur14Calc_PrecompEktot()
205 const CeedScalar *sigma = &stg_ctx->data[stg_ctx->offsets.sigma]; in StgShur14Calc_PrecompEktot()
206 const CeedScalar *d = &stg_ctx->data[stg_ctx->offsets.d]; in StgShur14Calc_PrecompEktot()
213 xhat[0] = (X[0] - stg_ctx->u0 * t) * Max(2 * kappa[0] / kappa[n], 0.1); in StgShur14Calc_PrecompEktot()
217 const CeedScalar dkappa = n == 0 ? kappa[0] : kappa[n] - kappa[n - 1]; in StgShur14Calc_PrecompEktot()
241 const CeedScalar dx = stg_ctx->dx; in StgShur14Preprocess()
242 const CeedScalar mu = stg_ctx->newtonian_ctx.mu; in StgShur14Preprocess()
243 const CeedScalar theta0 = stg_ctx->theta0; in StgShur14Preprocess()
244 const CeedScalar P0 = stg_ctx->P0; in StgShur14Preprocess()
245 const CeedScalar Rd = GasConstant(&stg_ctx->newtonian_ctx); in StgShur14Preprocess()
249 const CeedInt nmodes = stg_ctx->nmodes; in StgShur14Preprocess()
250 const CeedScalar *kappa = &stg_ctx->data[stg_ctx->offsets.kappa]; in StgShur14Preprocess()
263 ScaleN(h_node_sep, stg_ctx->h_scale_factor, 3); in StgShur14Preprocess()
271 const CeedScalar dkappa = n == 0 ? kappa[0] : kappa[n] - kappa[n - 1]; in StgShur14Preprocess()
287 const NewtonianIdealGasContext gas = &stg_ctx->newtonian_ctx; in ICsStg()
289 const CeedScalar dx = stg_ctx->dx; in ICsStg()
290 const CeedScalar time = stg_ctx->time; in ICsStg()
291 const CeedScalar theta0 = stg_ctx->theta0; in ICsStg()
292 const CeedScalar P0 = stg_ctx->P0; in ICsStg()
294 const CeedScalar nu = gas->mu / rho; in ICsStg()
303 ScaleN(h_node_sep, stg_ctx->h_scale_factor, 3); in ICsStg()
306 if (stg_ctx->use_fluctuating_IC) { in ICsStg()
315 StateToQ(gas, s, q, gas->state_var); in ICsStg()
339 const bool is_implicit = stg_ctx->is_implicit; in StgShur14Inflow()
340 const bool mean_only = stg_ctx->mean_only; in StgShur14Inflow()
341 const bool prescribe_T = stg_ctx->prescribe_T; in StgShur14Inflow()
342 const CeedScalar dx = stg_ctx->dx; in StgShur14Inflow()
343 const CeedScalar mu = stg_ctx->newtonian_ctx.mu; in StgShur14Inflow()
344 const CeedScalar time = stg_ctx->time; in StgShur14Inflow()
345 const CeedScalar theta0 = stg_ctx->theta0; in StgShur14Inflow()
346 const CeedScalar P0 = stg_ctx->P0; in StgShur14Inflow()
347 const CeedScalar cv = stg_ctx->newtonian_ctx.cv; in StgShur14Inflow()
348 const CeedScalar Rd = GasConstant(&stg_ctx->newtonian_ctx); in StgShur14Inflow()
349 const CeedScalar gamma = HeatCapacityRatio(&stg_ctx->newtonian_ctx); in StgShur14Inflow()
356 wdetJb *= is_implicit ? -1. : 1.; in StgShur14Inflow()
361 ScaleN(h_node_sep, stg_ctx->h_scale_factor, 3); in StgShur14Inflow()
377 P = rho * Rd * theta0; // interior rho with exterior T in StgShur14Inflow()
379 E_internal = q[4][i] - E_kinetic; // uses prescribed rho and u, E from solution in StgShur14Inflow()
380 P = E_internal * (gamma - 1.); in StgShur14Inflow()
393 // -- Density in StgShur14Inflow()
394 v[0][i] -= wdetJb * rho * u_normal; in StgShur14Inflow()
396 // -- Momentum in StgShur14Inflow()
397 for (CeedInt j = 0; j < 3; j++) v[j + 1][i] -= wdetJb * (rho * u_normal * u[j] + norm[j] * P); in StgShur14Inflow()
399 // -- Total Energy Density in StgShur14Inflow()
400 v[4][i] -= wdetJb * u_normal * (E + P); in StgShur14Inflow()
416 const bool implicit = stg_ctx->is_implicit; in StgShur14Inflow_Jacobian()
417 const CeedScalar cv = stg_ctx->newtonian_ctx.cv; in StgShur14Inflow_Jacobian()
418 const CeedScalar Rd = GasConstant(&stg_ctx->newtonian_ctx); in StgShur14Inflow_Jacobian()
419 const CeedScalar gamma = HeatCapacityRatio(&stg_ctx->newtonian_ctx); in StgShur14Inflow_Jacobian()
421 const CeedScalar theta0 = stg_ctx->theta0; in StgShur14Inflow_Jacobian()
422 const bool prescribe_T = stg_ctx->prescribe_T; in StgShur14Inflow_Jacobian()
426 // -- Interp-to-Interp q_data in StgShur14Inflow_Jacobian()
430 const CeedScalar wdetJb = (implicit ? -1. : 1.) * q_data_sur[0][i]; in StgShur14Inflow_Jacobian()
435 // TODO This is almost certainly a bug. Velocity isn't stored here, only 0s. in StgShur14Inflow_Jacobian()
437 // enabling user to choose between weak T and weak rho inflow in StgShur14Inflow_Jacobian()
445 dP = drho * Rd * theta0; // interior rho with exterior T in StgShur14Inflow_Jacobian()
449 dP = dE * (gamma - 1.); in StgShur14Inflow_Jacobian()
455 v[0][i] = -wdetJb * drho * u_normal; in StgShur14Inflow_Jacobian()
456 …for (int j = 0; j < 3; j++) v[j + 1][i] = -wdetJb * (drho * u_normal * velocity[j] + norm[j] * dP); in StgShur14Inflow_Jacobian()
457 v[4][i] = -wdetJb * u_normal * (dE + dP); in StgShur14Inflow_Jacobian()
466 * through the native PETSc `DMAddBoundary` -> `bcFunc` method.
476 const NewtonianIdealGasContext gas = &stg_ctx->newtonian_ctx; in StgShur14InflowStrongQF()
478 const bool mean_only = stg_ctx->mean_only; in StgShur14InflowStrongQF()
479 const CeedScalar dx = stg_ctx->dx; in StgShur14InflowStrongQF()
480 const CeedScalar time = stg_ctx->time; in StgShur14InflowStrongQF()
481 const CeedScalar theta0 = stg_ctx->theta0; in StgShur14InflowStrongQF()
482 const CeedScalar P0 = stg_ctx->P0; in StgShur14InflowStrongQF()
484 const CeedScalar nu = gas->mu / rho; in StgShur14InflowStrongQF()
496 ScaleN(h_node_sep, stg_ctx->h_scale_factor, 3); in StgShur14InflowStrongQF()
513 StateToQ(gas, s, q, gas->state_var); in StgShur14InflowStrongQF()
514 switch (gas->state_var) { in StgShur14InflowStrongQF()
516 q[4] = 0.; // Don't set energy in StgShur14InflowStrongQF()
519 q[0] = 0; // Don't set pressure in StgShur14InflowStrongQF()
522 q[0] = 0; // Don't set V_density in StgShur14InflowStrongQF()