From 92c9d54cdb780f59162b22f95a4a76333cb718a1 Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Mon, 13 Dec 2004 18:42:32 +0000 Subject: [PATCH] *** empty log message *** --- Cantera/clib/src/clib_defs.h | 1 + Cantera/clib/src/ct.cpp | 2 +- Cantera/cxx/demos/flamespeed.cpp | 409 +++++++++++++++--------------- Cantera/matlab/cantera/buildwin.m | 10 +- Cantera/python/winsetup.py | 2 +- Cantera/src/Constituents.cpp | 2 +- Cantera/src/MultiPhase.h | 2 +- Cantera/src/StoichManager.h | 2 +- Cantera/src/ct_defs.h | 1 + Cantera/src/oneD/StFlow.cpp | 1 + License.rtf | 64 +++-- 11 files changed, 251 insertions(+), 245 deletions(-) diff --git a/Cantera/clib/src/clib_defs.h b/Cantera/clib/src/clib_defs.h index 7d050cf99..a461c24ca 100755 --- a/Cantera/clib/src/clib_defs.h +++ b/Cantera/clib/src/clib_defs.h @@ -6,6 +6,7 @@ #define DLL_IMPORT __declspec(dllimport) #define DLL_EXPORT __declspec(dllexport) #pragma warning(disable:4786) +#pragma warning(disable:4267) #pragma warning(disable:4503) #else #define DLL_EXPORT diff --git a/Cantera/clib/src/ct.cpp b/Cantera/clib/src/ct.cpp index 38e605232..2d6be6712 100755 --- a/Cantera/clib/src/ct.cpp +++ b/Cantera/clib/src/ct.cpp @@ -978,7 +978,7 @@ extern "C" { int DLL_EXPORT showCanteraErrors() { showErrors(); - return 0; + return 0; } int DLL_EXPORT addCanteraDirectory(int buflen, char* buf) { diff --git a/Cantera/cxx/demos/flamespeed.cpp b/Cantera/cxx/demos/flamespeed.cpp index d99682a90..6fa1d4a50 100644 --- a/Cantera/cxx/demos/flamespeed.cpp +++ b/Cantera/cxx/demos/flamespeed.cpp @@ -1,214 +1,219 @@ +// #ifdef WIN32 #pragma warning(disable:4786) /*Warning messages that are identified as Warning C4786: are created -when MSVC generates extremely long names that it uses for debugging -purposes. The long names are generated by the template expansion -process and the warning messages normally can be ignored. Since these -warnings tend to hide more interesting warning/error messages, you may -wish to suppress the warning*/ + when MSVC generates extremely long names that it uses for debugging + purposes. The long names are generated by the template expansion + process and the warning messages normally can be ignored. Since these + warnings tend to hide more interesting warning/error messages, you may + wish to suppress the warning*/ + +// precompiled headers +#include "stdafx.h" + #endif -#include -#include -#include -#include -#include -// include additional header files here if needed -#ifdef WIN32 -#include -#endif +void demo() { + try { + int i; + IdealGasMix gas("gri30.cti","gri30_mix"); + + doublereal temp = 300.0; // K + doublereal pressure = 1.0*OneAtm; //atm + doublereal uin=0.3; //m/sec + + gas.setState_TPX(temp, pressure, "CH4:1.0, O2:2.0, N2:7.52"); + int nsp = gas.nSpecies(); + + vector_fp x; + x.resize(nsp); + + doublereal phi=1.1; + cout << "Enter phi: "; + cin >> phi; + cout << endl; + + doublereal C_atoms=1.0; + doublereal H_atoms=4.0; + doublereal ax=C_atoms+H_atoms/4.0; + doublereal fa_stoic=1.0/(4.76*ax); + for(int k=0;k> phi; - cout << endl; - - doublereal C_atoms=1.0; - doublereal H_atoms=4.0; - doublereal ax=C_atoms+H_atoms/4.0; - doublereal fa_stoic=1.0/(4.76*ax); - for(int k=0;k yin; - double *yin=new double[nsp]; - gas.getMassFractions(yin); - - try { - equilibrate(gas,HP); - } - catch (CanteraError) { - showErrors(cout); - } - double *yout=new double[nsp]; - gas.getMassFractions(yout); - doublereal rho_out = gas.density(); - doublereal Tad=gas.temperature(); - cout << phi<<' '< domains; - domains.push_back(&inlet); - domains.push_back(&flow); - domains.push_back(&outlet); - - OneDim flamesim(domains); - - Sim1D flame(domains); - - //----------- Supply initial guess---------------------- - - vector_fp locs; - vector_fp value; - - locs.resize(3); - value.resize(3); - - //ramp values from inlet to adiabatic flame conditions - // over 70% of domain and then level off at equilibrium - double z1=0.7; - - double uout; - uout=inlet.mdot()/rho_out; - uin=inlet.mdot()/rho_in; - locs[0]=0.0; locs[1]=z1; locs[2]=1.0; - value[0]=uin; value[1]=uout; value[2]=uout; - flame.setInitialGuess("u",locs,value); - - value[0]=temp; value[1]=Tad; value[2]=Tad; - flame.setInitialGuess("T",locs,value); - - for(i=0;i zvec,Tvec,COvec,CO2vec,Uvec; - - printf("\n%9s\t%8s\t%5s\t%7s\n","z (m)", "T (K)", "U (m/s)", "Y(CO)"); - for(int n=0;n domains; + domains.push_back(&inlet); + domains.push_back(&flow); + domains.push_back(&outlet); + + OneDim flamesim(domains); + + Sim1D flame(domains); + + //----------- Supply initial guess---------------------- + + vector_fp locs; + vector_fp value; + + locs.resize(3); + value.resize(3); + + //ramp values from inlet to adiabatic flame conditions + // over 70% of domain and then level off at equilibrium + double z1=0.7; + + double uout; + uout=inlet.mdot()/rho_out; + uin=inlet.mdot()/rho_in; + locs[0]=0.0; locs[1]=z1; locs[2]=1.0; + value[0]=uin; value[1]=uout; value[2]=uout; + flame.setInitialGuess("u",locs,value); + + value[0]=temp; value[1]=Tad; value[2]=Tad; + flame.setInitialGuess("T",locs,value); + + for(i=0;i zvec,Tvec,COvec,CO2vec,Uvec; + + printf("\n%9s\t%8s\t%5s\t%7s\n","z (m)", "T (K)", "U (m/s)", "Y(CO)"); + for(int n=0;nsetState_TPX(m_temp, // m_press, m_moleFractions.begin() + m_spstart[n]); // return *m_phase[n]; diff --git a/Cantera/src/StoichManager.h b/Cantera/src/StoichManager.h index 02c95aeb4..9d3ea927d 100755 --- a/Cantera/src/StoichManager.h +++ b/Cantera/src/StoichManager.h @@ -463,7 +463,7 @@ namespace Cantera { * a power law expression involving the species vector. */ void add(int rxn, const vector_int& k, const vector_fp& order) { - m_n[rxn] = k.size(); + m_n[rxn] = static_cast(k.size()); switch (k.size()) { case 1: m_loc[rxn] = static_cast(m_c1_list.size()); diff --git a/Cantera/src/ct_defs.h b/Cantera/src/ct_defs.h index d75dbc455..d3a81f336 100755 --- a/Cantera/src/ct_defs.h +++ b/Cantera/src/ct_defs.h @@ -35,6 +35,7 @@ using namespace ct; #ifdef WIN32 #define TYPENAME_KEYWORD +#pragma warning(disable:4267) #else #define TYPENAME_KEYWORD typename #endif diff --git a/Cantera/src/oneD/StFlow.cpp b/Cantera/src/oneD/StFlow.cpp index 77c36bfeb..34291ac12 100644 --- a/Cantera/src/oneD/StFlow.cpp +++ b/Cantera/src/oneD/StFlow.cpp @@ -15,6 +15,7 @@ #ifdef WIN32 #pragma warning(disable:4786) #pragma warning(disable:4503) +#pragma warning(disable:4267) #endif #include diff --git a/License.rtf b/License.rtf index cbba774a7..d8b3bc01a 100755 --- a/License.rtf +++ b/License.rtf @@ -1,33 +1,31 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\froman\fcharset77 TimesNewRomanPSMT;\f1\ftech\fcharset2 Symbol;\f2\fmodern\fcharset77 CourierNewPSMT; -} -{\colortbl;\red255\green255\blue255;} -\margl1318\margr1318\vieww11740\viewh9860\viewkind1\viewscale100 -\deftab720 -\pard\pardeftab720\ri2340\sb100\sa100\qj - -\f0\fs26 \cf0 \ -\pard\pardeftab720\ri2340\sb100\sa100\ql\qnatural -\cf0 Copyright (c) 2001-2004, California Institute of Technology\uc0\u8232 All rights reserved.\ -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\ -\pard\pardeftab720\ri2340\ql\qnatural - -\f1\fs22 \cf0 \ -\'b7 -\f0\fs26 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. \ - -\f1\fs22 \ -\'b7 -\f0\fs26 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. \ - -\f1\fs22 \ -\'b7 -\f0\fs26 Neither the name of the California Institute of Technology nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. \ -\pard\pardeftab720\ri2340\sb100\sa100\ql\qnatural -\cf0 \ -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\ -\pard\pardeftab720\ri2340\ql\qnatural - -\f2\fs22 \cf0 \ -\ -} \ No newline at end of file +{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f90\froman\fcharset238\fprq2 Times New Roman CE;} +{\f91\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f93\froman\fcharset161\fprq2 Times New Roman Greek;}{\f94\froman\fcharset162\fprq2 Times New Roman Tur;}{\f95\froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\f96\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f97\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f98\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255; +\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0; +\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive \ssemihidden +Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv +\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid602915\rsid8664322} +{\*\generator Microsoft Word 11.0.5604;}{\info{\title Copyright (c) 2001-2004, California Institute of Technology}{\author Dave Goodwin}{\operator Dave Goodwin}{\creatim\yr2004\mo12\dy12\hr16\min15}{\revtim\yr2004\mo12\dy12\hr16\min15}{\version2} +{\edmins3}{\nofpages1}{\nofwords228}{\nofchars1300}{\*\company Caltech}{\nofcharsws1525}{\vern24689}}\margl1318\margr1318 \widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120 +\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\nolnhtadjtbl\rsidroot8664322 \fet0\sectd \linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2 +\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6 +\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid602915 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid8664322\charrsid602915 +\par }{\insrsid2033138\charrsid602915 Copyright (c) 2001-2004, California Institute of Technology}{\insrsid602915 . }{\insrsid2033138\charrsid602915 All rights reserved.}{\insrsid2033138 +\par }{\insrsid602915\charrsid602915 +\par }{\insrsid2033138\charrsid602915 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +\par +\par \u-4064\'3fRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +\par +\par Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +\par +\par \u-4064\'3fNeither the name of the California Institute of Technology nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +\par +\par THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, D +A +TA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBIL +ITY OF SUCH DAMAGE. +\par +\par +\par }} \ No newline at end of file