@@ -322,6 +322,44 @@ struct VolumetricFlowRateOutlet{V,F1<:Function} <: AbstractBoundaryInterface
322
322
end
323
323
export VolumetricFlowRateOutlet
324
324
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
+
325
363
"""
326
364
VolumeMaintainingOutlet is designed for gas phase domain such that the flow rate of this outlet will adjust to maintain the volume of the
327
365
domain to be constant. This is particularly useful to simulate any vapor-liquid phase system where the gas phase outlet
0 commit comments