*** empty log message ***

This commit is contained in:
Dave Goodwin 2007-11-06 21:12:04 +00:00
parent 0a5c4cdc04
commit 9c8bd9a6a5
4 changed files with 1266 additions and 6 deletions

View file

@ -55,16 +55,18 @@ AxiStagnBVP::AxiStagnBVP(int nsp, int np, double L) :
// destructor
AxiStagnBVP::~AxiStagnBVP() {}
// specify guesses for the initial values. These can be anything
// that leads to a converged solution.
doublereal initialValue(int n, int j) {
doublereal AxiStagnBVP::initialValue(int n, int j) {
switch (n) {
case 0:
return m_u0;
return m_uin;
case 1:
return m_u0/m_L;
return m_uin/m_L;
case 2:
return m_Tinf;
return m_Tin;
case 4:
return 1.0;
default:
@ -72,6 +74,34 @@ doublereal initialValue(int n, int j) {
}
}
/**
* Set the gas object state to be consistent with the solution at
* point j.
*/
void AxiStagnBVP::setGas(const doublereal* x,int j) {
m_thermo->setTemperature(T(x,j));
const doublereal* yy = x + m_nv*j + 4;
m_thermo->setMassFractions_NoNorm(yy);
m_thermo->setPressure(m_press);
}
/**
* Set the gas state to be consistent with the solution at the
* midpoint between j and j + 1.
*/
void StFlow::setGasAtMidpoint(const doublereal* x,int j) {
m_thermo->setTemperature(0.5*(T(x,j)+T(x,j+1)));
const doublereal* yyj = x + m_nv*j + 4;
const doublereal* yyjp = x + m_nv*(j+1) + 4;
for (int k = 0; k < m_nsp; k++)
m_ybar[k] = 0.5*(yyj[k] + yyjp[k]);
m_thermo->setMassFractions_NoNorm(DATA_PTR(m_ybar));
m_thermo->setPressure(m_press);
}
// Specify the residual. This is where the ODE system and boundary
// conditions are specified. The solver will attempt to find a solution
// x so that this function returns 0 for all n and j.

View file

@ -62,12 +62,13 @@ public:
// destructor
virtual ~AxiStagnBVP() {}
// specify guesses for the initial values. These can be anything
// that leads to a converged solution.
virtual doublereal initialValue(int n, int j) {
doublereal AxiStagnBVP::initialValue(int n, int j) {
switch (n) {
case 0:
return 0.1*z(j);
return m;
case 1:
return 0.5*z(j);
default:

86
apps/bvp/blasius.mak Normal file
View file

@ -0,0 +1,86 @@
#!/bin/sh
# This Makefile builds a C++ application that uses Cantera. By
# default, the main program file is 'demo.cpp,' which prints out some
# properties of a reacting gas mixture.
# To build program 'demo', simply type 'make', or 'make -f <this
# file>' if this file is named something other than 'Makefile.'
# Once you have verified that the demo runs, edit this file to replace
# object file 'demo.o' with your own object file or files.
#------------------------ edit this block ---------------------------------
# the name of the executable program to be created
PROG_NAME = blasius.x
# the object files to be linked together.
OBJS = blasius.o
# additional flags to be passed to the linker. If your program
# requires other external libraries, put them here
LINK_OPTIONS = -fPIC -L/usr/local/lib -framework Accelerate
#---------------------------------------------------------------------------
# You probably don't need to edit anything below.
# the C++ compiler
CXX = g++
# C++ compile flags
CXX_FLAGS = -O3 -Wall -fPIC
# external libraries
EXT_LIBS = -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -lctnumerics -lcvode -lctbase -lctmath -ltpx -lctf2c -lconverters -lctcxx
# Ending C++ linking libraries
LCXX_END_LIBS = -lm
# the directory where the Cantera libraries are located
CANTERA_LIBDIR=/Applications/Cantera/lib
# the directory where Cantera include files may be found.
CANTERA_INCDIR=/Applications/Cantera/include
# flags passed to the C++ compiler/linker for the linking step
LCXXFLAGS = -L$(CANTERA_LIBDIR) -O3 -Wall -fPIC
# how to compile C++ source files to object files
.cpp.o:
$(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS)
PROGRAM = $(PROG_NAME)$(EXE_EXT)
DEPENDS = $(OBJS:.o=.d)
all: $(PROGRAM)
$(PROGRAM): $(OBJS)
$(CXX) -o $(PROGRAM) $(OBJS) $(LCXXFLAGS)\
$(CANTERA_LIBS) $(LINK_OPTIONS) $(EXT_LIBS) \
$(LCXX_END_LIBS)
%.d:
g++ -MM -I$(CANTERA_INCDIR) $*.cpp > $*.d
clean:
$(RM) $(OBJS) $(PROGRAM)
depends: $(DEPENDS)
cat *.d > .depends
$(RM) $(DEPENDS)
TAGS:
etags *.h *.cpp
ifeq ($(wildcard .depends), .depends)
include .depends
endif

1143
apps/bvp/stagnation.cpp Normal file

File diff suppressed because it is too large Load diff