10 Replies Latest reply on Nov 16, 2011 3:02 PM by Ron Reiners

    Can you use Visual Basic commands in an Equation Goal?

    Ron Reiners

      Can you use an IIF statement in an Equation Goal in Flow Simulation?

       

      I currently use an equation goal to perform a simple mathematical problem (A-B)*C. Now I have a situation in which I need this equation goal to change after a specific amount of time. I have tried to us and IIF command but keep getting and INVALID response when I run the simulation.

       

      Thanks,

       

      Ron

        • Re: Can you use Visual Basic commands in an Equation Goal?
          Ron Reiners

          As a follow up. I have contacted technical support. Visual basic commands are not supported.

           

          I am still trying to find a way to adjust my mathematical formula after a set amount of time during the analysis.

          • Re: Can you use Visual Basic commands in an Equation Goal?
            Bill McEachern

            Is there a reason you don't  just add both versions of the goal (ie make two goals) and then at the proper time index, in a post processing operation, construct what you want.

              • Re: Can you use Visual Basic commands in an Equation Goal?
                Ron Reiners

                Yes, because I am taking the results from the first goal and then applying the second goal. Also automate the process.

                 

                I am running a thermal model on a pc board. My pc board has two sections that are heated. I don't know how may watts are required in the heat sources but I do know how hot I want a control component that is near the heat source to be in each heated section. I use a formula to adjust the heat source wattage up and down until my control components have reached a stabilized temperature. Now I need to find out what interactions the two heated sections have on each other. I will do this by allowing both sections to stabilize at the first desired temperature and then drop the temperature of one section by 5 or 10 degrees and see how this change affect the other heated section.

                 

                I am trying to automate this process by having the program automatically change my control component temperature after a certain amount of time. Currently I have the program stop at the time change at which point I then go in and change the control temp and restart the program from this point and continue on for another X amount of time. The problem with this method is that it take my models anywhere from 12-18 hours to run. Which means the time change occurs after I have gone home for the day. My choice then is to restart the program the next work day, which cost another day, or restart it from home and hope that this time change does not occur in the middle of the night. It should also be noted that I typically run 4-8 configurations at a time so it is not as simple as going in and changing a single number and restarting the simulation.

                 

                Hope this wasn't too long of an answer.

                 

                Regards,

                Ron

                  • Re: Can you use Visual Basic commands in an Equation Goal?
                    Bill McEachern

                    Why not add more goals and heat sources - you get to point A as you have done. then you shut all that off and turn on new goals and heat sources to do what you want. I suppose you have to assume you know the time it takes for hte first stabalization to occur. IF things are convvectively steady you get all this to compute realtively quickly using the flow freexing and controling the time step thru forced saves. If not, well then you just have to let it go without the flow freezing.

                      • Re: Can you use Visual Basic commands in an Equation Goal?
                        Ron Reiners

                        I cannot add another heat source. The placement of the heat source is critical. If I would place another heat source (transistor)right next to the first one, the shift in location would skew all of the readings of surrounding components.

                         

                        Currently I am using an equation goal to drive the heat source. Next I am going to see if I can get some kind of table to drive part of my equation goal.

                          • Re: Can you use Visual Basic commands in an Equation Goal?
                            Bill McEachern

                            You can add another component and disable it and turn it into the heat source and have it occupy the same volume I believe. This definitely works in a fluid volume.

                             

                            You can control the powers of the heat sources as a function of time. So withthe dual heat source in the same volume you have at zero output till you are done wit the first condition and then turn the one off the the other on. Not sure it will work but it might.

                             

                            You can not get done what you want done with the equation goal alone - pertty sure on that one.

                             

                            It sound like flow freezing with dramatically speed up your solution if hte convective environment evolves to more or less steady. Are you turing on or off  any fans with goals? You couldget you analysis time down to less than half maybe even as low as 25%.

                              • Re: Can you use Visual Basic commands in an Equation Goal?
                                Ron Reiners

                                I will try to add another heat device in the same space and see if that will work.

                                 

                                I currently use flow freezing along with time steps. No fans in my models.

                                 

                                Any other ways to put in a table that i can use to extract information.

                                 

                                FYI my heat source uses information diectly from an equation goal. This equation goal is ((93-{Temp of control component})*.001)+{current wattage}. 93 is the variable temp that I want to change, Temp of control component is Volume Goal, and current wattage is an equation goal. What I would like to do is change the 93 to another equation goal.

                                  • Re: Can you use Visual Basic commands in an Equation Goal?
                                    Bill McEachern

                                    You can use tables or other methods (functions) to control the heat sources but these are in time and/or spatailly. The f(x) buttons in the specification area of a particular BC/heat source are where you input these parameters. You probably already know that. I guess it is a natural convection problem and by the sounds of it intense. I would be intrested to know if the dual heat source in the same volume approach works.

                                      • Re: Can you use Visual Basic commands in an Equation Goal?
                                        Ron Reiners

                                        I am already using the dependency table of my heat source to control the limits of the power/wattage.

                                         

                                        Working on some other things so I might not get back to these experiments with two parts sharing the same space for a little while.

                                          • Re: Can you use Visual Basic commands in an Equation Goal?
                                            Ron Reiners

                                            I have a solution to my problem. I have not test the dual heat sources in the same volume but I plan on doing that later.

                                             

                                            I have setup another heat source (Surface source) on a very small face of an object out of the way of the area I am trying to model. For this heat source I created a dependency table based on a time goal. I set the power to a very small wattage, .000093w and .000087w. This small power will have virtually no impact on the model. I then created and equation goal that reads this power and multiplies it by 1,000,000 and removes the units. This will give me the desired temperature numbers of 93 and 87 degrees that i need depending on the time. This goal can then be read by my original formula for adjusting power based the desired temperature of the control component.