# Simcenter STAR-CCM+ Example: Calibration Study in Design Manager using Curve Fit and NRMSE (normalized root-mean-square error)

2022-05-25T07:16:53.000-0400
Simcenter STAR-CCM+ Teamcenter Share

## Summary

For validation purposes calculating the root-mean-square error is often insightful. Using this metric a calibration study using curve fit is easily performed.

## Details

 Attachments: viscoelastic_Fit.zip (2 MB)

In this example we will show you how to setup a case to calibrate a parameter to match experiments.
The case used is the 'Laminar Flow of a Viscoelastic Fluid in Cross Flow' from the validation suite of Simcenter STAR-CCM+. The normalized root-mean-square error (NRMSE) will be used to judge the fit of the simulation to the experimental measurements.

If you want to calibrate your simulation against some time-varying value please follow the instructions in Article [2]. In this article we are focusing on space-varying values - different measurement positions.

## Overview

The case is fairly straight forward. There is an inlet at the top and an outlet to the right. The flow is solved using the finite element viscoelastic flow solver using a Giesekus Leonov viscosity.

We will calibrate the velocity profile on the symmetry planes. The measurement points are highlighted above.
The parameter is the average inlet velocity.

Here you can see the result. You can see how the velocities on the symmetry in the simulation (green) match the experiment (black) much better compared to the baseline (red). In this case we used an average inlet velocity of 3.19 mm/s instead of the baseline 3 mm/s.

## Theory

We are calculating the normalized root-mean-square error (or deviation) as defined in the Wikipedia.

We first need to calculate the sum of the simulated - measured values. This value is divided by the number of measurement points and the square root is taken to get the RMSD.

We normalize this by dividing the RMSD by the maximum - the minimum value.

## Setup Steps

1. To calculate the error we first need the positions of the measurements in the experiment.
• You can find the table 'Gies_cross_Ux' with the columns 'x/h' and 'Ux'. Export it.
• Calculate the absolute positions in SI (m) units in X, Y and Z in the tool of your liking.
• For Ux, Y and Z are zero and X is multiplied with h = 2.5 mm.
• Add the absolute positions to the exported table.
• Save the everything into a csv file with the normal STAR-CCM+ table formatting (comma separated and "column name" first line).
"X","Y","Z","x/h","Ux"
0,0,0,-0.00761421319797,-2.90E-05
0.000285533,0,0,0.114213197969542,0.000512077294686
...
• Use the method from article [1] to create a .vtk file for an Arbitrary Probe.
2. To be able to use the tabulated values they need to be interpolated. This could be done as an 2-column table or and XYZ-position table.
• Read in the Gies_cross_Ux.csv file as a file table. Tools > Tables > New File Table
• Create a field function to interpolate the table ("Table:Gies_cross_Ux"):
interpolatePositionTable(@Table("Gies_cross_Ux"), "Ux")

or alternatively (both work because we are dealing with positions here)
interpolateTable(@Table("Gies_cross_Ux"), "X", LINEAR, "Ux",{Position}[0])
3. The rest of the calculation is a combination of one field function and 5 reports.
• Create a field function to calculate the squared errors ("R :Gies_cross_Ux"):
pow(${Velocity_0}-${Table:Gies_cross_Ux},2)
• Note: ${Velocity_0} is equivalent to${Velocity}[0]
• Create a Sum Report for the "R :Gies_cross_Ux" field function on the Arbitrary Probe part. ("Sum R :Ux")
• Create an Element Count Report to count the Arbitrary Probe. ("Count Gies_cross_Ux")
• Create an Minimum and Maximum Report for the ${Velocity}[0] on the Arbitrary Probe. • Create an Expression Report to calculate the final value. ("NRMSE:Ux") sqrt(${SumR :UxReport}/${CountGies_cross_UxReport}) / (${MaxUxReport}-\${MinUxReport}
4. For this example the same setup can be done for the Uy values on probes on the Y-axis with the same steps.
The NRMSE can be used to judge the fit of the simulation to the experimental measurements. It can also be a good way to judge convergence in your simulation using a monitor and plot.

## Calibration Study in Design Manager (Curve Fit)

Finally, we can run an optimization or study in the Simcenter STAR-CCM+ Design Manager to find the best parameter(s) to fit the data. In this example we do a weighted multi-objective optimization.
The objectives are to minimize the NRMSE for Ux and Uy (same weight).

The outcome of an optimization with 31 simulations can be seen in the figure below. The baseline average inlet velocity (3 mm/s, marked in magenta) if fairly far away from an optimum fit to the measurements. There seem to be two different optima for the two objectives between 3.18 and 3.21 mm/s flow rate. Results for 3.19 mm/s are shown in the second figure above.

The example files attached are a demonstration and not an endorsement of a best practice. It is provided to showcase the use of simulation features in a given application.

SummaryDetails

### Associated Components

Design Manager Electronics Cooling In-Cylinder (STAR-ICE) Job Manager Simcenter STAR-CCM+