In a recent blog post, How to Build Arrays in OnScale we discussed how to build and control the size of the array structures using parameters.
In this post we will look at how to assign mechanical and electrical boundary conditions (BCs) to this model and set up an execution loop to run the model on the cloud.
Carrying on from where we left off, we will assign some boundary conditions to the extents of our model. We have several BCs available for you to choose from you can find more information on all the BCs in our Help Center articles.
We will apply an impedance (impd) boundary condition to the ZMIN and ZMAX extent of the model and we will leave all other extents as the default free.
Figure 1. The free definitions don’t need to be included, if BCs aren’t specified, they are defaulted to free
Next, we will look at how to assign electrical BCs. We are only going to drive the first column of our array; from this you should be able to adapt the code to fit your needs.
Figure 2. Electrical BCs
We will now request the calculation of arrays and outputs in the form of time histories. By default, OnScale calculates velocity arrays, we will calculate displacements as well, for more options on what OnScale can calculate see the calc command reference entry.
Figure 3. Calculate X, Y and Z displacements. Output voltage, charge and current recorded on the top electrode as well as displacement on top of one of the array elements
Before running the model, you should always issue the prcs command. In preparation for processing the timestep information, it computes the model time step for stability and opens the necessary arrays for fielddata storage. Although 80% is default, it can be on the conservative side for some models. Users can increase this using the time command (must be issued before the prcs command) to help:
- Reduce simulation time (larger timestep means less steps for a set simulation time)
- Increase accuracy (reducing the amount of sampling in the time domain)
However, it is important to note than increasing it too much will eventually cause the model to become unstable, and care should be taken. A good value to try initially is 0.95
Figure 4. If model stability is a concern, then try decreasing the TSF value
Since we are running on the cloud, we won’t set up any plotting loops, but we will show you how to check if the electrical BCs have been assigned correctly. This can only be done after the PRCS step. We will show you how to plot the piezo nodes as well as plot them on the model.
Figure 5. Don’t worry about the dummy electrodes these won’t have any effect on the results of your simulations
All that is left to do is calculate a simulation time and calculate the number of timesteps needed to run this model. The simulation time is calculated using the formula:
Nexec is the number of time steps required to run for simtime. All that is left to do now is run this model on the cloud. Click Run on Cloud and when the scheduler opens, estimate the model and run the simulation. This model is a 3×3 array and should take around 10 minutes to run on 2CPUs.Runtime can be decreased by requesting more cores, one of the perks of having a scalable HPC platform. In the next part of the series, we will explain how to set up an MPI simulation and run a 20×20 array model on cloud.