Skip to content

Commit 6b52ed9

Browse files
Add latent_correlation_i for use with manifold (#623)
* Initial restructuring for Manifold * Add comments * Revert to correlation in calcBoilT * Only pass single h_gas * cp at ref_T * T not ref_T * Format * Remove unnecessary comment in SpraySetup.cpp Removed comment about latentRef_minus_gasRefH_i not needed for the Manifold model. --------- Co-authored-by: Bruce Perry <Bruce.Perry@nrel.gov>
1 parent 00a7d50 commit 6b52ed9

File tree

4 files changed

+39
-12
lines changed

4 files changed

+39
-12
lines changed

Source/Spray/Drag.H

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ calcVaporState(
5656
const amrex::Real& C_eps,
5757
const amrex::Real& mw_part,
5858
const amrex::Real* Y_l,
59-
const amrex::Real* h_part,
59+
const amrex::Real* h_gas,
6060
const amrex::Real* cp_n,
6161
const amrex::Real* cBoilT,
6262
amrex::Real* Y_skin,
@@ -75,9 +75,11 @@ calcVaporState(
7575
amrex::Real T_part = amrex::min(T_in, 0.99 * cBoilT[spf]);
7676

7777
// Compute latent heat
78-
amrex::Real part_latent =
79-
h_part[fspec] + fdat.liqprops.latentRef_minus_gasRefH_i[spf] -
80-
fdat.liqprops.cp_i(T_part, spf) * (T_part - fdat.liqprops.ref_T);
78+
amrex::Real part_latent = fdat.liqprops.latent_i(T_part, h_gas[fspec], spf);
79+
// TODO: for Manifold model part_latent should be latent_correlation_i
80+
// amrex::Real part_latent =
81+
// liqprops.latent_correlation_i(liqprops.boilT_i(spf), spf);
82+
8183
L_fuel[spf] = part_latent;
8284

8385
amrex::Real pres_sat = fdat.liqprops.psat_i(T_part, spf, part_latent);
@@ -171,7 +173,7 @@ calculateSpraySource(
171173
get_lambda = false;
172174
}
173175
amrex::GpuArray<amrex::Real, NUM_SPECIES> Y_skin;
174-
amrex::GpuArray<amrex::Real, NUM_SPECIES> h_part;
176+
amrex::GpuArray<amrex::Real, NUM_SPECIES> h_gas;
175177
amrex::GpuArray<amrex::Real, NUM_SPECIES> cp_n;
176178
amrex::GpuArray<amrex::Real, NUM_SPECIES> Ddiag;
177179
amrex::GpuArray<amrex::Real, SPRAY_FUEL_NUM> L_fuel = {{0.0}};
@@ -219,10 +221,10 @@ calculateSpraySource(
219221
}
220222
// Calculate the C_p at the skin temperature for each species
221223
eos.T2Cpi(T_skin, cp_n.data());
222-
eos.T2Hi(T_part, h_part.data());
224+
eos.T2Hi(T_part, h_gas.data());
223225
for (int n = 0; n < NUM_SPECIES; ++n) {
224226
Y_skin[n] = 0.;
225-
h_part[n] *= SprayUnits::eng_conv;
227+
h_gas[n] *= SprayUnits::eng_conv;
226228
cp_n[n] *= SprayUnits::eng_conv;
227229
}
228230
amrex::Real cp_skin = 0.; // Average C_p in modeled skin phase
@@ -231,7 +233,7 @@ calculateSpraySource(
231233
amrex::Real sumXVap = 0.; // Sum of Y_L Psat_f / mw_f
232234
if (fdat.mass_trans) {
233235
calcVaporState(
234-
fdat, gpv, rule, T_part, C_eps, mw_part, Y_part.data(), h_part.data(),
236+
fdat, gpv, rule, T_part, C_eps, mw_part, Y_part.data(), h_gas.data(),
235237
cp_n.data(), cBoilT, Y_skin.data(), X_vapor.data(), L_fuel.data(), B_M,
236238
sumXVap, cp_skin, mw_skin);
237239
} else {
@@ -432,7 +434,7 @@ calculateSpraySource(
432434
amrex::Real midot =
433435
(newY * pmass - oldY * startmass) / (fdat.dtmod * flow_dt);
434436
gpv.fluid_Y_dot[spf] = num_ppp * midot;
435-
gpv.fluid_eng_src += num_ppp * midot * h_part[fdspec];
437+
gpv.fluid_eng_src += num_ppp * midot * h_gas[fdspec];
436438
p.rdata(SprayComps::pstateY + spf) = Y_part[spf];
437439
}
438440
AMREX_D_TERM(p.rdata(SprayComps::pstateVel) = vel_part[0];

Source/Spray/SprayFuelData.H

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,13 @@ struct SprayData
106106
const amrex::Real RU = pele::physics::Constants::RU * SprayUnits::ru_conv;
107107
const amrex::Real PATM =
108108
pele::physics::Constants::PATM * SprayUnits::pres_conv;
109+
109110
for (int spf = 0; spf < SPRAY_FUEL_NUM; ++spf) {
110111
const amrex::Real mw_li = liqprops.mw_i(spf);
112+
113+
// Use correlation to avoid calling eos.T2Hi for each boilT_i(spf)
111114
const amrex::Real Hboil_ref =
112-
liqprops.latent_i(liqprops.boilT_i(spf), spf);
115+
liqprops.latent_correlation_i(liqprops.boilT_i(spf), spf);
113116

114117
// Estimate the boiling temperature at the gas phase pressure using
115118
// Clasius-Clapeyron relation

Source/Spray/SprayPropertiesGCM.H

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,19 @@ struct GCMLiqProps : public BaseLiqProps
148148

149149
AMREX_GPU_HOST_DEVICE
150150
AMREX_FORCE_INLINE
151-
amrex::Real latent_i(const amrex::Real T, const int spf) const
151+
amrex::Real latent_i(
152+
const amrex::Real T, const amrex::Real h_gas_spf, const int spf) const
152153
{
154+
amrex::Real latent_heat_i =
155+
h_gas_spf + latentRef_minus_gasRefH_i[spf] - cp_i(T, spf) * (T - ref_T);
156+
return latent_heat_i;
157+
}
158+
159+
AMREX_GPU_HOST_DEVICE
160+
AMREX_FORCE_INLINE
161+
amrex::Real latent_correlation_i(const amrex::Real T, const int spf) const
162+
{
163+
// Correlation to be used with manifold model
153164
const amrex::Real Tc_i = critT_i(spf);
154165
const amrex::Real Tb_i = boilT_i(spf);
155166
const amrex::Real Tr = T / Tc_i;

Source/Spray/SprayPropertiesPeleMP.H

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,19 @@ struct MPLiqProps : public BaseLiqProps
8484

8585
AMREX_GPU_HOST_DEVICE
8686
AMREX_FORCE_INLINE
87-
amrex::Real latent_i(const amrex::Real T, const int spf) const
87+
amrex::Real latent_i(
88+
const amrex::Real T, const amrex::Real h_gas_spf, const int spf) const
8889
{
90+
amrex::Real latent_heat_i =
91+
h_gas_spf + latentRef_minus_gasRefH_i[spf] - cp_i(T, spf) * (T - ref_T);
92+
return latent_heat_i;
93+
}
94+
95+
AMREX_GPU_HOST_DEVICE
96+
AMREX_FORCE_INLINE
97+
amrex::Real latent_correlation_i(const amrex::Real T, const int spf) const
98+
{
99+
// Correlation to be used with manifold model
89100
// Since we only know the latent heat at the reference temperature,
90101
// modify Watsons power law to find latent heat at any temperature
91102
return latent[spf] *

0 commit comments

Comments
 (0)