Menu

#287 Advanced Kinetics Specification using Python Script

6.3
open
None
Windows
2021-03-03
2021-03-03
No

Hello Daniel. I am studying an first-order kinetic equation, as in, the rate of reaction is r = kCa. My k is dependent on the conditions of the stream, as in, there are inibitions. My python script should return the r, the k, or the Ca? In what units?
The last line of my python script is:

r = km_aa*inib_aa*C_aa #kg m^-3 s^-1

where km_aa is in s^-1, inib_aa is dimensionless, and C_aa is in k m^-3
Is this correct?

Discussion

  • Daniel Medeiros

    Daniel Medeiros - 2021-03-03

    Deve retornar r. Na próxima use o fórum, Leandro, já que isso não é um bug.

     
  • Leandro Favaretto

    Vou aproveitar este ticket, já que agora realmente tive um bug! rs
    Ao executar o fluxograma, recebo um erro do tipo " 17 03/03/2021 11:34:55 Error Error running script: Traceback (most recent call last):
    File "<string>", line 4, in <module>
    AttributeError: 'Reactor_CSTR' object has no attribute 'GetFlowsheetSimulationObject' + Info
    Acredito que algo esteja errado com o CSTR. Confira o anexo por favor</module></string>

     
    • Daniel Medeiros

      Daniel Medeiros - 2021-03-03

      Teu script tá errado, linha 4:

      obj = obj.Flowsheet.GetFlowsheetSimulationObject('5')
      

      troque por

      Flowsheet = reactor.Flowsheet
      obj = Flowsheet.GetFlowsheetSimulationObject('5')
      

      A referência para o Flowsheet realmente está quebrada, msa você pode pegá-lo através de reactor.Flowsheet.

       
  • Leandro Favaretto

    Continua dando erro, dessa vez aparece 55 03/03/2021 14:11:27 Error Error running script: Traceback (most recent call last):
    File "<string>", line 4, in <module>
    AttributeError: 'Reactor_CSTR' object has no attribute 'Flowsheet' + Info</module></string>

     
  • Daniel Medeiros

    Daniel Medeiros - 2021-03-03

    É na linha 4 do outro script, você tem 2.

     
  • Leandro Favaretto

    O Script "CSTR" está sem ativar, o unico que está envolvido nas cinéticas das reações é o "1 Glycine"
    Acho que descobri o erro. Uma olhada na página https://dwsim.inforside.com.br/api_help60/html/T_DWSIM_UnitOperations_Reactors_Reactor_CSTR.htm me revela que o comando é FlowSheet, e não Flowsheet (capital L). Uma troca de

    Flowsheet = reactor.Flowsheet
    obj = Flowsheet.GetFlowsheetSimulationObject('5')
    

    para

    FlowSheet = reactor.FlowSheet
    obj = FlowSheet.GetFlowsheetSimulationObject('5')
    

    retira o erro. na verdade, onde há "Flowsheet" no código eu troquei para "FlowSheet" e deu certo. Obrigado!
    Thanks!
    For english speakers: something about Flowsheet reference being broken, and having to redirect using the command "reactor.FlowSheet" so DWSIM knows what Flowsheet is being used in question