Procast Optimization

  • Upload
    joel

  • View
    401

  • Download
    13

Embed Size (px)

Citation preview

  • 8/18/2019 Procast Optimization

    1/37

    Page 1/37

    Optimization module for ProCAST

    PAM-OPT coupling

    Vincent MathierCALCOM ESIParc Scientifique EPFL

    CH-1015 Lausanne, Switzerland

    Phone : +41-21-693 8317Fax : +41-21-693 4740

    Email : [email protected] : www.calcom.ch / www.esi-group.com

  • 8/18/2019 Procast Optimization

    2/37

    Page 2/37

    1.  INTRODUCTION 3 

    1.1.  CONCEPT AND DEFINITIONS  3 1.2.  OPTIMIZATION SOFTWARE  4 1.3.  POINT GENERATOR: EXTENSION TO PROCESS ROBUSTNESS AND PROCESS WINDOW  6 

    2.  PAM-OPT : ESI’S OPTIMIZATION SOFTWARE 7 

    2.1.  GENERAL PRESENTATION  7 2.2.  ALGORITHMS  7 2.3.  USEFUL FEATURES  9 

    3.  PROCAST FEATURES AVAILABLE FOR PAM-OPT COUPLING 10 

    3.1.  PRECAST BATCH MODE  10 3.2.  PRS EDITOR  11 3.3.  COMPUTATION OF SIMPLE CRITERIA  12 3.4.  USE OF LOCAL DATABASES  14 

    4.  FLOWCHART FOR SETTING UP OPTIMIZATION CALCULATIONS 15 

    4.1.  BASELINE CALCULATION  15 4.2.  EXTRACTION OF CRITERIA  18 4.3.  CREATION OF LOCAL DATABASES  19 4.4.  INPUT MODIFICATION TEMPLATE  20 4.5.  SETUP OF THE OPTIMIZATION LOOP  21 4.6.  LAUNCH OF THE CALCULATION  31 

    5.  POST-PROCESSING 31 

    5.1.  PAM-OPT OUTPUT FILES  31 5.2.  FURTHER POST-PROCESSING METHODS  32 

    6.  NOTES ON INSTALLATION 33 

  • 8/18/2019 Procast Optimization

    3/37

    Page 3/37

    1. Introduction

    This document is intended to describe the features of the ProCAST optimization module andto give guidelines about its use. For further help about how to design optimization studies

    specifically adapted to your needs, you are strongly advised to contact your local ESI support.

    1.1. Concept and definitions

    The concept of optimization (typically of a process) is quite clear as it is the goal of almostany manufacturing industry, i.e. get its processes to be better and better. The definition of“better” can have various inputs (economic factors, part quality, tooling durability) but isessentially always in the mind of process engineers. Optimization can simply be seen as amethod to find the answer to the question: “How do I make my manufacturing processbetter?”.

    To make a process better, it is necessary to adjust the values of all the different parametersthat are involved in that process (temperatures, times, geometries,…). Optimization can thenmore specifically be seen as the way to answer the question “What values to I give to myprocess parameters to make my process better?”. It is also interesting to note that optimizationis most often meant to improve an existing process. This means that a working manufacturingmethod is already in place and working in a satisfactory manner. Optimization then allowsfurther fine tuning the process parameters to achieve an even better process design. In somecases however, optimization is a tool that can prove useful when designing a brand nowprocess. Optimization can then be used to assist the process designer in finding appropriateprocess parameters in a shorter time.

    The target of the ProCAST optimization module is obviously optimization of castingprocesses. More precisely, it focuses on what values should be given to process parameters toachieve a better process. Such process parameters can be initial temperatures, cycle times,heat transfer coefficients,… Even though some modifications of geometric features arepossible in the optimization loop, they are not primarily developed (special techniques can betailored for specific problems). In addition to process optimization, generalized inversemodeling allowing the determination of material properties from experiments is also possible.In such a case, optimization is used to determine material properties (or other unknownproperties such as heat transfer coefficients) that are such that the agreement betweenmeasured and simulated data (temperature records, distortion measurements,…) is good. The

    determined materials properties can then be used in further simulations.

    At this stage, it is important to spend some time defining some of the terms that will be usedwhen discussing optimization. Up to this point, the present section is an attempt to define theterm “optimization” and how it is applied to casting using the ProCAST module. There are afew other definitions that need to be clarified for that purpose. First of all, the idea of makinga process better implies that there exists an objective function. This objective function is awell defined number that varies when the values of process parameters vary (and thus theoutcome of the process varies). The objective function is a rational measure of how “good” aprocess is. Typical objectives include defects (porosity, cracks) in the final product but canalso be the price of producing a single part (which combines production time, wear of the

    die,…). When determining material properties, the objective will be the difference betweenmeasured and simulated records. The objective function (often referred to as objective in

  • 8/18/2019 Procast Optimization

    4/37

    Page 4/37

    short) has two other features that need to be kept in mind. First of all, the goal of optimizationis to make the objective function either maximum or minimum. In that sense, optimizationcannot proceed without an objective and the definition of the objective function is sometimesone of the most complex aspects to be identified before running optimization calculations.Moreover, there exists only one objective function in a given problem. Even though it is

    possible, using slightly more advanced methods, to tackle true multi-objective problems(determination of Pareto front for example), we will not focus on them here and theframework presented will limit itself to single objective optimization (but it should be kept inmind that the definition of the objective can be quite complex and incorporate severalaspects).

    Even though the objective function is unique, it is possible to give more information to theoptimizer through constraint functions. A constraint function is again a well-defined number(that depends upon the value of process parameters and quantifies the outcome of the processitself). The idea of a constraint is to say that the value of the constraint function should not beabove (and/or below) a fixed value. Typically, a constraint can be “I do not want more that

    1% porosity in my final part”. In that sense, the goal of an optimization problem will in factbe to minimize or maximize the objective AND ensure that all constraints are met. Theinteresting feature of constraints is that there can be several of them. Of course, it is alsopossible to define none. Sometimes to refer to an objective or constraint function withoutexpressing specifically its nature, we will use the term criterion (or criterion function).

    In summary, optimization can be viewed as the determination of suitable process parameters(or material properties is some cases) values to minimize or maximize the objective andrespect all the constraints. The process parameters that are allowed to vary to achieve this goalare often referred to as design parameters. It should be kept in mind that the term designparameter is quite general in that sense and covers process parameters, material properties,

    geometrical features (even though this is outside the scope of the document),…

    Without giving many details about the optimization technique itself, it is useful to define atthis stage the idea of direct run or solver call (or sometimes direct call or even point, all fourdenominations being equivalent). It is indeed quite obvious that optimization will involveseveral different numerical simulations of the given process in which the design parametersare somehow modified. Each one of these simulations is going to be referred to as a solvercall, meaning that an optimization calculation consists of many solver calls (i.e. many castingsimulations). Please note also that a solver call does not necessary consist of a singleexecutable program. The concept of solver indeed corresponds to a chain of executableprograms whose job is to read the process parameters values and to compute the values of the

    objective and constraints functions. In the present case, the chain PreCAST – DataCAST –ProCAST will be the typical solver call.

    1.2. Optimization software

    Optimization of casting processes has classically been performed using trial and errormethods, producing full scale parts under real conditions and trying to alter a bit theseconditions. The quality of the various parts is then being assessed to select the bestcombination of process parameters or imagine what a better tuning of the process could be.This method often involves guessing and needs to be conducted by very experienced people.

    This approach quickly becomes very costly.

  • 8/18/2019 Procast Optimization

    5/37

    Page 5/37

    Nowadays, building virtual models for the simulation of a given process is standard industrialpractice. This means that experienced people can work with simulation engineers to performprocess optimization using the classical trial and error approach but producing only virtualpart and thus not wasting raw material or time on the production line. This is an improvementbut this method is still costly as it takes long working hours or highly qualified people to

    make it progress. This method is illustrated on the figure below with the blue arrow indicatingthe work done by the computer. This outlines that a lot of engineer work is required as he hasto analyze the outcome of each of one his process simulations to make the next attempt atgetting a better process (or design in more general terms).

    Further added value of simulation software can be achieved when optimization software (anoptimizer) is coupled to the virtual manufacturing models. In such a case, the job of theengineer is to define objective and constraints and to identify the unknown process parameters(and indicate in which range their values can vary). The optimization software then does the

    rest of the work, i.e. launching the process simulation, analyzing the outcome and guessingwhat a better design could be. At the end of the optimization loop, the engineer retrieves theresult from the optimization software and this result is in fact the optimized process that canthen be implemented in full scale production. As suggested by the figure below this approachsaves valuable human time and transfers most of the workload to the computer. Usingoptimization software is the best way to use nowadays computer power to both improveprocess quality and save working time for valuable workers needed in other duties.

  • 8/18/2019 Procast Optimization

    6/37

    Page 6/37

    1.3. Point generator: extension to process robustness and process window

    Having established the standard framework that we will now refer to as optimization, it isnecessary to spend some time on an additional aspect that is often less obvious but stillvaluable in the field of industrial process enhancement: the concept of process robustness. In

    general, for industrial production, the manufacturing process will be performed using welldefined values of the various process parameters that come into play. Each one of the processparameters indeed has its own target value such that, if the manufacturing process isperformed with all process parameters held at their target value, the result will be “good”. Thedifference with optimization is that a good result is defined as respecting all the constraints(part quality being one of them) without the idea of looking to maximize or minimize someobjective.

    This means that, to start with, we know what value needs to be assigned to each processparameter in order to manufacture a good component. How those target values have beendetermined is not relevant here. The main concern is the fact that no matter how good the

    manufacturing equipment is and how meticulous the factory workers are, the processparameters never reach exactly their target value. It is indeed more accurate to say that thevalues of process parameters vary (in a statistical manner) around these target values. Thesevariations can range from small to quite significant but they always exist.

    The real question behind the concept of process robustness is to know how those variations ofprocess parameters can influence the part quality. Those statistical variations will indeedtrigger a variation of quality of the manufactured product. However, as the manufacturingprocess is often very complex, it is difficult to evaluate how the variations of processparameters values will translate into manufactured part quality. A robustness study thusbasically consists of running, in an automated way, several simulations of the same process

    with slight variations of the input parameters (as it happens in real life) and to study theoutcome. Such a study is indeed intended to help characterize the stochastic variations in partquality due to the fluctuations of process parameters around their target values. From thisdescription, it is obvious that such results will be statistical in nature. For example, as partquality will vary, it is possible that some parts will be of too poor quality to be used. The firstinformation that comes from this quality distribution is the proportion of parts that are belowthe quality standards. This corresponds to a prediction of the scrap rate. If it turns out that,despite the variation in quality, all the parts still exhibit a satisfactory quality, then the processis said to be 100% robust.

    The concept of process robustness is linked with optimization because it can classically be

    studied using an optimization software. Let us typically imagine that 100 thousands partsmust be produced, what is going to be the scrap rate? The challenge here is to be able toevaluate accurately such statistical results. However, it is clearly not possible to run 1000industrial casting simulations to make sure that our statistical evaluation is accurate enough.The role of the optimizer is thus, given how many process parameters vary and how widetheir variations are, to determine which 20-50 (this number is specified by the user but suchorder of magnitudes are quite typical) simulations should be run in order to obtain accuratestatistics concerning the part quality. It will also handle launching automatically all thesimulations (idea of the optimizer being a point generator).

    The idea of process robustness can be extended to that of process window determination in

    the case where the focus is not on an existing, implemented process, but rather on thedevelopment of a new process. In this case, the variation of process parameters value will be

  • 8/18/2019 Procast Optimization

    7/37

    Page 7/37

    allowed to be large (within the technical possibilities) and the study will look for whichwindow in combining the different values of design parameters leads to satisfactory processdesigns.

    2. PAM-OPT : ESI’s optimization software

    2.1. General presentation

    The above section presents the tasks and advantages of optimization software. Within ESIproduct line, such a piece of software, PAM-OPT, is available and has been used with successto tackle many full scale industrial problems. This document thus presents in detail theProCAST optimization module which consists of an integrated and interfaced couplingbetween ProCAST and PAM-OPT. It is not the present purpose to give a detailed PAM-OPTmanual (comprehensive documentation of this product is included in the software installation)but rather to highlight critical points that are essential to understand how to use the ProCAST

    optimization module.

    PAM-OPT is available for both Linux and Windows®  (on that platform, a cygwin versionexists together with a native Windows®  once) and is an optimizer that has proven able tohandle optimization of full scale industrial models. Several features participate in this abilityand we shall come back to these later. Furthermore, it implements several algorithms that willbe presented in a bit more depth in the next section. The PAM-OPT suite is composed of anactual solver (to do all the work that was described above) and of an input file editor whichcan be useful for advanced cases. In simple process optimization however, the optimizationcalculation may be setup using only the ProCAST GUI.

    In the optimization module, the tasks of PAM-OPT are all those listed before when describingoptimization software in general : launching casting simulations, analyzing outcome, guessingbetter process designs,… The optimization calculation is thus going to be managed by PAM-OPT. The setup of this calculation is contained entirely in a single ASCII file with a .cdsextension. The results that are produced are also contained in simple ASCII text files. Thecontent of these files is rather easy to interpret once the optimization approach has been wellunderstood.

    A final comment at this stage is about the coupling mechanism between PAM-OPT (theoptimization brain) and ProCAST. This is a coupling in the sense that PAM-OPT must beable to launch automatically casting simulations and retrieve the results. PAM-OPT must then

    be able to tell ProCAST what values of design parameters to use to run the next castingsimulation and ProCAST has to communicate to PAM-OPT the results of that simulation.These exchanges of information between the two pieces of software are achieved throughASCII files (that PAM-OPT will write and read). ProCAST (as an executable chain involvingalso PreCAST, DataCAST,…) is thus required to be able to read and write selectedinformation using ASCII files. We will come back to that requirement later on.

    2.2. Algorithms

    The most difficult job of the PAM-OPT solver is obviously to analyze the outcome of theprevious casting simulations and guess how better design could possibly be achieved(repeating this in an iterative way until an optimum solution is reached). This is performedaccording to an algorithm. Since the results of a simulation can vary a lot even for small

  • 8/18/2019 Procast Optimization

    8/37

    Page 8/37

    variations of the design parameters (e.g. when optimizing a flow problem), these algorithmsmust not have a tendency to diverge (i.e. they must be able to progress towards a solutioneven when the problem is very chaotic). Moreover, as they are calling casting simulations,each one of which can be quite long, these algorithms should be able to find optimumsolutions without having to call too many times the ProCAST solver. Even though the use of

    optimization software saves engineer time, it is usually not acceptable to wait several weeksfor the results of an optimization study and this time constraint must be taken into account.

    The requirements of not diverging and using few solver calls are obviously contradictory butmust both be achieved, which is why the optimization algorithm faces a difficult challenge.As PAM-OPT is a general optimization software (that can be applied to very well behavedproblems or to cases where each direct solver call is very short) it implements severaldifferent algorithms, which are suited to different cases. In the framework of castingoptimization, the exploration, gradient (reaches a solution quickly but will diverge in chaoticproblems) and iterative random (will not diverge but involves a great number of solver calls)will neither be used nor presented here.

    The first optimization algorithm that can reasonably be applied to casting processes is referredto as “Adaptive RSM”. The adaptive RSM algorithm is a special feature of PAM-OPT (as it isnot conventional) and combines well the requirements mentioned above. It will indeed alwaysfind a solution (the algorithm cannot diverge) and the number of solver calls required toachieve this is kept relatively low. It is thus very adapted for the kind of problems at hand andis a strong added value feature of PAM-OPT. Details about the algorithm can be found in thePAM-OPT documentation but it is useful to mention at this stage that it progresses byiterations. During each iteration, a few direct calls are first calculated and (using someinterpolation method) a new optimum solution is guessed. The guessed optimum solution isthen calculated to check whether or not it indeed improved. Such iterations are performed

    until convergence to the final optimum solution is found. The iterative progression towardsthis solution is summarized in the file named File.history(.txt).

    The adaptive RSM algorithm is the preferred optimization algorithm for casting applicationsbecause of its ability to reach a solution with a limited number of solver calls without havinga tendency to diverge. In some cases, the genetic algorithm can also be useful. This algorithmwill also not diverge. However, it often requires quite a large number of solver calls to obtainimproved designs. This algorithm considers that each different process parameter is similar toa gene (each of these gene can carry different influences on the process quality). Every solvercall is thus an individual consisting of several genes. An individual is considered fit when hemeets all the constraints and has good values of the objective function. This algorithm will

    then progress by iterations (or generations). Each iteration consists of several individuals(solver calls) whose genes were defined by breeding the fittest individual of the parentgeneration. This favors the survival and transmission of the best genes (i.e. the best values ofthe design parameters). Mutation processes are also included so that no degeneracy occurs.The user chooses how many individuals he wants in a generation and how many iterations hewants to breed. From this explanation, it is clearer why a lot of solver calls are often involved.However, this approach can prove useful for very chaotic problems. It also has the advantageof proposing a set of possible improved designs, which are in fact the individuals of the lastgeneration (each generation as a whole is fitter than the previous one).

    These two algorithms are the optimization methods to be applied to the problem at hand. The

    last PAM-OPT algorithm that is relevant here is the stochastic algorithm, which is used forthe study of process robustness (or process window). This algorithm indeed simulates the

  • 8/18/2019 Procast Optimization

    9/37

    Page 9/37

    statistical variations of the design parameters and allows studying the resulting fluctuations ofvarious quality indicators. This calculation mode basically launches several castingsimulations according to the input process parameters variation. The added value of thisalgorithm comes from the fact that it selects cleverly the solver calls to be launched so thataccurate statistics (e.g. scrap rate) concerning the quality of the casting process can be

    computed even if the number of direct calls that the user can afford (due to time constraints)is rather small.

    2.3. Useful features

    Beyond algorithms well suited to tackle industrial problems, PAM-OPT has some extrafeatures that make it applicable to full scale problems and it is worth mentioning those here.PAM-OPT is available for both Linux and Windows®. Under Windows®, the user will find aversion running entirely in the standard environment and another one based on cygwin (freesoftware allowing the implementation of a Linux-like command line environment underWindows®). The pure Windows® version is nice because of its simplicity (no need to install

    third party software) but is more adapted to running optimization calculations on multipleprocessors Windows® machines.

    When several machines are available and connected on a corporate network, the PAM-OPTsolver itself runs on one master computer. It can obviously launch casting simulations (solvercalls) on this same master machine. Moreover, it is able of launching casting simulation on apool of slave machines that are present on the LAN. This capability allows many processorsto be made available to the CPU intensive optimization calculation. The pool of slavemachines can contain both Linux and Windows®  platforms. Moreover, this pool can bemanaged (the optimization calculation load can be suspended temporarily on selected slaves).

    The handling of slave machines involves ssh communication which is why the Windows® PAM-OPT version requires cygwin to be installed on all Windows®  platforms if thismechanism is to be used. The pure Windows®  version will be able to use only the masterWindows® machine for the optimization study (no slaves) but will not require cygwin to beinstalled. The difference between the more powerful (use of slaves) cygwin-Windows versionand the simpler to install 100% Windows version of PAM-OPT must be kept in mind uponinstallation. Note that both versions can be installed together on a computer with cygwininstalled.

    Another useful feature is the handling of failures of either a simulation or even a computer. Ifone or several given casting simulations fail for some reason, this will be taken into accountby the algorithm in an appropriate manner (as long as some of the direct calls in the iterationwere successful). If one of the slave computers is turned off, the optimization calculation willnot be stopped (the duties of the turned off computers are transferred to other members of thepool). If this machine is turned on again later, it will be automatically recaptured in the pooland used again. Finally, if the master machine itself is powered off, the optimization study isobviously stopped. However, a restart mechanism exists so that previous calculation resultsare not lost. Similarly, if the user has attempted by hand several designs before resorting tooptimization, he can use these attempts as initial information that are taken into account bythe algorithm. This can shorten the time necessary to reach an optimum solution.

  • 8/18/2019 Procast Optimization

    10/37

    Page 10/37

    3. ProCAST features available for PAM-OPT coupling

    As previously mentioned, the coupling between PAM-OPT and any solver is to be achievedthrough ASCII files. In one (or several if desired) of these files, PAM-OPT must be able toprovide the solver with the values of the design parameters it should use for the casting

    simulation and the other (or others as several files can be used if necessary) should contain thevalues of the criteria (objective or constraints) functions so that PAM-OPT can read them.Please note that the format of these files is not constrained as PAM-OPT can be instructed touse virtually any ASCII file structure. The possibility for ProCAST to use and generate suchASCII files is thus the corner stone of the optimization module. This capability as well assome other features were integrated to ProCAST to fulfill this goal. The present section willthus be dedicated to presenting these features.

    3.1. PreCAST batch mode

    There are two ways in which an ASCII file can be used to modify the values of processparameters. The first one is to use user function that code for the values of these designparameters. As user functions are indeed ASCII files, they can be used for that purpose. Theother way of communicating input data to the ProCAST solver is by modifying the p.dat andd.dat files. Even though they are also ASCII files, their large size and format makes themunpractical to modify directly.

    The batch mode of PreCAST, in which PreCAST is used to modify the d.dat and p.datwithout interaction with the GUI, is the most general and versatile approach. In that mode,PreCAST will indeed perform operations on the d.dat and p.dat based on the instructionscontained in an ASCII .prs script file (see the dedicated ProCAST manual section). This PRS

    script has a very practical format and can control the alterations of many process parametersvalues. In fact, the batch mode of PreCAST was developed specifically for the purpose ofoptimization coupling. This is the main reason why its use for pre-processing entire casesfrom scratch may sometimes appear unsatisfactory. The PRS script can thus be regarded asthe most important ASCII file used by PAM-OPT to modify the ProCAST input data. Pleasenote that, in more advanced cases, the use of both a PRS script file and user functions arepossible (composite input).

    As illustrated below, the batch mode can be invoked from the ProCAST manager (for testingthe effect of a given PRS script for example) by right-clicking the PreCAST button. From the

    command line, this batch mode is also triggered by the precast.exe –batch prefix

    script.prs command (the prefixd.dat file is then open for modifications) or precast.exe–mesh_file –batch prefix script.prs  (in that case, prefix.mesh  is opened to begin

    with). Under cygwin or Linux, the precast –batch prefix command can be used to obtainthe same behavior.

  • 8/18/2019 Procast Optimization

    11/37

  • 8/18/2019 Procast Optimization

    12/37

    Page 12/37

    modified but a PRS script now exists). The user can apply the modifications from the script tothe d.dat and p.dat files by running once the PreCAST batch mode.

    3.3. Computation of simple criteria

    Now that the ASCII files for controlling the input of ProCAST are known, it is necessary tofocus on the files that will contain values of criteria functions (objective or constraints). The

    advanced approach is to create user functions (externalcompute being often very useful forthat purpose) that will compute criteria and dump their values to ASCII files. This method isvery useful in advanced cases, for example when trying to fit experimental data to findmaterial properties (inverse modeling). This is however not the most user-friendly approachand is often a bit too sophisticated for the kind of problems encountered (typical objectivessuch as part quality or process cost are simple functions of the ProCAST results).

    Most often, optimization criteria are indeed rather simple quantities based on a given field(e.g. maximum or average of a defect field is the casting domains can be used as a part quality

    objective function). In that context, the user is provided with a simple way to extract suchinformation from the results of a ProCAST calculation. It is indeed possible to define as many

    criteria functions as desired through the prefix_resdef.dat file (results definition file). ThisASCII file contains the user defined definitions of as many functions as desired (enclosedbetween an *RESULT and *END keywords).

    Each result is defined by which field it will use to extract results from. The available fields aretemperature, solid fraction, velocities, stresses, element volume (the sum of the elementvolume field in a domain is the volume of the domain), defect fields (porosity, hot tears,cracks, fatigue life), … From this field, the user chooses to extract a minimum, maximum,average or sum. This evaluation can be required throughout the calculation or at the last step

    only. Moreover, the domains (a list of several domains can be provided, separated by blanks)to be considered for this evaluation should be defined. It is the responsibility of the user toconsider fields only in domain in which they are defined (e.g. it does not make sense toinclude a mold domain in the calculation of the average porosity). Similarly, the user mustensure that the considered field is indeed part of the calculation (e.g. setup a singleJUNCTION if the average value of the flow junction field is to be considered).

    For each one of these criteria, the user can also define an optional value name (if nothing isdefined these results will automatically be referred to as value1,…) and an optional file name.The file name is going to be the name of the file in which the considered results is going to bewritten. It is possible to write several criteria in the same file. In fact, if no file name is

    specified, all the criteria will be output to prefix_resout.dat  (results output file). Theformat of the output ASCII files will also be the same, starting with the number of criteriaoutput to the file followed, for each one, by the name of the value and the value itself.

    The structure of the prefix_resdef.dat is not detailed here because there exists a GUI thatwill help the user define the relevant criteria. This GUI can be accessed from the File menu ofthe PRS editor, as illustrated below (File/Add output criterion). Please note that this menumust be accessed to create every new criterion definition (with the possibility of erasingprevious definitions if necessary). This GUI guides the user in inputting all the necessaryinformation for the definition of a criterion and modifies accordingly the

    prefix_resdef.dat file.

  • 8/18/2019 Procast Optimization

    13/37

    Page 13/37

    The results definition file will be read and interpreted by the scalar version of the ProCASTsolver, which is able to use this input to generate the results output files. This provides theuser with a very simple way to obtain values of criteria functions (in ASCII files) that can be

    used to be fed into PAM-OPT. Some recently implemented results in ProCAST might causethe output by the ProCAST solver to fail. From version 2010.0 on, it is advised to use acomplementary tool, as will now be described.

    This very simple approach is fast and efficient for many optimization problems. However, insome cases, this technique exhibits some limitations. For that reason, a separate executable is

    also available to compute results based on the prefix_resdef.dat  file and referred to as

    optcriteria. This tool rereads the ProCAST results files (.usf and .unf) and extracts therequired values from them (without displaying the fields or the model). One immediateadvantage of this tool is that it will work for both scalar and DMP results (while the previousapproach is only implemented in the scalar ProCAST solver).

    There are two other advantages in using optcriteria, the first one being that it can usesolidification time (time spent between liquidus and solidus, field code : solidification_time)and end of solidification time (time spent between the beginning of the casting simulation andthe solidification time, field code : end_of_solidification_time) as fields from which to extractaverage, minimum or maximum. The other advantage is that it can consider not only entiredomains but also their interfaces or free surface (non-coincident interfaces are regarded asfree surfaces). This is handled through the definition of domain numbers. For example, 2 isgoing to include domain number 2 as a whole (bulk and surface), 2s corresponds to the freesurface of domain 2 (equivalent and coincident interfaces are not part of the free surface) and2i3 corresponds to the surface where domain 2 is in contact with domain 3.

  • 8/18/2019 Procast Optimization

    14/37

    Page 14/37

    Furthermore, optcriteria  handles correctly .usf files generated with recent ProCASTversions. At this stage, it is however necessary to have only one field per usf file, whichimplies mostly that only one output is to be defined through the JUNCTION run parameter.

    3.4. Use of local databases

    From the above description, it is now clear that the PRS script is the preferred way for PAM-OPT to alter the input of ProCAST simulations during the optimization loop while the valuesof objective and constraints functions will be provided by ProCAST through the use of aresults definition file (for both these aspects, user functions can also be introduced in moreadvanced cases). Using these mechanisms, coupling between ProCAST and PAM-OPT canthus be achieved.

    One difficulty remains however in the case, quite frequent, where the optimization loopstudies a design parameter that is defined in a database entry (e.g. a characteristic defined inthe materials, stress, interface, process or boundary conditions database). The PRS script

    indeed allows modifications of such parameters by referring to the database entry using theirnames. Due to this handling method and the fact that several simulations may occur inparallel, the database will often get “polluted” by multiple entries created during theoptimization loop. Moreover, problems can often arise when using a pool of slaves machinesis used to increase the computational power because the database entry names are most oftennot transferred from one machine to another (i.e. from the databases installed on onecomputer to the databases installed on another).

    It is not relevant here to expose more details about these difficulties as they are all solved by asimple approach that consist of using local databases. The full definition of a calculation will

    then be given by a p.dat and d.dat files as well as the local directory named db  that contains

    stress.db, matls.db, intf.db, proc.db and bc.db files.

    From a fully setup case, this local databases directory can be created extracting only theentries that are actually used in the current setup (this creates a light local db directory). Thisoperation can be performed using again the PRS editor under the menu File/Create localdatabase (as illustrated below). This will allow the user to create the local databases directoryautomatically. It also allows for the transfer of ownership of databases entry to some otheruser (this may prove useful depending on the local IT environment). Please note thatwhenever this menu is invoked, the local databases are created from scratch again.

  • 8/18/2019 Procast Optimization

    15/37

    Page 15/37

    Once those local databases are created, the user needs to remember to instruct PreCAST touse them instead of the centralized complete databases. To do so, the use local databasescheck box must be activated in the right-click drop-down menu obtained from the ManagerPreCAST button (see below).

    Please note that this additional check box is hidden in the standard ProCAST installation. Tohave it appear, it is simply necessary to change (using a standard text editor) to line set

    useLocalDbs 0 to set useLocalDbs 1 at the beginning of the manager.tcl file to be foundin the ProCAST installation bin directory.

    4. Flowchart for setting up optimization calculations

    This section presents a step by step methodology to setup optimization calculations. It isstrongly advised to follow these steps carefully and in a very systematic way in order tominimize the risk of input mistakes (as optimization calculations can become quite long, thisis of particular importance). This method will be presented based on a simple follow throughexample. For some specific issues, additional capabilities will also be mentioned. Moreover,as shall be presented, standard optimization calculation can be setup all the way using asimple GUI that directs the user.

    4.1. Baseline calculation

    The first step of the process of defining an optimization study is to setup a ProCASTsimulation of the casting process on interest. It s highly recommended to run this simulation

  • 8/18/2019 Procast Optimization

    16/37

    Page 16/37

    and check that it is satisfactory from all points of view. All the interesting results (includingdefect indicators) should be included and validated if possible. The mesh should besatisfactory. It is also useful to spend some time making sure that no CPU time could beeasily saved from that setup. In typical optimization cases, the classical PreCAST –DataCAST – ProCAST combination will be used (user functions can also be included without

    any problem). Advanced modules such as CAFE or APM can also be included. However, thismakes the optimization problem less standard and it is advised to contact ESI in order to getsome help to setup such a case.

    During the optimization loop, this baseline calculation will be repeated several times withslightly varying input. It is thus necessary to have a rather robust casting simulation that willconverge even if the input parameters are slightly modified. It is not a problem if a few of thecasting simulations fail since this behavior can be handled by PAM-OPT. However, if most ofthem are not properly completed, the optimization loop will either stop early or give wrongresults. To ensure robustness, there are various tips and traps (depending on the type ofprocess) that are known to trained ProCAST users. Another typical robustness issue is the

    stopping criterion that has to be set in an efficient way.

    Up to now, because of this robustness issue, remeshing of the geometry at the beginning ofeach ProCAST simulation was not attempted. The most recent available meshing tools (STLroute, VisualMesh) will probably lift this limitation. However, not much testing on that topicwas performed at this stage. For this reason, optimization of geometric features is consideredas an advanced topic for the ProCAST optimization module. This means that suchoptimization studies can be conducted but it is advised to contact ESI as they can involvesome more advanced technical aspects (true parametric geometry and meshing, boundarycondition selection technique, clip – delete technique or mesh distortion technique).

    At this stage, it is time to introduce the follow through example that shall be used to illustratethe recommended method for setting up optimization calculations. We shall indeed use anoversimplistic HPDC example to demonstrate this flowchart. It needs to be kept in mindhowever that such concepts were successfully applied to optimization of real industrialmodels (for HPDC and other processes) and that this example is purposely made somewhatunrealistic for the sake of clarity and simplicity.

    As illustrated below, a mold enclosing a casting cavity was designed with a running system.Two overflows are added to the cavity to serve their usual purposes. The actual cast partconsists of two regions, one of which is assumed to be critical from the structural point ofview (the round region with a square hole highlighted in red on the image below). Each

    overflow, the running system, the body of the part and the critical region of the part are allassigned a different domain number. In general, when some regions of the part are moreimportant than others, it is advised to assign them a distinctive domain number as this will beuseful for the extraction of criteria function. As this aspect is to be handled at the meshingstage, it is worth thinking about it from the very beginning.

  • 8/18/2019 Procast Optimization

    17/37

  • 8/18/2019 Procast Optimization

    18/37

    Page 18/37

    4.2. Extraction of criteria

    The next step is to setup the extraction of criteria functions from the results obtained in thebaseline simulation. As previously mentioned, these values must be written to some ASCIIfile. It can be a standard log file or a file generated by some user function. However, the

    simplest method is to setup a prefix_resdef.dat  file to be interpreted by either theProCAST scalar solver or, preferably, the optcriteria tool.

    Let us illustrate this method by coming back to our simple HPDC example. As alreadymentioned, there is a critical region in that part that will experience most of the solicitation

    during service. As a consequence, we want to optimize our process to keep the amount ofdefects in that region to a minimum. In particular, we want the amount of porosity in that areato be a minimum. Moreover, the amount of oxides trapped in that domain must be kept belowan acceptable level (for that specific case, a value of 0.08 cm 2 /s on average was found to bethe maximum acceptable).

    Based on this formulation of the problem, we need to output the average value of the porosityand flow junction fields in that critical region of the cast part. For this purpose, a

    prefix_resdef.dat file will be created using the PRS editor GUI as mentioned before. Thefield shrinkage_porosity (junction will be selected when setting up the second criterion) is tobe averaged at the last stored step of the calculation. This average considers only domain 5

    (critical region of the part). This is why it was important to think about it and isolate thisdomain at the meshing stage (this helps a lot extracting information about this specific domainlater on). Please note that, even though this naming is optional, this average porosity islabeled “pores” for future reference. The same procedure just needs to be repeated to setup theextraction of the average of flow junction field under the same conditions. This is illustrated

    below with a snapshot of the GUI on the left and the resulting prefix_resdef.dat file onthe right.

  • 8/18/2019 Procast Optimization

    19/37

    Page 19/37

    Results definition file

    *RESULT

    field_name:

    shrinkage_porosity

    value_name: pores

    option: average

    timing: last_step

    domains: 5

    *END

    *RESULT

    field_name: junction

    value_name: oxides

    option: average

    timing: all_steps

    domains: 5

    *END

    After a run of the ProCAST scalar solver or of the optcriteria  tool, a

    prefix_resout.file   (default output file as no file name were input in the above resultsdefinition) is created. This ASCII files contains, as expected, the average of porosity (pores)and flow junction (oxides) in the critical region of the final cast part. The results output filelooks like :

    2

    pores

    2.715143e-002

    oxides

    6.605708e-002

    This means that the average porosity is 2.7% in that case while the average amount of oxidesis indicated to be 0.066 cm2 /s. This means that the amount of oxides is acceptable (below the0.08 cm2 /s limit). The challenge is now to minimize porosity without exceeding the oxidesacceptable limit. This will be the task of the optimization module in that example.

    4.3. 

    Creation of local databases

    Once the baseline case is setup properly and that the user has made sure that the results ofinterest can be extracted from the case, it is strongly advised to create a local database

    directory and have PreCAST work with it from this point on. This will avoid risks of centraldatabase pollution or problems when using distant machines for casting simulations. Thispossibility was already presented above and is summarized again in the pictures below.

  • 8/18/2019 Procast Optimization

    20/37

    Page 20/37

    4.4. Input modification template

    The last preliminary step to the setup of an optimization study is then to create the template ofthe ASCII file that will contain the values of the design parameters that we allow theoptimizer to modify to reach a solution. Again, this can be approached with user functions inadvanced cases, but the preferred method is to create a PRS script for the modification of the

    desired process parameters. The creation of such a script using the PRS editor GUI is verysimple.

    Going back to the example, let us assume that the only things the optimizer can modify to tryand produce better parts are the inlet flow rate and the mold preheating temperature. All theother processing conditions cannot be altered. When defining these varying parameters, it isworth to already think about within which bounds they will reasonably be allowed to vary.Such limits can be due to various factors and defining them can sometimes become tricky. Inthe present case, let us assume that the inlet flow rate can vary between 40 and 200 g/s whilethe mold initial temperature can be anywhere between 250°C and 450°C.

    By opening the PRS Editor and modifying the flow rate in the inlet condition and the initialtemperature for the mold domain as would be done in standard PreCAST, such a script isautomatically recorded. This script will have the following form:

    *GENERAL

    *VERSION

    2009.1

    *END_GENERAL

    *SEQUENTIAL

    *BCDB_MODIFY

    hpdc-inlet cst_inletflowrate

    135

    *BCDB_MODIFY

    hpdc-15-RST cst_inlettemp6.800000e+002

  • 8/18/2019 Procast Optimization

    21/37

    Page 21/37

    *INITIAL_CONDITIONS_CONSTANT

    1 275.00 

    *END_SEQUENTIAL

    *FINAL

    *END_FINAL

    The modified values of the inlet flow rate and mould preheating temperature appear in thisscript as outlined in red.

    4.5. Setup of the optimization loop

    Once all the above steps have been successfully completed, it is safe to proceed with theactual setup of the optimization calculation. To do this, PAM-OPT comes with an exhaustiveinput file editor (PAM-OPT Editor) that is useful because it gives access to almost all of thePAM-OPT features. It thus comes handy for setting up most advanced optimization studies.However, the more standard casting optimization problems can be setup entirely using aWizard type GUI tool referred to as the cdsWizard (CDS is the file extension of the PAM-

    OPT input file). This wizard is accessible from the ProCAST manager, under the PreCASTright-click menu after the line set cdsWizard 0 has been replaced by set cdsWizard 1 atthe beginning of the manager.tcl file from the bin directory of the local ProCAST installation.

    This GUI will assist the user (even inexperienced) in setting up an optimization problem.Restart and backwards mechanisms exist in this wizard so that the setup can be performed in amore flexible way.

    We will now describe the functionality of this wizard by following through the exampleillustrated above. The first panel (see image below) is simply a welcome banner summarizingthe different steps of the process of setting up an optimization study. As mentioned, a restartmechanism exists so that previous setup will be reloaded each time. If the user wants to start abrand new setup, erasing the restart information, the checkbox at the bottom of this panelallows doing so.

  • 8/18/2019 Procast Optimization

    22/37

    Page 22/37

    The next panel basically checks that all the steps presented up to now have been followed. Itwill indeed look in the case directory for a p.dat and d.dat (baseline calculation is setup), aPRS script (for automatic pre-processing), a local databases directory and a results definitionfile for output criteria. For each one of these elements, a check box will automatically bechecked when the element is present. If they are not all detected, this panel will show a redmessage advising the user to provide all these elements. To do so, the user can directly launchthe PRS editor from that panel. Once the new elements have been created, the detection

    procedure can be repeated by using the Refresh button. At this stage, it should also beremarked that just stopping the mouse over buttons whose functions are not obvious fromtheir label will cause a short help message to be displayed (yellow background online helpmessage). These features of the panel are displayed on the left hand side of the picturesbelow.

    If all the required elements are present in the case directory, a green message is displayedencouraging the user to proceed. Please note that the green light is not mandatory for the userto proceed with the optimization setup but strongly recommended. In some cases, the inputfor ProCAST simulation will be modified by a user function (no PRS script) or the databaseentries will not be modified (no local db directory is necessary) or advanced criteria functions

    will be output by some user function (most likely externalcompute, no results definition file).As a consequence, the red message will be displayed. If he knows what he is doing, the usercan manually check one or several of the boxes that correspond to these scenarios and he willthus obtain the green light. In the present example, the standard steps have been properlyfollowed and the green light is obtained right away.

  • 8/18/2019 Procast Optimization

    23/37

    Page 23/37

    Having spent a little time checking that the recommended steps have been properly followed,the actual setup of the optimization study can be started. The first task is to select the properalgorithm. For optimization, the preferred candidates are the adaptive RSM or genetic PAM-OPT algorithms. For the study of process robustness or process window, the PAM-OPTstochastic algorithm should be used. The panel illustrated on the pictures below prompts theuser to select one of these algorithms. Whenever the selection from the drop down list ischanged, the help message below shows a short description of the corresponding algorithm. It

    is only possible to proceed to the next panel after validating a definitive choice of algorithmby clicking the OK button on the right of the list. This choice can then not be undone. In thepresent example, the optimization adaptive RSM algorithm is selected.

  • 8/18/2019 Procast Optimization

    24/37

    Page 24/37

    When running the ProCAST simulations, PAM-OPT will work in intermediate directories(name starting with DIRINTER_). One of these working directories needs to be created forevery CPU (or process) made available to PAM-OPT (including on slave machines). Beforeany ProCAST simulation can be started in such an (initially empty) working directory, it isnecessary to have some files (input) copied in it. This copy operation will be done to each one

    of the working directories from a single source only once at the very beginning of theoptimization loop. The task of the next panel is to indicate what are the files that need to becopied. By default, the baseline p.dat and d.dat files are selected as well as the resultsdefinition file. In most case, it is recommended to also check the local database directory box.When database (e.g. value in a boundary condition) entries are being modified, checking thelocal databases checkbox is mandatory. This is the case here and having this functionalityactivated will cause the copy of the local db directory and its use by the PreCAST batch runs.Other typical files to be selected include initial conditions file from an extract or anexternalcompute user function implementation to compute advanced criteria functions. Othercustom files (e.g. experimental records files when doing inverse modeling or header files usedin user functions implementation) present in the baseline case directory can also be selected as

    custom files using the browse buttons. All these files can be selected or unselected manuallyby using their corresponding check boxes.

    The next panel is used to define the process parameters that will be allowed to vary during theoptimization loop. Each design parameter can vary between a maximum and a minimumvalue. It can also be assigned a guess of what a good initial value could be. This is howeveroptional. Moreover, each design parameter is assigned a name by the user. When all thecorresponding entries have been filled, the design parameter definition can be stored by theOK button. It will then appear on the list below. Please note that a label (referred to as asticker in the PAM-OPT terminology) is also automatically assigned to the design parameterfor later use. The list of defined parameters that appear below is a summary but can also beused to delete a wrongly defined parameter by selecting it and clicking the Delete button.

    All this is illustrated from the snapshot of the panel displayed below. In the case of astochastic study (process robustness), this panel will look slightly different as the definition of

  • 8/18/2019 Procast Optimization

    25/37

    Page 25/37

    the statistical variation of the design parameter is required. In that case, the look of the panelis slightly different but its use basically remains the same and the GUI is self explanatoryenough to be used without difficulty. In the present example, as already mentioned, the inletflow rate is allowed to vary between 40 ad 200 (g/s as this unit is defined in the baselinecalculation) while the mold temperature can be anywhere between 250°C and 450°C.

    Having defined the design parameters is not enough since PAM-OPT has to be informed how

    to format the ASCII files in which it will insert its custom selected values for thoseparameters. This is exactly why a PRS script template had to be created earlier. Such adefinition is also the task of the next pane, which will look as illustrated on the left of the nextimages. The list of design parameters (and their corresponding labels) is given at the bottomof the panel. By using the Open file button and selecting the PRS script created earlier, thescript will be displayed in the window in the top half of the panel, as illustrated on the right.The user must manually indicate where the values of the design parameters appear in thistemplate script. To do so, simply select the value in the script and highlight the correspondingparameter in the list, then click the Assign button. This will cause a line starting by#STICKER in the line above the selected value (this is the way for PAM-OPT to indicatewhere to insert modified values). At the beginning of every ProCAST simulation, PAM-OPT

    will thus insert the value its algorithms has selected for this specific process parameter in thescript at the right location. In the present case, each one of the design parameter appears oncein the script so that two assignments are necessary in total.

    This assignment must be performed for each design parameter. If the value of the sameparameter appears several times in the script, the assignment must be performed separately foreach occurrence. Moreover, every design parameter of the list must be selected at least onceto assign it somewhere in the script. If an assignment is performed by mistake, the user willnot be able to delete it right away. However, one can just continue assigning and correct thismistake by manually editing the CDS file at the very end. Please finally note that theapproach would be exactly the same if the ProCAST input were to be controlled through a

    user function.

  • 8/18/2019 Procast Optimization

    26/37

    Page 26/37

    The next task is to identify what are the objective and constraintsand where (i.e. from which ASCII files) they can be read byPAM-OPT. A name has to be given to each one of the definedcriteria. In the case of the objective, one also has to decidewhether the value should be maximized or minimized. In orderto tell PAM-OT where to read the value of the objectivefunction, the Browse button can be used. After clicking this

    button, the user can indeed navigate and open the file in whichthe results are found (most often prefix_resout.dat). Oncethe file is opened (as illustrated here), simply selecting thecorrect value and clicking Store will insert all the necessaryinformation in the File name, Line and Column fields.

    The constraint(s) definition works in exactly the same way except for the fact that a constraintis not to be minimized or maximized but to be below an upper and/or above a lower bound.Moreover, as the constraint definitions are optional, the check box before each constraintdefinition must be checked before being able to set it up.

    In the present example, the objective is to minimize the average porosity that can be found(after each ProCAST simulation) on the 3rd  line of the prefix_resout.dat   file. Moreover,the oxides indicator (found on the 5th line of the same file) must be kept below 0.08 (a singleconstraint is used in that case). In the case of a process robustness study, there exist no realobjectives but rather a collection of output values that are being watched. The look of thepanel is thus slightly different but its function remains essentially the same.

  • 8/18/2019 Procast Optimization

    27/37

    Page 27/37

    Having defined the varying design parameters and the way to introduce them into ProCASTas well as the definition of objectives and constraints and their location of retrieval, the maincomponents of the optimization loop are in place. There remains some things to adjust, mostof which are to be found on the next panel. The first point is the definition of the differentsteps involved in one solver call, i.e. what needs to be done to obtain the values of the criteriafunctions from the values of the design parameters. This chain can be defined by activatingcheckboxes corresponding to possible steps. The obvious executable chain (to be used in that

    example) is first to create a PRS script with the correct design parameters values (the templateof this script has been defined before). Then PreCAST will be run in batch mode to modifythe p.dat and d.dat from this PRS script. Then DataCAST will be launched and finally the

    ProCAST scalar solver, which will generate the prefix_resout.dat file to be read by PAM-OPT to find the values of the objective and constraints functions.

    Including advanced modules in that chain or running the DMP ProCAST solver cannot beachieved with this GUI (manual intervention in the final CDS file will be necessary):However, choosing to control the ProCAST input via a selected user function or resorting to

    the optcriteria  tool to compute the criteria functions can be included in the solver call atthis stage. Please also note that a time out (default of 90 minutes) is introduced. This means

    that any simulation that lasts form more than 90 minutes (CPU time) will be forced to stopand considered a failure. This is meant to avoid hanging the optimization loop if badconvergence appears. For industrial optimization, this timeout can be manually modified inorder to be adapted to what typical solver times will be (with a large enough safety factor). Itis also possible to decide to the DMP version of the ProCAST solver (specifying the numberof CPUs to be used for each run).

    The number of CPUs or processes available for ProCAST simulation on the local machine isalso defined on that panel. It is really the number of simultaneous solver calls that is definedhere. So 2 calls of ProCAST scalar will actually occupy 2 CPUs, but the same 2 calls toProCAST DMP 4 CPU will cost 8 CPUs on the local machine. Please note that a 0 can be

    defined here if slave machines are used and the master machine (on which PAM-OPT isrunning) must remain free of the intensive ProCAST simulation use.

  • 8/18/2019 Procast Optimization

    28/37

  • 8/18/2019 Procast Optimization

    29/37

    Page 29/37

    based on the information given on the previous panel). The Calculate button can be invokedas many times as the user wants. Every time, the “quality” of the optimization study isassessed (giving a red, orange or green message depending on the number of calls).

    When satisfactory parameters have been calculated, the Apply button can be used to transferthis number of solver calls to the limitation field that are given to the PAM-OPT algorithm. Insome cases, the user may also want to limit the number of iterations or the number of

    simulations within one single iteration (what is typically limited is the total number given bythe number of casting simulations summed through all the iterations). This is howeveroptional and not used in the present example.

  • 8/18/2019 Procast Optimization

    30/37

    Page 30/37

    The final panel simply displays the CDS (PAM-OPT input file) corresponding to the inputsetup using this wizard. This file is created only when the Finish button is used (on Quit, therestart information is saved but no CDS file is re-written). At this stage, the CDS file cannotbe edited. For detailed information about the syntax, please refer to the PAM-OPT manual.This syntax is however not too exotic (it is just formatting the information given to the

    wizard) so that simple manual corrections are possible using any text editor.

    There are some other PAM-OPT features that can be useful in more advanced cases and thatare not part of that wizard. If they are required, the best way is to use the wizard first and thenuse the PAM-OPT editor to add these features to the resulting CDS file. In particular, thereexist three PAM-OPT keywords that can be useful. The first one is OPTRUN. This keywordis included in the CDS file generated by the Wizard but commented out (i.e. a $ character is

    found at the beginning of this line). By uncommenting manually the OPTRUN/ 2 line the userasks PAM-OPT to launch only one single test casting simulation instead of the wholeoptimization loop. This is sometimes useful to make sure quickly that every step workscorrectly. Another useful keyword is SVFILE, which instructs PAM-OPT to save a copy ofsome file (for example the modified PRS script) for later post processing. A template for thiskeyword is also added as a comment in the generated CDS file.

    The last PAM-OPT keyword that should be mentioned here is the DATMOD keyword.Sometimes, the PRS script can indeed contain a value that is a given function of a designparameter. Let us for example imagine that the inlet temperature were to vary and that wewanted the mold preheating temperature to always be 300°C below the inlet temperature. ThisDATMOD keyword allows the user to define a value that is always equal to some function ofthe current design parameter value (here the mold temperature that is the inlet temperatureminus 300°C) and to assign a STICKER to it. This parameter is thus not a degree of freedombut can be referenced in the PRS script to control in more details how the user wants theproblem to behave.

  • 8/18/2019 Procast Optimization

    31/37

    Page 31/37

    4.6. Launch of the calculation

    All the above steps lead to the creation (in the case directory) of a CDS input file for PAM-OPT. After having completed the setup of this file, the last step is to launch the PAM-OPT

    calculation. Under Linux, the command pamopt prefix.cds > listing & will do just that.

    Under Windows®

      a very simple launcher (just browse to the CDS file and click Launch) isavailable from the PAM-OPT start menu. This will start the PAM-OPT calculation, firstcreating working directories, then copying the base files and starting a loop of ProCASTsimulations. Under Windows®, one should choose between the Windows and the CygwinPAM-OPT solvers. At this stage, the decision must be coherent with what was used in the cdsWizard (if the ckecbox use Linux/Cygwin) was left active, then the Cygwin version of PAM-OPT should be launched.

    5. Post-processing

    The results of an optimization study need to be well studied and discussed before drawingconclusions. Such results are indeed often quite interesting but their interpretation may not beimmediate. This section intends to draw attention to the most interesting informationavailable.

    5.1. 

    PAM-OPT output files

    The PAM-OPT output files are ASCII file and their names start with “File” followed by someextension. The most important one is the history file. For the example we have been followingthrough, it will look like:

    PAM-OPT Algorithm 2009 (feb. 12 2009)

    Executed on: 2009/10/21 - 08h20m38s

    +----------------------------------+

    | Adaptive Response Surface Method |

    +----------------------------------+

    ********************************************************************************

    * There are 2 design parameters : Lower Bound / Upper Bound

    * P1 --> &inletrate 40 / 200

    * P2 --> &moldtemp 250 / 450

    * There is 1 constraint function : Upper Bound

    * C1 --> &junction 0.08

    * The objective function :

    * Obj --> &porosity

    ********************************************************************************

    ****** HISTORY ******

    iter ---> 0 1 2 3 4

    -------------|-----------------------------------------------------------------

    Point Nb | 1 3 8 8 8-------------|-----------------------------------------------------------------

    P1:&inletrat | 50 193.535 156.821 156.821 156.821

  • 8/18/2019 Procast Optimization

    32/37

    Page 32/37

    P2:&moldtemp | 300 288.384 263.592 263.592 263.592

    -------------|-----------------------------------------------------------------

    C1:&junction | 0.222619 0.0689172 0.0766371 0.0766371 0.0766371

    -------------|-----------------------------------------------------------------

    Obj:&porosit | 0.0231859 0.0278359 0.0269535 0.0269535 0.0269535

    -------------|-----------------------------------------------------------------

    +----------------------------+

    | End of the PAM-OPT run |

    +----------------------------+

    This file basically indicates how PAM-OPT progressed towards an optimized solution. Foreach iteration, it will show the best solver call (characterized by the values of the designparameters as well as the objective and design functions) obtained at this stage. The exampleillustrates this behavior. The initial guess (iteration 0, call number 1) was an inlet low rate of50 and a preheating temperature of 300. This leads to a good porosity value but too highoxides content (0.222619 cm2 /s is way above the acceptable 0.08 cm2 /s limit). After the firstiteration, point number 3 appears to be the best (2.78% of porosity and an acceptable oxidescontent of 0.0689 cm2 /s). After iteration 2, the best point is the solver call number 8 (156.8 g/sas the inlet rate and the mold preheated at 263.59 °C) with only 2.69% or porosity and anacceptable 0.0766 cm2 /s of oxides indicator. Afterwards, more tentative ProCAST simulationsare performed during iterations 3 and 4 but the best point remains number 8 (no furtherimprovement of the solution). The algorithm finally converges and point number 8 is theoptimum solution. Please note that this optimum has more porosity that the initial guess, butthe initial guess was not satisfying at all the oxides requirement. The trade off betweenporosity and oxides is something that will happen very often in casting processes and that canbe very efficiently analyzed using the present approach.

    The file called File.history(.txt under Windows®) thus contains the progression of thealgorithm towards the solution as well as a summarized view of the optimum solution itself.One information it lacks however is the number of ProCAST simulations (in total and at each

    iteration) that were necessary to reach this solution. This information together with otherevolution indications can be found in the File.curves(.txt) file, which has a self explanatoryformat. Another interesting PAM-OPT result file can be the File.doe file which basicallysummarizes (input and output parameters) all of the ProCAST simulations that werecalculated during the optimization loop.

    Finally, the file listing(.txt) contains all the standard output of PAM-OPT during a standardrun and can also contain some interesting complementary information (such as whichsimulation is being run on which machine of the slave pool). This file is however mainlyuseful for calculation monitoring.

    5.2. 

    Further post-processing methods

    Beyond the PAM-OPT results file, it is often desired to be able to compare in more details thebaseline and optimized solution. As advised above, the baseline has been calculated in thecase directory. Moreover, PAM-OPT will automatically recalculate the optimum solution inthe first created working directory. These two cases can be post-processed side by side usingthe standard method (VisualCAST) in order to be able to compare them in great detail.Moreover, the SVFILE keyword mentioned above will, if defined, keep a copy (one for eachone of the solver calls) of the desired files in a File.save directory. In specific cases, this canalso be useful. This allows for example reconstructing and viewing all the intermediate stepsin the progression of the algorithm towards the solution.

  • 8/18/2019 Procast Optimization

    33/37

    Page 33/37

    A final comment concerns post-processing of a stochastic study (process robustness orprocess window). This result is statistical in nature and its analysis (to extract for example thepredicted scrap rate) needs some extra care (in order to fully exploit all the information). Forthat purpose, Excel®  sheets containing analysis macros are available (together withdocumentation about their use) from ESI.

    6. Notes on installation

    For optimization to be active, the standard installations of first ProCAST and then PAM-OPTshould be performed (documentation is available for this step with both products). In theinstallation directory of ProCAST, the file manager.tcl should be modified after line 55 so that

    the variables optimPre, cdsWizard and useLocalDbs all take a value of 1.

    On Linux, this is all that is necessary to customize the environment to be able to use theoptimization module (provided ssh was already configured properly). Under Windows®,

    however, some more steps are required to complete the customization. After installation ofPAM-OPT, the start menu will have the appearance illustrated on the following picture:

  • 8/18/2019 Procast Optimization

    34/37

    Page 34/37

    One finds the Windows and Cygwin versions of the PAM-OPT solver as expected. As PAM-

    OPT works with links to the executables programs, those links now need to be defined (suchlinks, or aliases, are native undr the Linux ProCAST installation). This setup needs to be done

     just once and is explained in greater details in the PAM-OPT documentation.

    In order to setup the environment in the pure Windows® version, the user should click on theConfigure PAM-OPT Solver Windows menu. This will open a command window and start aprocedure that automatically creates links to selected ESI aplications (those links are added toa file contained in the user profile directory). Once this step is finished, pressing any key willlaunch the GUI for adding custom links (added to the same user profile file), which we willuse in the case of casting.

    This GUI is illustrated on the following image and lists the links already defined.

  • 8/18/2019 Procast Optimization

    35/37

  • 8/18/2019 Procast Optimization

    36/37

    Page 36/37

    Once all custom links have been properly defined, the user may Upgarde the PAM-OPT linkfiles and Exit.

    Under cygwin, the setup of all these links is easier. It is indeed only necessary to copy all the.sh scripts from the opt_launch_scripts/cygwin (in the bin directory of the ProCASTinstallation) into the pamopt_cygwin/env-Cygwin of the PAM-OPT installation directoy.

  • 8/18/2019 Procast Optimization

    37/37

    This summarizes the customization necessary at the installation step to be able to use thePAM-OPT / ProCASt optimization module under Windows® (again ssh is assumed to beproperly configured for cygwin use).