Work-flow analyst mode and executing problems Answered
Hi there,
I would like to ask about several questions about the work-flow analyst mode and executing problems:
1)
The coding flow should be (i)define keypoints/ keyindex (ii) create grid and geometry (iii) Pick material/ assign material to geometry (iv) Set boundary conditions (v) Calculate physical quantities;
a) Is this correct?
b) Does the sequences of commands matter? For instance: if I put the “pize” after “clac”, would the displacement of this piezoelectric device be with the commands from “pize” ?
c) After calculation, I could not find the data well on post-processing mode. If you have some examples to provide the connect between codes and output results, that would be really helpful. It looks not much in the current documents for post processing.
2)
What is “prcs” specificly? If I don’t type this, what will happen? If there is “exec” afterward, this command would be ignored?
What is the necessary timing to use this command? Is it tied with command “time”?
3)
I found the example and got several qestions for it:
—————————————————————-
proc plotting save
exec 200
grph
plot ydsp rang 0
plot pres j $j7 $j8
end$ proc
proc plotting 100
term
——————————————————————
(a)What is procedure for this program? and what is “proc” ? Why do I need two “proc” here?
I don’t understand the instruction on websites: looks like there are two category (i) save, eras (ii) executing;
(b) In this picture, is “exec 200” is included in the first “proc”?
(c) What does this ‘Number of problem time steps to execute’ mean on the instruction?
(d) Does 200 represents this ‘ntime’ here for “exec”? In “proc plotting 100” <– does this 100 mean rate? I couldn’t understand the description on instruction.
(e) There are four set of syntax for “exec”, I honestly have no idea how to use them. I would like to know the physical meaning of it mostly. For instance, I wanna to execute the 1 sec for all the model with the resolution as 1 micro-second. How should I write commands?
Thanks a lot. I hope I describe my questions well.
1 comment
1.a) Here is the workflow I tend to follow which is not too far from what you have posted:
I. Define Useful variables for geometry building, locations, meshing etc..
II. Define Keypoints XYZ and IJK
III. Create GRID, tie it up with GEOM
IV. Define Materials and Assign to grid (SITE)
V. Set Boundary Conditions and Loading Conditions
VI. Outputs – Request additional outputs and time histories
VII. PRCS and Execute
b) Sequence of commands do matter in some instances as they rely on other commands to be used correctly. In your case, having the CALC command before or after the PIEZ, doesn’t affect anything. Best way to check for Order and Dependency is to right-click on any command to bring up the help, which tells you if there is a specific order that a command must follow.
c) A simple section of the help to check out is The Modelling Guide > Post Process for a quick overview of what can be done with time history data (.flxhst) and flex array data (.flxdato).
Note that flex array data must be extracted either during the execution or after execution. Please refer to The Modelling Guide > Analyst Mode > Examples > Piezoelectric Example – Model Execution. There is a small section about how to extract outputs from your model. If you would like further coded examples just let me know.
2) You can find some information about PRCS here: The Modelling Guide > Analyst Mode > Examples > Piezoelectric Example – Processing the Model
The PRCS command is required in every model. It checks that your code is correctly set up, initializes the arrays that will hold all the data calculated during execution and most importantly it calculates the timestep required to run the job based on your mesh and materials. Without it, you cannot run the model. The EXEC command would use the timestep determined by PRCS so it will return an error if there was no PRCS command.
PRCS should be issued when you are ready to execute the model – in the workflow I detailed above, at step VII.
3) a) PROC is a keyword in the SYMBOL language (like SYMB and DO which also appear red). PROC stands for procedure which in OnScale is used to set up a series of commands which can be executed over and over again (like a function in other coding languages). The first PROC command is issued to define the code we want to set up – the keyword SAVE will save this as a procedure called ‘plot’. The end$ proc line defines where the procedure finishes. We then call the procedure using the PROC command, followed by the name of the procedure and how many times we want to run the procedure for.
b) EXEC 200 – is simply running the model for 200 timesteps. By placing this command within the procedure, every time we call the procedure, it executes the model for another 200 timesteps. For definition of a timestep, refer to the help section referenced for answer 2)
c) A timestep is a unit of time to run the model for. The timestep is determined by the meshing and materials used in the model which much satisfy a condition to allow our explicit solver methods to work (Courant–Friedrichs–Lewy (CFL) condition).
d) exec 200 – run for 200 timesteps
proc plotting 100 – run the procedure ‘plotting’ 100 times ( this will execute the model for 200 x 100 timesteps)
e) As I mentioned before, the timestep is determined but the mesh and materials you use. You cannot request a 1us timestep for a model as it might not be stable for the model to run. What you do have control over is the how long to run a model for.
You mentioned you want to run a model for 1s. Simple determine how many timesteps will fit in the space of 1s. This can be done by:
symb #get { step } tmestep /* Return timestep value
symb nexec = 1 / $step /* Dividing 1s by a timestep determined by PRCS
exec $nexec /* Run the model for ‘nexec’ number of timesteps – equivalent to 1s
Please sign in to leave a comment.
Didn't find what you were looking for?
New post