12
Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01 WS 01 Using SVD ROM for a Battery with One Cell Simplorer SVD ROM Toolkit Introduction This workshop assumes that you have already gone through the SVD ROM installation document successfully. This workshop assumes that you are familiar with Simplorer and Fluent. Not all steps are provided explicitly. In this workshop, we will show how to create the SVD ROM for a battery with one cell. The test case 01 that comes with the toolkit will be used in this workshop. SVD ROM identification procedure SVD ROM identification involves the following four steps. This workshop goes through each step for a simple battery case with one cell. 1) Run Fluent CFD model to create the step response files. 2) Use the SVD ROM toolkit to create the SVD ROM. 3) Run the SVD ROM inside Simplorer. 4) Post-process the results back in Fluent for images and animations. Step 1 : Run Fluent CFD model to create step response files Go to the Test01_Battery_with_OneCell folder shown below. This folder contains the necessary files to create the SVD ROM. Go to folder Step1_Fluent_StepRes The file_binary and file_text folders are empty at the beginning. These folders will contain step response field solution when running the CFD project.

Simplorer SVD ROM Toolkit WS 01 - register.ansys.com.cnregister.ansys.com.cn/ansyschina/minisite/201411_em/customized/... · Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

Embed Size (px)

Citation preview

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

IntroductionThis workshop assumes that you have already gone through the SVD ROM installation document successfully.This workshop assumes that you are familiar with Simplorer and Fluent. Not all steps are provided explicitly.In this workshop, we will show how to create the SVD ROM for a battery with one cell.The test case 01 that comes with the toolkit will be used in this workshop.

SVD ROM identification procedureSVD ROM identification involves the following four steps. This workshop goes through each step for a simple battery case with one cell.

1) Run Fluent CFD model to create the step response files.2) Use the SVD ROM toolkit to create the SVD ROM.3) Run the SVD ROM inside Simplorer.4) Post-process the results back in Fluent for images and animations.

Step 1 : Run Fluent CFD model to create step response filesGo to the Test01_Battery_with_OneCell folder shown below. This folder contains the necessary files to create the SVD ROM.Go to folder Step1_Fluent_StepResThe file_binary and file_text folders are empty at the beginning. These folders will contain step response field solution when running the CFD project.

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

The libudf folder contains the necessary UDFs. These UDFs are for Win7 OS using double precision. If other platforms are needed, please contact [email protected] set of Fluent cas/dat files has the steady state solution. It is set up to run the transient step response. This set of cas/dat is very similar to the set of cas/dat needed to create an LTI ROM. Launch Fluent 3ddp serial and open the cas/dat. Pay attention to the following settings:

Energy equation is turned on.Flow equations are not solved (flow is already converged).An energy source is turned on for the cell.Three UDMs are used. The first one is for steady state temperature; the second one is for ROM results; the third one is the sum of the first two, the final temperature results from the ROM.Two Execute at End UDFs are used. The two UDFs are used to capture the temperature field during the step response run. This setup is the main difference between the LTI ROM and the SVD ROM. In the LTI ROM, a monitor is set up to save the step response of certain points rather than the entire temperature field. By the way, the temperature field at different time steps will be saved in file_binary or file_text folder depending on user specification in input.txt file..

The input.txt contains user inputs to run the Fluent CFD step response run. The format of this file is the following:

binary ; binary or text format used to save temperature field-1 ; zone IDs to export temperature. Use -1 as a flag to end the list. If ONLY -1 is used, entire domain is used to export temperature.1 ; number of portscell ; port names1 ; port that is turned on. In this example, cell is turned onBinary is recommended for large cases. Text is used if one wants to exam the results using a text editor.The method supports multiple ports though the workshop has only one port for simplicity. The next workshop shows a case with multiple ports.

The jou.jou file is a simple journal file for step response run. Open the file, and you shall realize that the content is self-explanatory.Invoke ON_DEMAND(Write_SS_T_into_UDM) UDF to write the steady state solution into UDM0. The SVD ROM will calculate temperature increase only. Later on, the temperature increase, saved in UDM1 will be added to the steady state values to give actual temperature, saved in UDM2. This adding process will be done automatically later on. Save Fluent cas/dat.

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

Read the jou.jou to run the Fluent step response run. The requirement for step response run is very similar to the LTI ROM step response run. For instance, smaller dtshould be used initially to resolve the sharp increase of temperature seen initially. At the end of the step response run, results will be saved under the file_binary folder. These are temperature field solutions at each time step during the step response run. A separate file, Time_Stamp_cell.txt, in the same folder is saved to record the time information for each temperature field file. Close Fluent and we are finished with the Fluent calculation in step 1.Copy folder file_binary or file_text into folder Step2_SVD_ROM.Create a file, Input_SVDPortNames.txt, in folder Step2_SVD_ROM. The file lists all port names. Such a file already exists in the folder, the content of which is shown below.The content of folder Step2_SVD_ROM is shown below.

Step 2: Use the SVD ROM toolkit to create the SVD ROMStart Simplorer 11 or higher. Start the tool by following the screen shot below.

Simplorer Circuit > Toolkit > PersonalLib > SVD > SVD_ROM_Identification_R2014.2

You will only see the tool if the installation step was performed correctly .

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

Use the Load Config … to load the configuration file, Input_ROMconfig.txt. Or fill the panel manually and Browse to the folder Step2_SVD_ROM.

If you do not have the Input_ROMconfig.txt file for your own case, an Input_ROMconfig.txt will be created automatically for you to record all entries you used when you create the SVD ROM. If you need to modify any entry subsequently, you could load this file first to fill the panel and then make changes.

There are a few parameters used in the panel. Their meanings are the following.Number of Inputs : Specifies the number of independent heat sources.Model Name : the SVD ROM model name in Simplorer.Relative Error for Basis : Specifies an error used to determine the number of left singular vectors to represent temperature field at different time steps. It is also the approximate dimension of the subspace where temperature fields reside.No. of Snap Shots for SVD Calc. : One does not have to use all snap shots for SVD calculation. One can choose the number desired. A smaller number decreases the accuracy but reduces the memory usage during SVD calculation. So, if memory is not a concern, use -1 for greatest accuracy. -1 means to use all snap shots.Max No. of Left Singular Vectors : Specifies the max number of left singular vectors. In case one uses very small error criteria, this parameter limits the number of left singular vectors used.

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

Binary Step Response files : Specifies whether the step response files are in binary format.Manual ROM Creation : Specifies whether the second sub-step in the SVD ROM creation will be done manually. In most cases, this should NOT be turned on. State Space Model Min Order : min model order. A value of zero indicates that cross-heating contribution could be ignored based on the value of Tolerance for 0th Order specified below.State Space Model Max Order : max model order.Target Relative Error : Specifies a desired relative error. If this specified relative error is satisfied, the order used will be equal to or less than the State Space Model Max Order. If the code reaches the State Space Model Max Order before satisfying the Target Relative Error, State Space Model Max Order will be used.Tolerance for 0th Order : If the State Space Model Min Order is zero, it indicates that cross-heating contributions can be ignored, and the tolerance to ignore those is the Tolerance for 0th Order. If the State Space Model Min Order is larger zero, Tolerance for 0th Order will not be used.

Hit the Generate button.The console window will print some information. Simply hit enter key and close the console window.Close the SVD ROM Identification panel.The SVD ROM code creates some additional files. Below is the new content of folder Step2_SVD_ROM.

Basis_cell.dat is the basis calculated from SVD. This file will be used in post-processing results in Fluent later on.BasisErrorInfo.txt shows the relative error when using the above basis to represent the step response snapshots.ConfigInfo.txt contains all user inputs for easy verification.FitErrorInfo.txt contains error during the ROM creating process.SVD_ROM.sml is the SVD ROM that is loaded automatically in Simplorer.

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

Step 3 : Run the SVD ROM inside SimplorerAt the end of Step 2, you should have the SVD ROM in Simporer.Drag and drop this model into Simplorer schematic.

Set up to save the results for the four outputs.This is done by using Simplorer Circuit > Output Dialog … followed by creating a Rectangular Plot

Hook a constant value of 1 to Input1_cell.

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

Use the values shown in the panel below for a transient simulation.

Do the simulation.Save the project as OneCell_Batt_SVD_LTI into folder Step3_ROM_in_Simplorer.

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

RMB in Simplorer results schematic window and select Export.Browse to the location of your choice to save a file.Use the values shown in the panel below.

Take a look at the file. Part of the file content is below. These are the coordinates of the four basis. A linear combination of the basis using these numbers gives the SVD ROM field solution.

You can close Simplorer now and we are done with step 4.

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

Step 4 : Post-process the results back in Fluent for images and animations

Save a copy of input.txt file and libudf from folder, Step1_Fluent_StepRes, to folder, Step4_Fluent_Post.Save a copy of Basis_cell.dat file from folder, Step2_SVDROM, to folder, Step4_Fluent_Post. Recall that Basis_cell.dat was created in Step 2.Create a file, Coords_single.txt, which has the following content.

The first two numbers specify the size of the ensuing matrix. The matrix are the four numbers from the SVD ROM. These are the numbers for time of 50 seconds. So, we are going see the transient results at time of 50 seconds from the SVD ROM.

The set of Fluent cas/dat containing transient step response results at time of 50 seconds is provided. We will compare Fluent solution with SVD ROM solution.The content of folder, Step4_Fluent_Post , should look like the following:

Start Fluent and load the set of Fluent cas/dat at time of 50 seconds.Note that UDM-0 is used to save initial temperature distribution. One could display UDM-0 for confirmation.

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

Display temperature field.

Invoke the On Demand Load_Single_SVDROM_Soln UDF. SVD ROM results will be saved in UDM-2.Display UDM-2.

The two plots above are very similar. To compare results quantitatively, use the On Demand Calc_2_norm to calculate the relative error using 2-norm. The relative error is 0.49%.Note that such a good accuracy can be obtained using ANY transient input rather than just a step input function.

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

Next, let’s create an animation.Add a folder animate_ROM. This will be the folder the code looks for to save images.Add a file Coords_many.txt, the content of which is the following.

The first two numbers specify the size of the ensuing matrix. The matrix are the four numbers from coordinate step response SVD ROM. These are the numbers created in Step 3.

Note the jou_loop.jou file in the folder. This journal file helps loop over the coordinates in the file Coords_many.txt and create one image at a time and save them in folder animate_ROM.The content of folder Step4_Fluent_Post should look like below.

Start Fluent. Display temperature contour using a view of choice.Load the journal file, jou_loop.jou. Images should be saved in animate_ROM folder.One could then post-process the images for animations.

Simplorer SVD ROM Toolkit User’s Guide : Work Shop 01

WS 01

Using SVD ROM for a Battery with One Cell

Simplorer SVD ROM Toolkit

Final commentsThough the work shop uses a battery project with one cell and thus having only one input, the entire process works for multiple inputs. The next workshop shows such a case.Even though the workshop shows a simple test case, the method has been tested for cases with mesh counts of more than ten million.Known limitations are the following: The Fluent UDFs are NOT parallelized. The methodology has only been tested under Win7 OS. But other platforms are possible. If needed, please contact [email protected].