Skip to content

Commit 48128ca

Browse files
committed
add volumetric flow rate inlet
fix Hin rename to Hpervolume
1 parent 78b0518 commit 48128ca

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

src/Interface.jl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,44 @@ struct VolumetricFlowRateOutlet{V,F1<:Function} <: AbstractBoundaryInterface
322322
end
323323
export VolumetricFlowRateOutlet
324324

325+
struct VolumetricFlowRateInlet{Q<:Real,S,V<:AbstractArray,U<:Real,X<:Real,FF<:Function} <: AbstractBoundaryInterface
326+
domain::S
327+
cs::V
328+
Vin::FF
329+
T::U
330+
P::X
331+
Hpervolume::Q
332+
end
333+
334+
"""
335+
VolumetricFlowRateInlet adds a volumetric flow rate inlet to a domain.
336+
conddict should provide the species composition in concentration, T, and P.
337+
Hin is the inlet enthalpy per mol (J/mol) and is optional, if not provided, it will be calculated from T and P.
338+
"""
339+
function VolumetricFlowRateInlet(domain::V,conddict::Dict{X1,X},Vin::FF) where {V,X1,X,FF<:Function}
340+
T = 0.0
341+
P = 0.0
342+
343+
cs = makespcsvector(domain.phase,conddict)
344+
345+
if haskey(conddict,"T")
346+
T = conddict["T"]
347+
end
348+
if haskey(conddict,"P")
349+
P = conddict["P"]
350+
end
351+
352+
if haskey(conddict,"Hin")
353+
Hpervolume = conddict["Hin"]/sum(cs) # convert to J/m3
354+
else
355+
@assert T != 0.0 && P != 0.0 "T and P need to be provided if Hin is not provided for Inlet"
356+
Hpervolume = dot(getEnthalpy.(getfield.(domain.phase.species,:thermo),T),cs) # J/m3
357+
end
358+
return VolumetricFlowRateInlet(domain,cs,Vin,T,P,Hpervolume)
359+
end
360+
361+
export VolumetricFlowRateInlet
362+
325363
"""
326364
VolumeMaintainingOutlet is designed for gas phase domain such that the flow rate of this outlet will adjust to maintain the volume of the
327365
domain to be constant. This is particularly useful to simulate any vapor-liquid phase system where the gas phase outlet

0 commit comments

Comments
 (0)