From 6640cdfac4c954a19a2e01988b34e7777bd9e39f Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 3 Jan 2023 11:54:35 -0800 Subject: message box (unedit) --- Simulator/BinaryEnvelopes.mo | 19 +++++++++++++++++++ Simulator/Simulator/Examples/MaterialStream.mo | 2 ++ Simulator/Simulator/Streams/MaterialStream.mo | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 Simulator/BinaryEnvelopes.mo (limited to 'Simulator') diff --git a/Simulator/BinaryEnvelopes.mo b/Simulator/BinaryEnvelopes.mo new file mode 100644 index 0000000..9eed56a --- /dev/null +++ b/Simulator/BinaryEnvelopes.mo @@ -0,0 +1,19 @@ +package BinaryEnvelopes + model NRTL + parameter Integer NOC; + parameter Integer data_points; + parameter Real BIP[NOC, NOC, 2] = Simulator.Files.Thermodynamic_Functions.BIPNRTL(NOC, comp.CAS); + parameter Simulator.Files.Chemsep_Database.General_Properties comp[NOC]; + Simulator.Binary_Phase_Envelope.Binary_Phase_Envelope_NRTL.base points[data_points](each NOC = NOC, each comp = comp, each BIP = BIP); + Real x[data_points, NOC], y[data_points, NOC], P[data_points], T[data_points]; + equation + points[:].x = x; + points[:].y = y; + points[:].P = P; + points[:].T = T; + for i in 1:data_points loop + x[i, 1] = 0 + (i - 1) * 1/(data_points-1); + end for; + end NRTL; + +end BinaryEnvelopes; diff --git a/Simulator/Simulator/Examples/MaterialStream.mo b/Simulator/Simulator/Examples/MaterialStream.mo index 04c57d7..73d749c 100644 --- a/Simulator/Simulator/Examples/MaterialStream.mo +++ b/Simulator/Simulator/Examples/MaterialStream.mo @@ -59,6 +59,8 @@ package MaterialStream F_p[1] = 100; end PVFflash; + + model PHflash //we have to first instance components to give to material stream model. import data = Simulator.Files.ChemsepDatabase; diff --git a/Simulator/Simulator/Streams/MaterialStream.mo b/Simulator/Simulator/Streams/MaterialStream.mo index 73cbafe..6d78e99 100644 --- a/Simulator/Simulator/Streams/MaterialStream.mo +++ b/Simulator/Simulator/Streams/MaterialStream.mo @@ -33,7 +33,7 @@ model MaterialStream "Model representing Material Stream" Simulator.Files.Interfaces.matConn Out(Nc = Nc) annotation( Placement(visible = true, transformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); - extends GuessModels.InitialGuess; + extends GuessModels.InitialGuess(Nc = Nc); equation //Connector equations -- cgit From b6c654ccdd0e401bfc4e651fe533512dba320e4c Mon Sep 17 00:00:00 2001 From: brenda-br Date: Wed, 4 Jan 2023 11:40:04 -0800 Subject: Disabling SM Simulation Mode some changes have been made to BinaryEnvelopes.mo --- Simulator/BinaryEnvelopes.mo | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Simulator') diff --git a/Simulator/BinaryEnvelopes.mo b/Simulator/BinaryEnvelopes.mo index 9eed56a..590888d 100644 --- a/Simulator/BinaryEnvelopes.mo +++ b/Simulator/BinaryEnvelopes.mo @@ -1,11 +1,11 @@ package BinaryEnvelopes model NRTL - parameter Integer NOC; + parameter Integer Nc; parameter Integer data_points; - parameter Real BIP[NOC, NOC, 2] = Simulator.Files.Thermodynamic_Functions.BIPNRTL(NOC, comp.CAS); - parameter Simulator.Files.Chemsep_Database.General_Properties comp[NOC]; - Simulator.Binary_Phase_Envelope.Binary_Phase_Envelope_NRTL.base points[data_points](each NOC = NOC, each comp = comp, each BIP = BIP); - Real x[data_points, NOC], y[data_points, NOC], P[data_points], T[data_points]; + parameter Real BIP[Nc, Nc, 2] = Simulator.Files.ThermodynamicFunctions.BIPNRTL(Nc, comp.CAS); + parameter Simulator.Files.ChemsepDatabase.GeneralProperties comp[Nc]; + Simulator.BinaryPhaseEnvelope.BinaryPhaseEnvelopeNRTL.base points[data_points](each Nc = Nc, each comp = comp, each BIP = BIP); + Real x[data_points, Nc], y[data_points, Nc], P[data_points], T[data_points]; equation points[:].x = x; points[:].y = y; @@ -16,4 +16,8 @@ package BinaryEnvelopes end for; end NRTL; + + + + end BinaryEnvelopes; -- cgit