Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOQUS not getting results for Aspen+ simulations ending with warnings. #268

Closed
eslickj opened this issue Aug 21, 2018 · 7 comments
Closed
Assignees

Comments

@eslickj
Copy link
Member

eslickj commented Aug 21, 2018

FOQUS used to be able to get simulation results for A+ simulations which ended in warnings. At some point this seems to have stopped working. Regardless of weather the simulation ends in a warning or convergence error the results should be passed back to FOQUS if at all possible.

I think I tracked down the problem. At some point lines were commented out that cause warnings to be treaded as unknown errors. Here is the location in the code https://github.com/CCSI-Toolset/turb_sci_gate/blob/master/Master/Turbine.Consumer.SimSinter/SinterConsumerRun.cs#L854.

I guess treating warnings as unknown errors may cause the results of the simulation not to be stored by Turbine? @boverhof can you check into this. If you need a test case @fsoepyan should be able to provide it.

@fsoepyan fsoepyan changed the title FOQUS not getting results for A+ simulations ending with warnings. FOQUS not getting results for Aspen+ simulations ending with warnings. Aug 22, 2018
@ksbeattie
Copy link
Member

@boverhof will try digging into this. @fsoepyan can you provide Josh the simulation that reproduces this problem?

@ksbeattie
Copy link
Member

This is where that change happened in the old svn repo (login required).

@boverhof
Copy link
Member

Bottom Up: SinterConsole.exe succeeds

(base) C:\Users\Administrator\Desktop\ConsoleSinterTest>"\Program Files (x86)\CCSI\SimSinter\ConsoleSinter.exe" Baseline_DPE2_System_Model.json inputs.json output.json
Starting run 0

Warnings:
Block MHX1 has Warnings:
Block MHX2 has Warnings:


FINISHED. PRESS ENTER KEY TO EXIT PROGRAM.

(base) C:\Users\Administrator\Desktop\ConsoleSinterTest>more inputs.json
{}

output.txt

@boverhof
Copy link
Member

AspenSinterConsumerConsole.exe fails

(base) C:\Users\Administrator\Desktop\TurbineTest>python \ProgramDAta\Anaconda2\Scripts\turbine_simulation_create Baseline_DPE2_System_Model AspenPlus turbine.cfg

(base) C:\Users\Administrator\Desktop\TurbineTest>python \ProgramDAta\Anaconda2\Scripts\turbine_simulation_update -r configuration Baseline_DPE2_System_Model Baseline_DPE2_System_Model.json turbine.cfg

(base) C:\Users\Administrator\Desktop\TurbineTest>python \ProgramDAta\Anaconda2\Scripts\turbine_simulation_update -r aspenfile Baseline_DPE2_System_Model Baseline_DPE2_System_Model.bkp turbine.cfg

(base) C:\Users\Administrator\Desktop\TurbineTest>python \ProgramDAta\Anaconda2\Scripts\turbine_session_create turbine.cfg
639c5b53-2f6d-4d25-9031-a652c935c050

(base) C:\Users\Administrator\Desktop\TurbineTest>more jobs.json
[{"Simulation":"Baseline_DPE2_System_Model", "Input":{}}]

(base) C:\Users\Administrator\Desktop\TurbineTest>python \ProgramDAta\Anaconda2\Scripts\turbine_session_append 639c5b53-2f6d-4d25-9031-a652c935c050 jobs.json turbine.cfg
[11]

(base) C:\Users\Administrator\Desktop\TurbineTest>python \ProgramDAta\Anaconda2\Scripts\turbine_session_status 639c5b53-2f6d-4d25-9031-a652c935c050 turbine.cfg
{"pause": 0, "locked": 0, "success": 0, "setup": 0, "terminate": 0, "submit": 0, "running": 0, "error": 0, "cancel": 0, "create": 1}

(base) C:\Users\Administrator\Desktop\TurbineTest>python \ProgramDAta\Anaconda2\Scripts\turbine_session_start 639c5b53-2f6d-4d25-9031-a652c935c050 turbine.cfg
1

(base) C:\Users\Administrator\Desktop\TurbineTest>python \ProgramDAta\Anaconda2\Scripts\turbine_session_status 639c5b53-2f6d-4d25-9031-a652c935c050 turbine.cfg
{"pause": 0, "locked": 0, "success": 0, "setup": 0, "terminate": 0, "submit": 1, "running": 0, "error": 0, "cancel": 0, "create": 0}

(base) C:\Users\Administrator\Desktop\TurbineTest>python \ProgramDAta\Anaconda2\Scripts\turbine_session_status 639c5b53-2f6d-4d25-9031-a652c935c050 turbine.cfg
{"pause": 0, "locked": 0, "success": 0, "setup": 0, "terminate": 0, "submit": 0, "running": 0, "error": 1, "cancel": 0, "create": 0}

(base) C:\Users\Administrator\Desktop\TurbineTest>python \ProgramDAta\Anaconda2\Scripts\turbine_job_script -bvj 11 turbine.cfg
      Status     2
       Reset     True
      Errors     []
       Setup     2018-08-30T19:30:43.3130000
      Create     2018-08-30T19:24:55.7870000
    Messages     [u'event=setup,consumer=f6ee5804-ff2e-4f9a-ba00-d51269dc4cee', u'working directory setup finished', u'sinter read setup fin
ished', u'event=running,consumer=f6ee5804-ff2e-4f9a-ba00-d51269dc4cee', u'sinter inputs sent, running simulation', u'Real Run was complete a
nd failed.', u'event=error,consumer=f6ee5804-ff2e-4f9a-ba00-d51269dc4cee,msg="Aspen Process Status unknown code 2."']
     Running     2018-08-30T19:30:58.0070000
      Submit     2018-08-30T19:26:05.0500000
  Simulation     Baseline_DPE2_System_Model
     Visible     False
       State     error
     Session     639c5b53-2f6d-4d25-9031-a652c935c050
      Output     None
  Initialize     False
       Input     {}
        Guid     81eb7f67-bc66-44fc-828a-e3803fdf3343
    Consumer     f6ee5804-ff2e-4f9a-ba00-d51269dc4cee
          Id     11
    Finished     2018-08-30T19:31:38.5900000
===================================
=  Basic Stats Job 11
===================================
               Queue -- 0:05:47.526000
               Setup -- 0:00:14.694000
             Runtime -- 0:00:40.583000
                Done

AspenSinterConsumerConsole.exe output

SinterConsumerConsole: >> Waiting 40
> Engine Running: 1800
top
SinterConsumerConsole: >> Waiting 41
> Engine Running: 1800
top
SinterConsumer.DoRun: Job 12: recvOutputsFromSim
SinterConsumer.Run: Real Run was complete and failed. Job Id: 12
SinterConsumer.Run: Finalize: ProcessID 1984
SinterConsumer.DoFinalize: Sinter runstatus is not si_OKAY to retrieve outputs.
Outputs:
SinterConsumerRun.DoFinalize: Error: Unknown
SinterConsumer.Run: Done Finalize: ProcessID 1984

@boverhof
Copy link
Member

Turbine.Consumer.SimSinter: SinterConsumerRun.cs

So I think the first step is to add an "if else WARNING" here and just proceed.

            try
            {
                running = true;
                lock (this)
                {
                    stest.sendInputsToSim();
                    Debug.WriteLine(String.Format("Job {0}: runSim ", job.Id),
                        "SinterConsumer.DoRun");
                    stest.runSim();
                    Debug.WriteLine(String.Format("Job {0}: recvOutputsFromSim ", job.Id),
                        "SinterConsumer.DoRun");
                    if (stest.runStatus == sinter.sinter_AppError.si_OKAY)
                    {
                        stest.recvOutputsFromSim();
                        job.Message("Real Run was complete and successful.");
                        Debug.WriteLine(String.Format("Real Run was complete and successful. Job Id: {0}    ", job.Id),
                            "SinterConsumer.Run");
                    }
                    else
                    {
                        job.Message("Real Run was complete and failed.");
                        Debug.WriteLine(String.Format("Real Run was complete and failed. Job Id: {0}", job.Id),
                            "SinterConsumer.Run");
                    }
                }

@boverhof
Copy link
Member

Handle Warnings and return as "success"

Code committed and tested against the AspenPlus simulation provided.

CCSI-Toolset/turb_sci_gate@00f2cef

(base) C:\Users\Administrator\Desktop\TurbineTest>python \ProgramData\Anaconda2\Scripts\turbine_job_script -bvj 1 turbine.cfg
      Status     2
       Reset     True
      Errors     []
       Setup     2018-08-30T23:30:24.0430000
      Create     2018-08-30T23:29:23.4930000
    Messages     [u'event=setup,consumer=8e7aff05-c42b-4af7-8ccc-584e1d6670a4', u'working directory setup finished', u'sinter read setup fin
ished', u'event=running,consumer=8e7aff05-c42b-4af7-8ccc-584e1d6670a4', u'sinter inputs sent, running simulation', u'Real Run was completed
with warning.', u'Block MHX1 has Warnings:\r\nBlock MHX2 has Warnings:\r\n', u'event=sucess,consumer=8e7aff05-c42b-4af7-8ccc-584e1d6670a4']
     Running     2018-08-30T23:30:39.8500000
      Submit     2018-08-30T23:29:29.5130000
  Simulation     Baseline_DPE2_System_Model
     Visible     False
       State     success
     Session     44f99723-f3d7-4cab-9785-5c15ef8e8e8b
      Output     {u'TOCHANNL_SO3_FR': {u'units': u'lb/hr', u'value': 0.0}, u'TOTRANSP_CO2_FR': {u'units': u'lb/hr', u'value': 23282.8282}, u
'TOTRANSP_NO_FR': {u'units': u'lb/hr', u'value': 0.0298022735}, u'DRYCOAL_FR': {u'units': u'lb/hr', u'value': 311812.023}, u'RECYSEED_CHKO2_
FR': {u'units': u'lb/hr', u'value': 18491.023}, u'TOCHANNL_N2_FR': {u'units': u'lb/hr', u'value': 0.0030954543}, u'LP-NGF_C2H6_FR': {u'units
': u'lb/hr', u'value': 5.5531803e-11}, u'O2-COMB_O2_FR': {u'units': u'lb/hr', u'value': 596280.843}, u'TOTRANSP_H2O_FR': {u'units': u'lb/hr'
, u'value': 73.5941877}, u'DRYCOAL_T': {u'units': u'degF', u'value': 220.0}, u'RECYSEED_MgO_FR': {u'units': u'lb/hr', u'value': 18.9422713},
 u'TOCHANNL_CO_FR': {u'units': u'lb/hr', u'value': 1.91058149e-09}, u'LP-NGF_C3H8_FR': {u'units': u'lb/hr', u'value': 1.78141836e-11}, u'SEE
DFED_T': {u'units': u'degF', u'value': 60.6555973}, u'TOTRANSP_O2_FR': {u'units': u'lb/hr', u'value': 25.7497441}, u'SEEDFED_H2O_FR': {u'uni
ts': u'lb/hr', u'value': 4475.83681}, u'RECYSEED_CaSO4_FR': {u'units': u'lb/hr', u'value': 0.0}, u'TOTRANSP_CO_FR': {u'units': u'lb/hr', u'v
alue': 0.000482403902}, u'LP-NGF_C4H10-01_FR': {u'units': u'lb/hr', u'value': 1.34175916e-11}, u'RECYSEED_K2Si2O5_FR': {u'units': u'lb/hr',
u'value': 0.0}, u'TOTRANSP_NO2_FR': {u'units': u'lb/hr', u'value': 8.44177074e-05}, u'RECYSEED_Fe2O3_FR': {u'units': u'lb/hr', u'value': 0.0
}, u'TOCHANNL_T': {u'units': u'degF', u'value': 199.803207}, u'TOTRANSP_SO2_FR': {u'units': u'lb/hr', u'value': 0.000169514539}, u'LP-NGF_C4
H10N_FR': {u'units': u'lb/hr', u'value': 0.0}, u'status': {u'units': u'', u'value': 2}, u'TOCHANNL_Ar_FR': {u'units': u'lb/hr', u'value': 0.
00287796127}, u'RECYSEED_CaCO3_FR': {u'units': u'lb/hr', u'value': 0.0}, u'RECYSEED_Ca(OH)2_FR': {u'units': u'lb/hr', u'value': 793.286934},
 u'TOTRANSP_T': {u'units': u'degF', u'value': 200.033241}, u'O2-COMB_T': {u'units': u'degF', u'value': 230.573963}, u'RECYSEED_Gypsum_FR': {
u'units': u'lb/hr', u'value': 0.0}, u'TOTRANSP_Ar_FR': {u'units': u'lb/hr', u'value': 726.65822}, u'TOCHANNL_H2O_FR': {u'units': u'lb/hr', u
'value': 0.000291472958}, u'TOCHANNL_CO2_FR': {u'units': u'lb/hr', u'value': 0.0922126469}, u'RECYSEED_Al2O3_FR': {u'units': u'lb/hr', u'val
ue': 0.0}, u'RECYSEED_T': {u'units': u'degF', u'value': 216.061953}, u'SEEDFED_K2CO3_FR': {u'units': u'lb/hr', u'value': 4475.83522}, u'TOTR
ANSP_N2_FR': {u'units': u'lb/hr', u'value': 781.573168}, u'O2-COMB_N2_FR': {u'units': u'lb/hr', u'value': 11787.3028}, u'RECYSEED_K2CO3_FR':
 {u'units': u'lb/hr', u'value': 2488.39154}, u'TOCHANNL_SO2_FR': {u'units': u'lb/hr', u'value': 6.71369656e-10}, u'LP-NGF_CH4_FR': {u'units'
: u'lb/hr', u'value': 8.61970365e-10}, u'TOCHANNL_NO_FR': {u'units': u'lb/hr', u'value': 1.18033192e-07}, u'O2-COMB_Ar_FR': {u'units': u'lb/
hr', u'value': 22370.456}, u'RECYSEED_H2O_FR': {u'units': u'lb/hr', u'value': 52112.6738}, u'LP-NGF_CO2_FR': {u'units': u'lb/hr', u'value':
2.53987862e-11}, u'SEEDFED_CHKO2_FR': {u'units': u'lb/hr', u'value': 0.0}, u'LP-NGF_N2_FR': {u'units': u'lb/hr', u'value': 2.5867271e-11}, u
'TOTRANSP_SO3_FR': {u'units': u'lb/hr', u'value': 4.230597e-06}, u'RECYSEED_K2SO4_FR': {u'units': u'lb/hr', u'value': 592.381665}, u'RECYSEE
D_SiO2_FR': {u'units': u'lb/hr', u'value': 97.8684017}, u'TOCHANNL_O2_FR': {u'units': u'lb/hr', u'value': 0.000101982974}, u'RECYSEED_K2SiO3
_FR': {u'units': u'lb/hr', u'value': 0.0}, u'RECYSEED_MgAl2O4_FR': {u'units': u'lb/hr', u'value': 0.0}, u'TOCHANNL_NO2_FR': {u'units': u'lb/
hr', u'value': 0.0}}
  Initialize     False
       Input     {}
        Guid     9eb66610-fc27-4f66-aa01-b687adc9a969
    Consumer     8e7aff05-c42b-4af7-8ccc-584e1d6670a4
          Id     1
    Finished     2018-08-30T23:31:23.7430000
===================================
=  Basic Stats Job 1
===================================
               Queue -- 0:01:00.550000
               Setup -- 0:00:15.807000
             Runtime -- 0:00:43.893000
                Done

@boverhof
Copy link
Member

@boverhof boverhof reopened this Aug 31, 2018
ksbeattie added a commit that referenced this issue Aug 31, 2018
Pointing to the releases page and not just the binary to download.

Part of #268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants