Mike Weaver, CD-adapco Seattle - CLEERS · STAR-CD Transformation to Vertex Temperatures. ... •...
Transcript of Mike Weaver, CD-adapco Seattle - CLEERS · STAR-CD Transformation to Vertex Temperatures. ... •...
STAR-CD Shared Library Interfacefor
Third Party, 1-D Models in es-aftertreatment
Mike Weaver, CD-adapco Seattle
2010 CLEERS Workshop, April 21
• 1-D Model Integration Acknowledgement
• This project is a joint effort between– Daimler,– ICT Prague,– Exothermia,– CD-adapco.
es-aftertreatment Interfacefor Third Party 1-D Models:
• Benefit from established, advanced, calibrated reaction models developed atuniversities and research laboratories with a specific focus on aftertreatment
• Couples 3-D STAR-CD flow and thermal solution with 1-D kinetics
• Can use multiple vendor 1-D models in a single simulation with multipledevices.
• Interface accommodates either cell discretization or vertex discretization in the1-D model.
• Present Vendors Providing libraries for STAR-CD 1-D interface: - XMR (Affiliated with the Institute of Chemical Technology, Prague) - axi-suite, Exothermia (Affiliated with Aristotle University, Thessaloniki) in work
• Star-CD Interface for 1-D Aftertreatment Models ina Shared Library
• Shared Library Overview
• Physics Interface
• Computational Methodology and Validation
• Post Processing
• Practical Aspects
– Parallel Processing
– Grid Considerations• Modeling Examples• Status Report and Conclusion
Shared Library Overview
• Interface through 'libxyz.so'
• One function, esaft1d, with seven modes for initialization, time stepsolution (iteration), time step completion, termination, and restart.
• We provide a compile and link script to avoid symbol conflicts withSTAR-CD
• libxyz.so must be compiled with a compatable compiler.
• 1-D library may use own input files.
• Output file names should contain global device and channelnumbers (which are parameters in the esaft1d library function.
• Model developed using Prostar aftertreatment tools.
1-D Model Physics
STAR-CD applies Porous Coefficients to match pressure drop returned by 1-D Model (each channel)
STAR-CD to 1-D Model
Channel Inlet Boundary (each channel):Mass Flow RateTemperaturePressure
Transported Scalar Concentrations
Solid Temperature Solution Along Channel Axis, (z position) each channel
From STAR-CD to 1-D ModelSolid temperature, T(z)
STAR-CD Solid Temperature Solution
1-D Model to STAR-CD
Channel Outlet Boundary (each channel):TemperaturePressure
Transported Scalar Concentrations
Solid Enthalpy Solution Along Channel(z position) each channel
From 1-D Model to STAR-CDWall Heat transfer to solid, Q(z)Heat Capacity and enthalpyCp(z) and h(z)
Thermal Conductivities: K_axial(z), K_radial(z)
Computational Methodology:Scalars and Storage
• Transported Scalars: All reactants and products that are transported in the flow aredefined as transported scalars in Prostar and given inlet boundary concentrations forthe model.
• Non-transported Scalars: Along with the axial distribution of the transported Scalars,1-D models additionally may define any number of non-transported scalars, independentof Prostar, through the esafter1d interface.
• Arbitrary Device and Channel Memory Data: In addition to axial data storage,additional memory per device and per channel can be used.
• Storage: STAR-CD provides and efficiently manages cell storage for this data forrestarts as well as distribution in parallel processing.
• Post Processing: All values stored by the 1-D model through the interface can be post-processed in Prostar and /or output to tabulated files.
• Scratch memory: Per channel, can be allocated as well that is persistent during a run,but is not stored and therefore not retrieved at a restart.
Computational Methodology:Axial Discretization and Thermal Validation
• The interface provides for both vertex discretization and cell discretization andaccordingly for boundary value and for finite difference (finite volume)formulations. This is declared by the 1-D model during the initialization phase.
• The Temperature Solution inSTAR-CD is CELL BASED.
Validation of XMR internal Vertex Temperature andSTAR-CD Transformation to Vertex Temperatures
Computational Methodology
• 1-D Call sequence:• Initialization,• solution,• time step complete,• run complete,• restart.
• Solution phase:• Inlet conditions, pressures, and temperature profile at the beginning and
end of current time step are passed to the 1-D model.• The solution phase is called repeatedly during STAR-CD iterations within
the time-step as the flow, temperature, and heat flux fields converge.
Pressure Validation
• STAR-CD is able to duplicate the pressure drop given by the 1-D model very accurately.
• For the first time step, especially with a small number of channels, the match is notarbitrarily close, but after the first time step, it is.
• The allowable residual between the 1D model pressure drop and STAR-CD Pressure dropcan be specified as a convergence criteria in the 'esafter.control' file. The default value is1.0 Pa. This is enforced for all timesteps except the first time step.
Computational Validation
• The results for the 2x2x48, 2x4x48, 2x10x48, 2x50x48 and 2x200x48 models exactly matchthe results for the 2x1x48 model when run on a single processor..
• The 2x200x48 model when run in parallel with six processes shows slight variation aroundthe solution for the 2x1x48 model.
Tools, Analysis Controls overview
• Additional Computational Controls ‘esafter.control’ file
– Convergence Criteria for Device Heat Transfer
– Convergence Criteria for Channel Pressure Drop
– Under-relaxation Factor for channel flow resistance.
• Output Controls
– esaft1d.post file written to at same times that STAR writes transientoutput to the .ccmt file
– verbose output to console for model investigation, ‘esafter.verbose’file.
Mike Weaver
• 1-D Data stored in file named ‘esaft1d.post’.• Results written at same times that the transient output is
written to .ccmt file.• A data extraction tool is provided. ‘esaft_map_res’
– mapped contour plots in Prostar of internal 1-D modelState Variables
– Y vs. Z plots of Internal State Variables, Heat Transfer,and Temperatures;
– Y vs. Time plots for Internal State Variables, TransportedScalar Concentration, Temperature, Heat, Mass Flux,Pressure, Pressure error, maximum, minimum, area andvolume sums and averages.
Post Processing 1-D Results
Mike Weaver
Top Level Commands:
1dtest/2x200x48> esaft_map_res
Opening esaft1d.post ...
v================ Commands ==============v| 1) (mxmn) Find Max/Min/Range | 7) (lyvz) List Y vs. Z| 2) (lzax) List axial z-positions | 8) (mcon) Make Contour Plot| 3) (lcon) List Contour Variables | 9) (myvt) Make Y vs. Time Graph| 4) (ldev) List Devices | 10) (myvz) Make Y vs. Z Graph| 5) (ltim) List Times | 11) (wscr) screen width| 6) (lyvt) List Y vs. Time
enter command or q=quit>
• Entering a command without parameters results in a short ‘help’ to complete thecommand.
• Commands are NOT case sensitive. MXMN and mxmn are the same command.
• Commands mcon, myvt, and myvz make, post processing files in a subdirectory called‘post’. This directory is created if it does not exist.
Post Processing - esaft_map_res
Mike Weaver
enter command or q=quit>mxmnDev_num Y_vs_T_var_num [chan(0=all) [zpos(0=all) [time_no(0=all)] ] ]>1 8
Maximum-Minimum-Range Results for Device 1, Variable deltaP
Channel with Highest Maximum Value: 1, Results: Max: 1100.644, Time ( 50) = 50.000 Min: 478.3178, Time ( 1) = 1.000 Range: 622.3262
Channel with the lowest Maximum Value: 120, Results: Max: 1095.708, Time ( 50) = 50.000 Min: 475.5859, Time ( 1) = 1.000 Range: 620.1219
Channel with Lowest Minimum Value: 120, Results: Max: 1095.708, Time ( 50) = 50.000 Min: 475.5859, Time ( 1) = 1.000 Range: 620.1219
Channel with Highest Minimum Value: 11, Results: Max: 1100.641, Time ( 50) = 50.000 Min: 478.3214, Time ( 1) = 1.000 Range: 622.3197
Channel with Maximum Range: 1, Results: Max: 1100.644, Time ( 50) = 50.000 Min: 478.3178, Time ( 1) = 1.000 Range: 622.3262
Channel with Minimum Range: 120, Results: Max: 1095.708, Time ( 50) = 50.000 Min: 475.5859, Time ( 1) = 1.000 Range: 620.1219
Post Processing esaft_map_res command MXMN
Mike Weaver
LYVT - list Y vs. Time Graph Variables.
enter number or q=quit>lyvt
v================ Device 1, DOC_1 Y vs Time Independent Variables ==============v| 1) Vol_Area_Sum | 18) CO2_in | 35) Tz | 52) cf_NH3| 2) Vol_Area_Avg | 19) CH4_in | 36) Hz | 53) cf_N2O| 3) MaxVal | 20) NH3_in | 37) Cp | 54) cf_C3H8| 4) MinVal | 21) N2O_in | 38) dCp_dT | 55) cw_CO| 5) mdot | 22) C3H8_in | 39) k_axial | 56) cw_O2| 6) T_in | 23) CO_out | 40) k_transverse | 57) cw_H2| 7) T_out | 24) O2_out | 41) Tf | 58) cw_C3H6| 8) deltaP | 25) H2_out | 42) Ts | 59) cw_H2O| 9) P_in | 26) C3H6_out | 43) cf_CO | 60) cw_NO| 10) P_out | 27) H2O_out | 44) cf_O2 | 61) cw_NO2| 11) CO_in | 28) NO_out | 45) cf_H2 | 62) cw_CO2| 12) O2_in | 29) NO2_out | 46) cf_C3H6 | 63) cw_CH4| 13) H2_in | 30) CO2_out | 47) cf_H2O | 64) cw_NH3| 14) C3H6_in | 31) CH4_out | 48) cf_NO | 65) cw_N2O| 15) H2O_in | 32) NH3_out | 49) cf_NO2 | 66) cw_C3H8| 16) NO_in | 33) N2O_out | 50) cf_CO2| 17) NO2_in | 34) C3H8_out | 51) cf_CH4
Post Processing esaft_map_res command LYVT
• List Y vs. Time Variables - Syntax:• LYVT, [device_no]
– Device_no: Optional. All devices listed if Device_no is notspecified.
Post Processing esaft_map_res command MCON
• MCON Example (Page 1 of 2)Command line esaft_map_res generation of .usr file
v================ Commands ==============v| 1) (mxmn) Find Max/Min/Range | 7) (lyvz) List Y vs. Z| 2) (lzax) List axial z-positions | 8) (mcon) Make Contour Plot| 3) (lcon) List Contour Variables | 9) (myvt) Make Y vs. Time Graph| 4) (ldev) List Devices | 10) (myvz) Make Y vs. Z Graph| 5) (ltim) List Times | 11) (wscr) screen width| 6) (lyvt) List Y vs. Time
enter number or q=quit>ltim
v================ Times ==============v| 1) 2.000 | 11) 22.000 | 21) 42.000 | 31) 62.000 | 41) 82.000| 2) 4.000 | 12) 24.000 | 22) 44.000 | 32) 64.000 | 42) 84.000| 3) 6.000 | 13) 26.000 | 23) 46.000 | 33) 66.000 | 43) 86.000| 4) 8.000 | 14) 28.000 | 24) 48.000 | 34) 68.000 | 44) 88.000| 5) 10.000 | 15) 30.000 | 25) 50.000 | 35) 70.000 | 45) 90.000| 6) 12.000 | 16) 32.000 | 26) 52.000 | 36) 72.000 | 46) 92.000| 7) 14.000 | 17) 34.000 | 27) 54.000 | 37) 74.000 | 47) 94.000| 8) 16.000 | 18) 36.000 | 28) 56.000 | 38) 76.000 | 48) 96.000| 9) 18.000 | 19) 38.000 | 29) 58.000 | 39) 78.000 | 49) 98.000| 10) 20.000 | 20) 40.000 | 30) 60.000 | 40) 80.000 ^================ Times ==============^
enter number or q=quit>lcon
v================ Device 1, Dev_1 Contour Variables ==============v| 1) Tz | 11) cf_H2 | 21) cw_CO | 31) cw_N2O| 2) Hz | 12) cf_C3H6 | 22) cw_O2 | 32) cw_C3H8| 3) Cp | 13) cf_H2O | 23) cw_H2 | 33) s_sO2| 4) dCp_dT | 14) cf_NO | 24) cw_C3H6 | 34) s_sNOxA| 5) k_axial | 15) cf_NO2 | 25) cw_H2O | 35) s_sNOxB| 6) k_transverse | 16) cf_CO2 | 26) cw_NO | 36) s_sHC| 7) Tf | 17) cf_CH4 | 27) cw_NO2 | 37) s_sH2O| 8) Ts | 18) cf_NH3 | 28) cw_CO2 | 38) s_sNH3| 9) cf_CO | 19) cf_N2O | 29) cw_CH4| 10) cf_O2 | 20) cf_C3H8 | 30) cw_NH3
enter number or q=quit>mconMake Contour Plot:Dev_num? Plot_var_num? Stored_Time_num?>1 1 40fname = post/Cont_Tz_dev1_t00080.000.usr
Post Processing esaft_map_res command MCON
• MCON ExampleExample Contour Plot, Upper Right, with relevant diagrams alsoshown.
Original Star Solid Temperature Solution
Solid Temperature Solution Given to 1-D Model.Solid Contours from MCON command of esaft_map_res for contour variable Tz.
Solid Subdivision showingRepresentative Channel Domains
Post Processing esaft_map_res command MCON
• MCON Example: Heat Transfer to Monolith, Hz
Post Processing esaft_map_res command MYVT
• MYVT Examples
enter number or q=quit>myvt 1 1 36fname = post/y_v_t_Hz_Sum_dev1.xy
enter number or q=quit>myvtMake Make Y vs. Time Graph:Dev_num Plot_var_num (chan_num|aggregate_var_num) [zpos]>1 8 5fname = post/y_v_t_deltaP_dev1_chan5.xy
enter number or q=quit>myvtMake Make Y vs. Time Graph:Dev_num Plot_var_num (chan_num|aggregate_var_num) [zpos]>1 41 5 20fname = post/y_v_t_Tf_dev1_chan5_z20.xy
v================ Device 1, Dev_1 Y vs Time Independent Variables ==============v| 1) Vol_Area_Sum | 12) O2_in | 23) CO_out | 34) C3H8_out | 45) cf_H2 | 56) cw_O2| 2) Vol_Area_Avg | 13) H2_in | 24) O2_out | 35) Tz | 46) cf_C3H6 | 57) cw_H2| 3) MaxVal | 14) C3H6_in | 25) H2_out | 36) Hz | 47) cf_H2O | 58) cw_C3H6| 4) MinVal | 15) H2O_in | 26) C3H6_out | 37) Cp | 48) cf_NO | 59) cw_H2O| 5) mdot | 16) NO_in | 27) H2O_out | 38) dCp_dT | 49) cf_NO2 | 60) cw_NO| 6) T_in | 17) NO2_in | 28) NO_out | 39) k_axial | 50) cf_CO2 | 61) cw_NO2| 7) T_out | 18) CO2_in | 29) NO2_out | 40) k_transverse | 51) cf_CH4 | 62) cw_CO2| 8) deltaP | 19) CH4_in | 30) CO2_out | 41) Tf | 52) cf_NH3 | 63) cw_CH4| 9) P_in | 20) NH3_in | 31) CH4_out | 42) Ts | 53) cf_N2O | 64) cw_NH3| 10) P_out | 21) N2O_in | 32) NH3_out | 43) cf_CO | 54) cf_C3H8 | 65) cw_N2O| 11) CO_in | 22) C3H8_in | 33) N2O_out | 44) cf_O2 | 55) cw_CO | 66) cw_C3H8
Post Processing esaft_map_res command MYVT
• MYVT Plot Examples
Post Processing esaft_map_res command MYVT
• MYVT Example, Maximum and Minimum Channel Mass Flux
Post Processing esaft_map_res command MYVZ
• MYVZ Exampleenter number or q=quit>lyvz
v================ Device 1, Dev_1 Y vs Z Position Independent Variables ==============v| 1) Tz | 11) cf_H2 | 21) cw_CO | 31) cw_N2O| 2) Hz | 12) cf_C3H6 | 22) cw_O2 | 32) cw_C3H8| 3) Cp | 13) cf_H2O | 23) cw_H2 | 33) s_sO2| 4) dCp_dT | 14) cf_NO | 24) cw_C3H6 | 34) s_sNOxA| 5) k_axial | 15) cf_NO2 | 25) cw_H2O | 35) s_sNOxB| 6) k_transverse | 16) cf_CO2 | 26) cw_NO | 36) s_sHC| 7) Tf | 17) cf_CH4 | 27) cw_NO2 | 37) s_sH2O| 8) Ts | 18) cf_NH3 | 28) cw_CO2 | 38) s_sNH3| 9) cf_CO | 19) cf_N2O | 29) cw_CH4| 10) cf_O2 | 20) cf_C3H8 | 30) cw_NH3
enter number or q=quit>myvzMake Make Y vs. Z Graph:Dev_num? Plot_var_num? chan_num? Time?>1 7 5 10
fname = post/y_v_z_Tf_dev1_chan5_t00010.000.xy
Parallel Processing
• Decomposition for Parallel:– Cells associated with a representative channel must be on the
same processor.– Script decomp_esafter.py provided that:
» Performs metis decomposition on all parts of model not associatedwith channels on -m N partitions
» Divides channels among np processes (can be greater than -m N).» Assembles .set file for parallel run.
• Performance. Formal benchmarks have not yet beenperformed, however, observation indicates that it scales well,almost linear, down to roughly ten representative channels perprocess.
• Restarts and data storage are implemented for parallel.
Grid Considerations
•The monolith must be modelled as an extruded section.
•Cells immediately upstream and downstream with solid must be conformal with the solid.
•Grid below created with a combination of STAR-CCM+ and Axisuite
Tools, 1-D Models: Prostar Definition
Tools, Prostar Subdivision
•MonolithSubdivisionSubdivision is now performedon a section of shells takenfrom the original grid of themonolith. This facilitates userediting or loading separatelygenerated subdivisions. Somesubdivisions may be withoutflow - for modeling glue regionsand the packaging
+ Automatic subdivision optionsunchanged: Cartesian,Concentric, Mixed.
+ User can edit subdivision orprovide subdivision withoutusing automatic feature.
Subdivision
• DOC Monolith Subdivision– 167 Representative Channels– Note: 4 cell x 8 cell renderings are
in fact two subdivisions of 4 cellsby 4 cells, but happen to berendered with the same color.
• DPF Monolith Subdivision– 124 Representative Channels– Segmented, glued monolith– Glue has separate material properties.– No representative channel flow or heat
transfer in glue sections - heat transferonly by conduction in monolith.
One Device with highly non-uniform flow
Vin = 30 m/sTin = 573 deg K
To=293 K
78 RepresentativeChannels
Tetrahedral Mesh
Example: XMR model - DOC testing version (march 2010)
------- Catalyst type: -------------------------------------------
PtPd/Al2O3+zeolites
------- Reactions: -----------------------------------------------
a) CO and HC oxidation (main function of DOC)CO + 1/2 O2 -> CO2C3H6 + 9/2 O2 -> 3 H2O + 3 CO2
b) NO reduction (minor conversions under lean conditions)NO + CO -> CO2 + 1/2 N29 NO + C3H6 -> 3 CO2 + 1/2 N2 + 3 H2O
c) NO oxidation (reversible, actual NO2/NOx ratio important for DPF, SCR and LNT)NO + 1/2 O2 <-> NO2
d) NO2 reduction back to NO (significant at lower temperatures)NO2 + CO -> NO + CO29 NO2 + C3H6 -> 9 NO + 3 CO2 + 3 H2O
e) HC adsorption (important during cold start)C3H6 + Zeol <-> C3H6*Zeol
f) Water condensation and evaporation (important during cold start)H2O(g) + W <-> H2O(l)*W
Realistic global kinetics used, including proper inhibition terms.Zoned catalyst - more noble metal loading in the first half.
Example: XMR model - DOC testing version (march 2010)
------- Balanced components: -----------------------------------
a), b) gas phase components(separately bulk gas - index f, and washcoat pores - index w)COO2C3H6H2ONONO2CO2
c) components deposited on catalyst surface (index s)sHC - adsorbed hydrocarbons C3H6*ZeolsH2O - condensed water H2O(l)
Temperature During Lightoff
Example, 1048 Channels
• Fine Representative Channel Subdivision
1048 Representative Channels
• Fine Representative Channel Subdivision, similar boundaryconditions to Model 1. Pressure solution within 1 Pa untilReaction, 1.5 Pa during Reaction.
Example, 1048 channels, Temperature, H2O Gas,H2O Wall, Lean Warm Up
Temperature
H2O Gas
H2O Wall
Present Status
• Integration of XMR 1-D DOC Model:– Enthalpy transfer, energy conservation, and pressure drop validated.
– Two and three devices in serial with 100’s of channels validated
– Parallel implemented and working.
– Restart and transient output files follow STAR-CD restart and transient schedule.
– Pre-processing implemented in Prostar - es-aftertreatment for 1-D interface
– Post-processing implemented as stand alone program to extract contour plots, y vs.time and y vs. z graphs from 1-D Channel data
Path Forward
– Pilot Project over Summer with Daimler Trucking - Simulate Test Bench
– DPF Model from Exothermia
– Refine Scripts, Interface, and Further Automate
– Production Ready in Autumn
– Possible Migration to STAR-CCM+ would keep same interface.
• Thank you for your attention
• Questions...