⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dim1sun.f

📁 对工业生产过程结晶过程的一个仿真程序软件包
💻 F
📖 第 1 页 / 共 2 页
字号:
* Copyright c 1998-2002 The Board of Trustees of the University of Illinois
* 		  All rights reserved.
* Developed by:	Large Scale Systems Research Laboratory
*               Professor Richard Braatz, Director*               Department of Chemical Engineering*		University of Illinois
*		http://brahms.scs.uiuc.edu
* * Permission hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal with the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the 
* Software is furnished to do so, subject to the following conditions:
* 		1. Redistributions of source code must retain the above copyright
*		   notice, this list of conditions and the following disclaimers.
*		2. Redistributions in binary form must reproduce the above 
*		   copyright notice, this list of conditions and the following 
*		   disclaimers in the documentation and/or other materials 
*		   provided with the distribution.
*		3. Neither the names of Large Scale Research Systems Laboratory,
*		   University of Illinois, nor the names of its contributors may
*		   be used to endorse or promote products derived from this 
*		   Software without specific prior written permission.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
* THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*       open.f
*
*       This program simulates the operation of an industrial
*       crystallizer scaled-up from the experimental batch cooling
*       crystallizer described in S. M. Miller's Ph.D. thesis
*       published at the University of Texas at Austin in 1993.
*
*       The purpose of this program is to serve as a benchmark
*       optimal control problem.  The objective of the optimal
*       control problem is to compute a temperature profile that
*       optimizes a crystal property of interest (see below).
*       The program reads the temperature profile from the
*       FORTRAN function Temp.  The output of the
*       program are plots of the moments, solute concentration,
*       relative supersaturation, temperature, and transmittance,
*       and values for three common final crystal properties of
*       interest: (i) weight mean size, (ii) ratio of nucleated
*       crystal mass to seed crystal mass, and (iii) coefficient of
*       variance.
*
* 	The program use functions in IMSL to plot the required plots
*
*
*	Parameter inputs are growth and nucleation 
*       kinetic parameters (g, kg, b, and kb)
*
*	Parameter NN:  the number of discretizations
*	Parameter NEQ: the number of moment equations
*
*
*       Date:    January 27, 1998
*       Authors: Serena H. Chung and Richard D. Braatz
*                Department of Chemical Engineering
*                University of Illinois at Urbana-Champaign
*
*
*




      PROGRAM MAIN

      INTEGER NN, NEQ, MXPARM
      PARAMETER (NN=161, NEQ=9, MXPARM=50)
      INTEGER kfinal, I
      INTEGER Norder, LDA, LDB, IPATH
      PARAMETER(Norder=3, LDA=3, LDB=3,IPATH=1)
      REAL*8 T, Y(NEQ)
      REAL*8 delt, tfinal
      REAL*8 mu00
      REAL*8 cell_length, Msolv, kv, ka, UA, densityc, densitys
      REAL*8 r0, alpha, g, kg, b, kb
      REAL*8 weight_mean_size, cov, mass_ratio
      REAL*8 moment0(NN), moment1(NN), moment2(NN)
      REAL*8 moment3(NN), moment4(NN)
      REAL*8 time (NN), concentration(NN), seed_moment1(NN)
      REAL*8 concentration_measured(NN)
      REAL*8 seed_moment2(NN), seed_moment3(NN), transmittance(NN)
      REAL*8 temperature(NN), relsatn(NN)
      REAL*8 Temp, Csat
      REAL*8 betatrans, betaconc
      REAL*8 variance_trans, variance_conc,random
      REAL*8 AA(3,3), BB(3), gamma(3), lmin, lmax
      REAL*8 mass_seed, mean_seed, width
      REAL real_time(NN), real_temperature(NN), real_concentration(NN)
      REAL real_moment0(NN), real_moment1(NN), real_moment2(NN)
      REAL real_moment3(NN), real_transmittance(NN), real_satn(NN)
      REAL noise_trans(NN-1), noise_conc(NN-1)


*lsodes' parameters
      
      INTEGER itol, iopt, itask, istate, mf
      INTEGER lrw, liw, iwork(1000)
      REAL*8  rtol, atol, rwork(5800)


      EXTERNAL FCN, FCNJ, DIVPAG,DRNNOR,DLSARG
      COMMON /GROWTH_DATA/kg, g
      COMMON /BIRTH_DATA/kb, b 
      COMMON /EXP_DATA/r0, alpha, mu00, UA, Msolv


      DO 111 I = 1, (NN-1)
         CALL DRNNOR(1,random)
	 noise_trans(I)=random
111   CONTINUE

      DO 112 I = 1, (NN-1)
         CALL DRNNOR(1,random)
	 noise_conc(I)=random
112   CONTINUE
      variance_trans=0.0D0
      variance_conc=0.0D0


*Simulation parameters
*     controller time step in minutes
      delt = 1.0D0
*     total time step
      kfinal=NN
*     final time in minutes
      tfinal = DFLOAT(NN)*delt
*     noise for transmittance measurement
      betatrans = 0.009D0
*     noise for concentration measurement
      betaconc = 0.0005D0

*Parameters for experimental set-up
*     cell length for spectrophotometer in millimeter
*     This was modified from that in Miller's thesis because
*     his value (2.0) did not agree with his simulation results
      cell_length=1.77D0
*     mass of solvent in grams, converted from 2000 gallons
      Msolv=7.57D6
*     volume shape factor (Appendix C in Miller)
      kv=1.0D0
*     area shape factor (Appendix C in Miller)
      ka=6.0D0
*     heat transfer coefficient multiplied by surface area
*     in calorie/minute/degree C 
*     density of solvent in g/cm^3 (solvent is water)
      densitys=1.0D0
*     density of crystal in g/cm^3 (Appendix C in Miller)
      densityc=2.11D0
*     seed size at nucleation
      r0=0.0D0
*     crystal density*volume shape factor,
*     in gram crystal/micron^3/particle
*     (alpha*L^3=mass of particle)
      alpha=kv*densityc*(1.0D-4)**3

*     Total mass of seed crystals (grams)	
      mass_seed = 230.0D0
*     Mean size of the seed crystals (microns)
      mean_seed = 196.0D0
*     Percent width of the initial seed distribution
      width = 6.12D0

*Growth and nucleation kinetic parameters (Table 4.6 in Miller)
*     (dimensionaless)
      g=1.32D0
*     (mirons/minute)
      kg=DEXP(8.849D0)
*     (dimensionless)
      b=1.78D0
*     (number of particles/cm^3/minute) 
*     (the units have been corrected from that reported in
*     Table 3.1 in Miller)
      kb=DEXP(17.142D0)


*Initial conditions
*     initial concentration, g/g solvent
      concentration(1) = 0.493D0
      concentration_measured(1)=concentration(1)
*
*       The initial moments were computed using the following
*       population density function:
*
*       f_0(L)= aL^2 + b*L + c
*
*	The distribution function is assumed to be symmetrical
*	with the peak at L_bar.  The function is equal to zero 
*	at L=L_bar-w/2 and L=L_bar+w/2, where w is the width 
*	paramter. In the program THETA_(Ntemp1+1) is the total
*	seed, THETA(Ntemp1+2) is L_bar, and THETA_T(Ntemp1+3)
*	is the width.  Given the total mass, L_bar, and width w, 
*	the coefficient a, b, and c can be calcuted from the
*	following system of equlations.  Let
*	
*	lmin = L_bar - w/2
*	lmax = L_bar + w/2
*	mass = total seed mass 
*
*	Then
*
*	(lmax^6-lmin^6)/6 a + (lmax^5-lmin^5)/5 b + (lmax^4-lmin^4)/4 c =
*	mass/(mass_solvent*crystal_density)
*
*	lmax^2 a + lmax b + c = 0
*	lmin^2 a + lmax b + c = 0
*
*	Note: In the implementation, the first equation is scaled.
*

      lmin = mean_seed-width*(1.0D-2)*mean_seed
      lmax = mean_seed+width*(1.0D-2)*mean_seed

      AA(1,1) = (lmax**6-lmin**6)/6.0D0/1.0D12 
      AA(1,2) = (lmax**5-lmin**5)/5.0D0/1.0D12
      AA(1,3) = (lmax**4-lmin**4)/4.0D0/1.0D12
      AA(2,1) = lmin**2
      AA(2,2) = lmin
      AA(2,3) = 1.0D0
      AA(3,1) = lmax**2
      AA(3,2) = lmax
      AA(3,3) = 1.0D0
      BB(1)=mass_seed/
     &		(Msolv*densityc)*(1.0D4)**3/1.0D12
      BB(2)=0.0D0
      BB(3)=0.0D0

      CALL DLSARG (Norder, AA, LDA, BB, IPATH, gamma)

*     initial zeroth moment, number of particle/g solvent
      mu00 = gamma(1)*(lmax**3-lmin**3)/3.0D0+
     &	     gamma(2)*(lmax**2-lmin**2)/2.0D0+
     &	     gamma(3)*(lmax-lmin)
      moment0(1)= mu00
*     initial first moment, micron/g solvent
      moment1(1) = gamma(1)*(lmax**4-lmin**4)/4.0D0+
     &		   gamma(2)*(lmax**3-lmin**3)/3.0D0+
     &	           gamma(3)*(lmax**2-lmin**2)/2.0D0
      seed_moment1(1)=moment1(1)
*     initia1 second moment, micron^2/g solvent
      moment2(1) = gamma(1)*(lmax**5-lmin**5)/5.0D0+
     &		   gamma(2)*(lmax**4-lmin**4)/4.0D0+
     &	           gamma(3)*(lmax**3-lmin**3)/3.0D0
      seed_moment2(1)=moment2(1)
*     initial third moment, micron^3/g solvent
      moment3(1) = gamma(1)*(lmax**6-lmin**6)/6.0D0+
     &		   gamma(2)*(lmax**5-lmin**5)/5.0D0+
     &	           gamma(3)*(lmax**4-lmin**4)/4.0D0
      seed_moment3(1)=moment3(1)
*	print*,moment3(1)*Msolv*densityc*(1.0e-12)
*	print*,THETA_T(Ntemp1+1)
*     initial fourth moment, micron^4/g solvent
      moment4(1) = gamma(1)*(lmax**7-lmin**7)/7.0D0+
     &		   gamma(2)*(lmax**6-lmin**6)/6.0D0+
     &	           gamma(3)*(lmax**5-lmin**5)/5.0D0


*     initial relative supersaturation
      relsatn(1)=(concentration(1)-Csat(Temp(0.0D0)))/
     &     Csat(Temp(0.0D0))
*     initial transmittance measurement
      transmittance(1)=DEXP(-ka/2D0*cell_length/10D0*moment2(1)*
     &     (densitys*(1D-4)**2))
  
      WRITE(58,1)g, DLOG(kg)
      WRITE(58,1)b, DLOG(kb)


*Simulation parameters
*********************************************************
*
      mf=222
      itask=1
      istate =1
      iopt=0
      lrw=3800
      liw=200
      rtol=1.0d-12
      atol=1.0d-10
      itol=1
******************************************************
*
      time(1)=0.0D0
      T=0.0D0       



      DO 1200 I=1,(NN-1)
	 temperature(I)=Temp(T)
         Y(1)=moment0(I)
         Y(2)=moment1(I)
         Y(3)=moment2(I)
         Y(4)=moment3(I)
         Y(5)=moment4(I)
         Y(6)=concentration(I)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -