In the following example, a ramp step transient condition is created. Note that the variable names are the same as used in the User Interface, making all of the time variation methods easy to define:
bc = new BoundaryCondition("Temperature");
bc.units = "Fahrenheit";
tc = new TimeCurve("Ramp Step");
tc.setValue("T1", 10);
tc.setValue("T2", 20);
tc.setValue("T3", 30);
tc.setValue("T4", 40);
tc.setValue("F1", 1000);
tc.setValue("F2", 800);
bc.setTimeCurve(tc);
a.select(9);
a.applyBoundaryCondition(bc);
A line-by-line description is given:
>>>A boundarycondition object called “bc” is created, and is defined to be a temperature condition with units of Fahrenheit:
bc = new BoundaryCondition("Temperature");
bc.units = "Fahrenheit";
>>>A timecurve object called “tc” is created of type Ramp Step. The subsequent lines define the parameters of the ramp step:
tc = new TimeCurve("Ramp Step");
tc.setValue("T1", 10);
tc.setValue("T2", 20);
tc.setValue("T3", 30);
tc.setValue("T4", 40);
tc.setValue("F1", 1000);
tc.setValue("F2", 800);
>>>The boundarycondition object, bc, is defined as using the timecurve object, tc:
bc.setTimeCurve(tc);
>>>Surface 9 is selected, and the boundary condition applied to it:
a.select(9);
a.applyBoundaryCondition(bc);