Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
CAEBAT in ICE
This page describes the structure and usage of CAEBAT, building instructions, how to run an example, and how it is related to ICE.
Contents
Introduction to CAEBAT
Computer-Aided Engineering for Electric Drive Vehicle Batteries (CAEBAT) is an open-architecture framework that integrates multi-physics and multi-scale battery models. After experimental validation, these simulations can be used for research, design, and manufacturing.
OASFramework
The OAS modeling framework integrates all the physics necessary for development of realistic and predictive battery performance and safety models. This framework uses a Python scripting language, and controls the battery state through component and state adapters.
The component adapters interact with the components by preparing the necessary inputs to run the components and by scheduling the component runs. The state adapters interact with the battery state file by updating all the necessary information about the battery state and the methods for coupling the components. The Battery state file is the core for passing data between components.
VIBE
VIBE expands to Virtual Integrated Battery Environment. The OAS framework, along with physics and support components and the adapters constitute the VIBE. The current components are electrochemistry, thermal, electrical, and cost model.
Other
The data for CAEBAT is in a tar.gz file available upon request.
The Battery Markup Language (Battery ML) provides standardized format for the definition of all the necessary information.
The BatteryML Schema controls the structure of the output, and it uses a relational data model to stay flexible and avoid data duplication.
CAEBAT in ICE
We plan to integrate CAEBAT into ICE as a plugin so we have a tool for simulating battery codes. ICE will simply use its current tools to run CAEBAT, behind the scenes. These are a compiled effort based on the meeting of 3/21/2013. We will design CAEBAT into three different pieces:
Model
There are multiple pieces to this particular module and will probably be the most complex. The CAEBAT program will require 3 types of input files in varying degrees of format and complexity:
- The workstation.config. This will probably be pre-generated under the hood by ICE or another script and not be visible in the model builder.
- The Chartran.config file. This is a configuration setup file for the simulation. This will be pre-generated with ICE's XML format for creating the model, and the input model will be generated in the listed format (a combination of key/value pairs with bracketing). Part of the k/v pair parsing is in NiCE, but will need to investigate K/V parsing for tables and MasterDetailsPairs.
- The "model" BatML.file. The schema will be provided by the CAEBAT Folks where we will investigate a way to generically handle the schema file in order to produce the GUI layout in the model, and then transform the values inputted into the schema enforced xml file.
Launcher
The basic launcher in development will suffice, but will investigate looking into adding Entries into the JobLauncher to handle multiple input files.
Analysis ("Pretty Pictures")
AUTOCAD or other visualization tools to show the results of the simulation.
The standing basis for the model will be CAEBAT CASE 4 model.
Building CAEBAT
OASFramework
To create the OASFramework :
- Create a directory CAEBAT and cd to that directory
- Check out the source code from the repository using the following command:
svn checkout http://svn.code.sf.net/p/ipsframework/code/trunk OASFramework
- To build the library, use the following terminal commands:
cd OASFramework mkdir build cd build ccmake ..
- Press c to configure the build, then e to exit
- Edit the key CMAKE_INSTALL_PREFIX to enter the bin installation directory /PATH/TO/OASFramework/install
- Press c to reconfigure the build
- Enter g to generate and exit from ccmake
- make
- make install
VIBE
- Pre-install HDF5 and 32bit CGNS
For CGNS: in ccmake enable Fortran, HDF5 and tests. Also enable the tools if you wish to query the output.
If you want to perform optimization or parameter sweep, you also need to install DAKOTA (Design Analysis Kit for Optimization and Terascale Applications).
- Untar the VIBE compressed file into the CAEBAT directory.
tar xzvf VIBE.tar.gz cd VIBE/trunk/components/config/ ln -sf makeconfig.gnu makeconfig.local cd ../ make
Configure the installation location to /usr/bin/install and remember not to end with a "/" make install (this will install everything in the bin directory under components)
DATA
Untar the DATA directory (tar xzvf CAEBAT-DATA.tar.gz) into the /CAEBAT directory.
Running a Simulation with CAEBAT
In order to run this, make a new directory in CAEBAT called RunExample. When going through these steps remember not to have "/" on the end, and that "Library" must be spelled correctly. Create the following directories in RunExample:
- Data
- Results
- Physics
Move the following configuration files into RunExample:
- thermal_chartran_cell_twoway.conf
- workstation.conf
Move the following data files into RunExample/Data/dualfoil/
- li-ion-ebar.in
- dualfoil5.in
Configure the workstation.conf
- Change PHYS_BIN_ROOT = /RunExample/Physics
- Change DATA_ROOT = /RunExample/Data
Next, Configure the thermal_chartran_cell_twoway.conf
- Change CAEBAT_ROOT = /CAEBAT/VIBE/trunk/components
- Change SIM_ROOT = /RunExample/Results
Next, do sourcing to use the cgns library, by using the following commands:
- vi ~/.bash_profile
Create a new Library by typing the following below your current library:
- LD_LIBRARY_PATH=/opt/cgns-3.1.3-i686_gcc-4.4.6/lib:$LD_LIBRARY_PATH
Then you must restart the bash profile for this change to take effect by:
- . ~/.bash_profile
Check that this library assignment worked by using:
- echo $LD_LIBRARY_PATH
Every time the terminal is closed, the . ~/.bash_profile must be run to reassign this library. Now, to actually run the example use the following command while in /RunExample:
- /CAEBAT/OASFramework/install/bin/ips.py --simulation=thermal_chartran_cell_twoway.conf --log=temp.log --platform=workstation.conf -a
Input Parameters
This is a list of all the values that the user may like to change.
In workstation.conf:
- HOST = allu1, which is an arbitrary user set description of the host.
- MPIRUN = eval, which is the only allowed value.
mpirun is a shell script used to launch a job with MPI.
Resource detection method
- NODE_DETECTION = manual
- Description: This determines whether the user chooses the finer options in the manual allocation description section, or simply chooses a preset node detection option.
- Allowed Values: checkjob | qstat | pbs_env | slurm_env Default Value = manual
Manual allocation description
- TOTAL_PROCS = 2
- NODES = 1
- PROCS_PER_NODE = 2
- Description: This only applies when NODE_DETECTION = manual, and allows the user to choose how they want to process on their nodes.
- Allowed Values: These are shown with their default values, and can have all integer values up to the platform's capabilities.
Node topology description
- CORES_PER_NODE = 2
- SOCKETS_PER_NODE = 1
- Description: A node is a group of sockets, which are groups of cores that are single processing units capable of performing computations.
- Allowed Values: These are shown with their default values, and can have all integer values up to the platform's capabilities.
Framework for setting for node allocation NODE_ALLOCATION_MODE
- Description: This must adhere to the platform's capabilities, and describes the number of processes per node.
- Allowed Values:
- EXCLUSIVE: Allows only one task per node.
- SHARED: Allows multiple tasks to share a node. (Default Value)
In thermal_chartran_cell_twoway.conf: These will be shown with their default values, and allowed values are arbitrary strings unless otherwise stated.
Parameter | Default Value | Explanation |
---|---|---|
RUN_ID | CoupledCellElectroChemThermalTransport | Identifier for this simulation run |
SIM_NAME | ${RUN_ID} | Name of current simulation, the default value automatically finds the name. |
PLASMA_STATE_WORK_DIR | $SIM_ROOT/work/battery_state | Where to put state files as the simulation evolves, allowed values will be any existing directory. |
RUN_COMMENT | Coupled CAEBAT Module simulation | A run comment picked up by the portal. |
TAG | ElectroChemThermal | A tag that enables related runs to be retrieved together. |
USER | ul2 | An optional parameter, if missing the unix username is used. |
NUM_ZONES, NUM_CHARTRAN_ZONES | 15, 15 | These are the number of zones for ---? |
SIMULATION_MODE | NORMAL | The Simulation mode setting, with the allowed values of ---? |
LOG_LEVEL | WARNING | This changes what will appear in the log, with the allowed values of ERROR or WARNING. |
LOG_FILE | $SIM_ROOT/${SIM_NAME}.log | This determines the name and location of the created log file, and the allowed values are any path to an existing directory followed by ".log". |
NAMES | INIT DRIVER CHARTRAN THERMAL | DRIVER and INIT are required values in the port section. |
IMPLEMENTATION | CHARTRAN_THERMAL_DRIVER | This tells how the simulation initialized, and will generate the first state if needed. |
For THERMAL, IMPLEMENTATION = AMPERES. For CHARTRAN, IMPLEMENTATION = DUALFOIL. These IMPLEMENTATIONs and DRIVERs are described below.
Individual configuration sections
Component specification, with entries similar for all components. NAME entry must match the name of the python class that implements the component. This section is where the user can fine tune the simulation to their liking. The user can determine which scripts to execute, the input and output files, and the classes to run for these main three types of simulations.
CHARTRAN_THERMAL_DRIVER
Parameter | Default Value | Explanation |
---|---|---|
CLASS | DRIVERS | This is a class from the initialized list in the PORTS section. |
SUB_CLASS | CHARTRAN_THERMAL | This is an implementation for the above CLASS? |
NAME | Driver | The name of the python class implementing the component. |
NPROC | 1 | This is the number of processes that can run at once? |
BIN_PATH | $CAEBAT_ROOT/bin | This provides the location of the bin directory. |
INPUT_DIR | $DATA_ROOT/ | This provides the location of the input files. |
INPUT_FILES | This provides each required input file by giving their names. | |
OUTPUT_FILES | $CURRENT_STATE | This writes the output files to a certain file...? |
SCRIPT | $BIN_PATH/thermal_chartran_driver_n.py | This tells which script to execute. |
AMPERES
Parameter | Default Value |
---|---|
CLASS | THERMAL |
SUB_CLASS | _ |
NAME | Amperes |
NPROC | 1 |
ELECTRICAL | 0 |
BIN_PATH | $CAEBAT_ROOT/bin |
INPUT_DIR | $DATA_ROOT/amperes_thermal |
INPUT_FILES | Battery-zones1.e |
OUTPUT_FILES | $CURRENT_STATE |
SCRIPT | $BIN_PATH/amperes_thermal.py |
DUALFOIL
Parameter | Default Value |
---|---|
CLASS | CHARTRAN |
SUB_CLASS | |
NAME | Amperes |
NPROC | DualFoil |
ELECTRICAL | 1 |
BIN_PATH | $CAEBAT_ROOT/bin |
INPUT_DIR | $DATA_ROOT/dualfoil |
INPUT_FILES | dualfoil5.in, li-ion-ebar.in |
OUTPUT_FILES | df_caebat.out |
SCRIPT | $BIN_PATH/dualfoil_chartran.py |
Time loop specification
The two MODEs:
- REGULAR: The framework uses the variables START, FINISH, and NSTEP.
- EXPLICIT: The framework uses the variable VALUES (a space separated list of time values).
Shown below are the default values:
MODE = REGULAR
START = 0.0
FINISH = 30.
NSTEP = 1
VALUES = 3.4 3.5 3.6 3.7