Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Procedures and Functions PROCEDURE TEST(A,B,C:X,Y)... X :=... Y :=... END.

Slides:



Advertisements
Similar presentations
Lecture 15: Capillary motion
Advertisements

Thermodynamic relations for dielectrics in an electric field Section 10.
Engineering Fundamentals II
Exergy: A Measure of Work Potential Study Guide in PowerPoint
Development of Dynamic Models Illustrative Example: A Blending Process
Development of Dynamic Models Illustrative Example: A Blending Process
Thermodynamics and Statistical Mechanics Spring 2006.
System. surroundings. universe.
ES 202 Fluid and Thermal Systems Lecture 7: Mechanical Energy Balance (12/16/2002)
Thermodynamics and Statistical Mechanics
Entropy and the Second Law of Thermodynamics
THEORETICAL MODELS OF CHEMICAL PROCESSES
PTT 201/4 THERMODYNAMIC SEM 1 (2012/2013). Objectives Apply the second law of thermodynamics to processes. Define a new property called entropy to quantify.
Thermodynamics Chapter 15. Expectations After this chapter, students will:  Recognize and apply the four laws of thermodynamics  Understand what is.
THERMODYNAMICS CH 15.
The second law of thermodynamics: The heat flow statement: Heat flows spontaneously from a substance at a higher temperature to a substance at a lower.
Dr.Salwa Al Saleh Lecture 9 Thermodynamic Systems Specific Heat Capacities Zeroth Law First Law.
THERMODYNAMICS Branch of science which deals with the processes involving heat and temperature inter conversion of heat and other forms of energy.
Lecture slides by Mehmet Kanoglu
7 CHAPTER Exergy: A Measure of Work Potential.
1 Thermodynamics. 2 A few reminders TEMPERATURE determines the direction of flow of thermal energy between two bodies in thermal equilibrium HOTCOLD.
1 Fluid Models. 2 GasLiquid Fluids Computational Fluid Dynamics Airframe aerodynamics Propulsion systems Inlets / Nozzles Turbomachinery Combustion Ship.
Chapter 21ENTROPY AND THE SECOND LAW OF THERMODYNAMICS 21.1 Some One-Way Processes Consider the following examples: Example 1: If you drop a stone, it.
Lecture Outline Chapter 12 College Physics, 7 th Edition Wilson / Buffa / Lou © 2010 Pearson Education, Inc.
Thermal contact Two systems are in thermal (diathermic) contact, if they can exchange energy without performing macroscopic work. This form of energy.
Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Component Modelling The interaction between conservation equations and equations.
1. (1.3) (1.8) (1.11) (1.14) Fundamental equations for homogeneous closed system consisting of 1 mole:
Thermodynamic systems and concepts—topic 10.1
Dr. R. Nagarajan Professor Dept of Chemical Engineering IIT Madras
Thermodynamics Thermodynamics Thermodynamics Way to calculate if a reaction will occur Way to calculate if a reaction will occur Kinetics Kinetics Way.
Chapter 8: The Thermodynamics of Multicomponent Mixtures
Chapter 13: Thermodynamics
Chapter21 Entropy and the Second Law of Thermodynamics.
Chapter 2 Modeling Approaches  Physical/chemical (fundamental, global) Model structure by theoretical analysis  Material/energy balances  Heat, mass,
Entropy, the Second and Third Law of Thermodynamics By Doba Jackson, Ph.D. Associate Professor of Chemistry and Biochemistry Huntingdon College.
CHAPTER 15 Thermodynamics Thermodynamic Systems and Their Surroundings Thermodynamics is the branch of physics that is built upon the fundamental.
Temperature & the Laws of Thermodynamics Lecture Notes
First Law of Thermodynamics
Thermodynamics Thermal Processes The 2 nd Law of Thermodynamics Entropy.
First step in Understanding the Nature of Fluid Flow…. P M V Subbarao Professor Mechanical Engineering Department I I T Delhi Analysis of Simplest Flow.
ENTROPY AND THIRD LAW OF THERMODYNAMICS. 2 ND LAW OF THERMODYNAMICS  Kelvin-Planck Statement  It is impossible to construct an engine which operating.
Thermodynamics. Consider two blocks of Energy A and B with different temperatures Ta and Tb. Ta > Tb. Heat will flow from Block A to block B until they.
Chapter 15 Thermodynamics Thermodynamic Systems and Their Surroundings Thermodynamics is the branch of physics that is built upon the fundamental.
MAE 5380: Advanced Propulsion Thermodynamics Review and Cycle Analysis Overview Mechanical and Aerospace Engineering Department Florida Institute of Technology.
Chapter 15 Thermodynamics Thermodynamic Systems and Their Surroundings Thermodynamics is the branch of physics that is built upon the fundamental.
Dr. Owen Clarkin School of Mechanical & Manufacturing Engineering Summary of Energy Topics Chapter 1: Thermodynamics / Energy Introduction Chapter 2: Systems.
THERMODYNAMICS THE NEXT STEP. THERMAL PROPERTIES OF MATTER STATE VARIABLES – DESCRIBE THE SUBSTANCE –PRESSURE –TEMPERATURE –VOLUME –QUANITY OF SUBSTANCE.
1 12. Thermodynamics The essential concepts here are heat and temperature. Heat is a form of energy transferred between a system and an environment due.
Dr. Owen Clarkin School of Mechanical & Manufacturing Engineering Summary of Energy Topics Chapter 1: Thermodynamics / Energy Introduction Chapter 2: Systems.
In the mid-1800s, Mayer, Helmholtz, and Joule discovered independently that heat is simply a form of energy. 1853: Wiedemann and Franz law (good.
Thermodynamics Thermodynamics Thermodynamics Way to calculate if a reaction will occur Way to calculate if a reaction will occur Kinetics Kinetics Way.
19 Second Law Thermo Heat Engines and 2 nd Law Thermodynamics Hk: 27, 35.
12. Thermodynamics Temperature
Chapter: 07 ENTROPY.
CHM 231; BASIC PHYSICAL CH EMISTRY II
Entropy PREPARED BY: KANZARIYA JAYESHBHAI
Solution of Thermodynamics: Theory and applications
LAWS OF THERMODYNAMICS
Thermodynamics Chapter 15.
Heat versus Temperature
TEM – Lecture 2 Basic concepts of heat transfer:
Chapter 3 The 2nd law of thermodynamics
Temperature & the Laws of Thermodynamics Lecture Notes
Chapter Seven: Entropy
Chapter 18,19and20 Thermodynamics.
Chapter 15 Lesson 2.
Modeling Approaches Chapter 2 Physical/chemical (fundamental, global)
Thermodynamics is the science that bind heat with energy and work.
Presentation transcript:

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Procedures and Functions PROCEDURE TEST(A,B,C:X,Y)... X :=... Y :=... END Inputs Outputs CALL TEST(1,2,3:X,Y) Calling from main equation set: Functions and procedures must be placed before equations! FUNCTION Smallest(X,Y,Z) if (X<Y) then S:=X else S:=Y if (S<Z) then goto 10 S:=Z 10: Smallest:=S; END Inputs (only one output!) (Note that English EES notation has been used) x=smallest(1,2,3) Calling from main equation set: End-marker

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Loops and Logical Operators Repeat-Until j:=0 repeat j:=j+1; A[j]:=j+1 until (j>=1000) Logical (or comparison) operators (IF - THEN - ELSE or REPEAT – UNTIL): < (less than) > (greater than) = (equal) <= (less than or equal) >= (greater than or equal) and (logical and) or (logical or) IF-THEN-ELSE IF {logical expression} THEN {Operation} ELSE {Operation} Ex: IF (X 2) THEN A:=3 ELSE A:=X*Y (Within Procedures and Functions!)

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Logical Expressions in Equation Set ARG=IF(A, B, X, Y, Z) If A<B ARG=X If A=B ARG=Y If A>B ARG=Z Be cautious with discontinuities!!!

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen ”Loops” in the Equation Set The Duplicate Function: Duplicate j=1,5 A[j]=h[j]-T*s[j] End is equivalent to: A[1]=h[1]-T*s[1] A[2]=h[2]-T*s[2] A[3]=h[3]-T*s[3] A[4]=h[4]-T*s[4] A[5]=h[5]-T*s[5] Warning! This can introduce gigantic equation sets!

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Solving Integrals Numerically Intergral Function: F = INTEGRAL(Integrand, VarName, LowerLimit, UpperLimit, StepSize) or F = INTEGRAL(Integrand, VarName, LowerLimit, UpperLimit) {automatic step size} Differential Equations Using Integral Function: y=y0 + INT{ f(x,y) dx}

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Modules & Subprograms MODULE TEST(A, B : X, Y).. {Equations}. END SUBPROGRAM TEST(A, B : X, Y).. {Equations}. END Are called using a CALL statement just like procedures! (Equations are solved simultaneously) (Equations are solved internally in subprograms where after the program iterates between the subprograms and main programs until a solution is reached)

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Fundamental laws of thermodynamics Zeroth law: If two bodies are each in equilibrium with a third body, they are in thermal equilibrium with each other. First law:The energy is conserved ~ you can’t win! Second law:If a process occurs in a closed system, the entropy increases for irreversible processes and remains constant for reversible processes (  S  0) ~ you can’t break even! Third law:The entropy of a system goes to zero as the temperature goes to 0K, no matter the values of parameters as pressure, volume, electric fields etc. ~there is no point in trying!

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Interpretation of 2 nd law 2 nd lw. (altI):No series of processes is possible whose sole result is the absorption of heat from a thermal reservoir and the complete conversion of this energy to work: There are no perfect engines! 2 nd lw. (altII):No series of processes is possible whose sole result is the transfer of heat from a reservoir at a given temperature to a reservoir at a higher temperature: There are no perfect refrigerators!

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Properties used in thermal modelling: Thermodynamic properties Temperature T, pressure p, specific volume v and density . Calorimetric properties Specific enthalpy h, specific entropy s, specific internal energy u. Material & transport properties Specific heat capacity c p (at constant pressure) & c v (at constant volume), kinematic viscosity, dynamic viscosity . Physical & derived properties Dimension, shape, efficiency, mass flow, heat transfer coefficients etc.

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Conservation equations Most of the systems we consider are OPEN SYSTEMS! 1 st law: Continuity: Momentum:

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Steady State (Stationary conditions) If we neglect variations in kinetic energy, potential energy and momentum losses (pressure losses): Keep in mind: Energy and mass are always conserved! There are no exceptions!

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Molar fractions and Mass fractions Dalton’s Law: The total pressure equals the sum of the partial pressures. The partial pressures are the pressures the single components in the gas (i.e. species) would have if they were present alone in the system.

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Mixture Enthalpy

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Mixture Entropy

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Mixture Transport Properties Wilke’s formula:

Analysis, Modelling and Simulation of Energy Systems, SEE-T9 Mads Pagh Nielsen Procedure for using Wilke’s Formula viscosity=0 lambda_gas=0 for i=1:NS interaction_sum=0 for j=1:NS int(i,j)=(1+sqrt(my(i)/my(j))*(M(j)/M(i))^(1/4))^2/(sqrt(8)*sqrt(1+(M(i)/M(j)))) interaction_sum=interaction_sum+x(j)*int(i,j) end my_gas=my_gas+x(i)*my(i)/interaction_sum lambda_gas=lambda_gas+x(i)*lambda(i)/interaction_sum end