Hello sir. I have this Python Script, using IronPython interpreter:
TempoDesejado=1211431.76CSTR=Flowsheet.GetFlowsheetSimulationObject('CSTR-01')LIQUID=Flowsheet.GetFlowsheetSimulationObject('LIQUID')BIOGAS=Flowsheet.GetFlowsheetSimulationObject('BIOGAS')TimeL=CSTR.ResidenceTimeLTimeV=CSTR.ResidenceTimeVVazao_Liq=LIQUID.GetPhase('Overall').Properties.volumetric_flow#inm3/sVazao_Vap=BIOGAS.GetPhase('Overall').Properties.volumetric_flow#inm3/sVolume_Vapor=Vazao_Vap*TempoDesejado#estimativaparaopróximoHeadspaceVolume_Liq=Vazao_Liq*TempoDesejado#estimativaparaopróximoVolumeCSTR.Headspace=Volume_VaporCSTR.Volume=Volume_LiqFlowsheet.RequestCalculation()#calculaofluxogramaTimeL=CSTR.ResidenceTimeLTimeV=CSTR.ResidenceTimeVprint("Vazao de Vapor: ",Vazao_Vap)print("Vazao de Liquido: ",Vazao_Liq)print("Tempo de Residencia da Fase Vapor: ",CSTR.ResidenceTimeV,"s")print("Tempo de Residencia da Fase Liquida: ",CSTR.ResidenceTimeL,"s")
The thing is: The moment I click to start the script, it instantenously prints the last 4 messages even before the Flowsheet BEGINS calculating. How do I make sure the script "waits" for the Flowsheet to calculate before going to the next step? This happens in Async or Not Async mode
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello sir. I have this Python Script, using IronPython interpreter:
The thing is: The moment I click to start the script, it instantenously prints the last 4 messages even before the Flowsheet BEGINS calculating. How do I make sure the script "waits" for the Flowsheet to calculate before going to the next step? This happens in Async or Not Async mode
RequestCalculation() runs asynchronously. Use SolveFlowsheet2() for a synchronous calculation.
I didn't answer before, but obviously this answered my question!