Boundary conditions make our simulations specific to our problem statement. If you want a specific profile of the velocity as input to your simulation (e.g. from test data for example), it is good to know how to import this boundary condition as a table. In this week’s blog post we will show you how to:
- Import a table for a velocity profile at an inlet.
- Visualize the boundary condition in a plot.
- Verify that the boundary condition is used in the simulation.
- Some tips and tricks if receiving an error message when importing tables.
Making sure the .csv format is correct
The table used for importing the boundary condition values is recommended to be stored in a file with “.csv” format. The lines in the file should have a separation with only a comma sign, and no spaces, see picture below.Note that the decimal sign can vary due to which language setting you have on your computer. Simcenter STAR-CCM+ will use a dot as decimal sign, therefore we recommend you using the same. If you want to know the format of a table on your computer, you can always create a table in Simcenter STAR-CCM+ and export it, to see which format to use.Import the table into Simcenter STAR-CCM+
To import a table into Simcenter STAR-CCM+, go to Tools -> Tables, right-click on Tables, select New table -> File table, and import the wanted file. Right-click on the imported table and choose Tabulate to visualize the imported table as the picture below is showing.If you need to update the importation, or if something seems wrong, right-click on the table and select Reload file. How to find the different choices for a table is visualized in the picture below.Create a field function
Right-click on Field functions (under Tools) and create a new field function. We will use the function Interpolate table to use the values from the table to create interpolated values of the velocity for locations in y-position. The syntax for the field function is:interpolateTable(@Table(“Velocity_scaled”),”Ycoord”,SPLINE,”meterPerSecond”,$${Position}[1])In this example:- The name of the table is Velocity_scaled,
- Ycoord is the name for the first column in the .csv file (corresponding to y-position),
- SPLINE is the interpolation method creating values between the discrete points specified in the table,
- meterPerSecond is the name of the second column in the table (corresponding to the velocity magnitude),
- Position 1 is stating that the position coordinate is aligned with the y-axis (1=y-direction, if you want x-direction that is corresponding to the value 0, and if you want z-direction that is corresponding to the value 2).