-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from dmcdougall/nick_examples_dir
Adding examples directory
- Loading branch information
Showing
5 changed files
with
153 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Paul T. Bauman ([email protected]) | ||
Paul T. Bauman ([email protected]) | ||
Benjamin S. Kirk ([email protected]) | ||
Todd A. Oliver ([email protected]) | ||
Sylvain Plessis ([email protected]) | ||
Roy H. Stogner ([email protected]) | ||
Todd A. Oliver ([email protected]) | ||
Sylvain Plessis ([email protected]) | ||
Roy H. Stogner ([email protected]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
EXTRA_DIST = | ||
|
||
examplesdir = $(top_srcdir)/examples | ||
|
||
examples_PROGRAMS = | ||
examples_PROGRAMS += antioch_init | ||
|
||
AM_CPPFLAGS = | ||
AM_CPPFLAGS += -I$(top_srcdir)/src/core/include | ||
AM_CPPFLAGS += -I$(top_srcdir)/src/units/include | ||
AM_CPPFLAGS += -I$(top_srcdir)/src/particles_flux/include | ||
AM_CPPFLAGS += -I$(top_srcdir)/src/kinetics/include | ||
AM_CPPFLAGS += -I$(top_srcdir)/src/parsing/include | ||
AM_CPPFLAGS += -I$(top_srcdir)/src/thermo/include | ||
AM_CPPFLAGS += -I$(top_srcdir)/src/viscosity/include | ||
AM_CPPFLAGS += -I$(top_srcdir)/src/diffusion/include | ||
AM_CPPFLAGS += -I$(top_srcdir)/src/thermal_conduction/include | ||
AM_CPPFLAGS += -I$(top_srcdir)/src/transport/include | ||
AM_CPPFLAGS += -I$(top_srcdir)/src/utilities/include | ||
AM_CPPFLAGS += -I$(top_builddir)/src/utilities/include | ||
AM_CPPFLAGS += -I$(top_srcdir)/examples/antioch_test | ||
AM_CPPFLAGS += $(antioch_optional_test_INCLUDES) | ||
|
||
AM_LDFLAGS = $(antioch_optional_test_LDFLAGS) | ||
|
||
LIBS = $(antioch_optional_test_LIBS) | ||
|
||
LDADD = $(top_builddir)/src/libantioch.la | ||
|
||
pkginclude_HEADERS = | ||
|
||
# | ||
# CPP TESTS | ||
# | ||
antioch_init_SOURCES = antioch_init.C | ||
|
||
#Define examples to actually be run | ||
TESTS = | ||
XFAIL_TESTS = | ||
TESTS += antioch_init | ||
|
||
CLEANFILES = | ||
if CODE_COVERAGE_ENABLED | ||
CLEANFILES += *.gcda *.gcno | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
//-----------------------------------------------------------------------bl- | ||
//-------------------------------------------------------------------------- | ||
// | ||
// Antioch - A Gas Dynamics Thermochemistry Library | ||
// | ||
// Copyright (C) 2014-2016 Paul T. Bauman, Benjamin S. Kirk, | ||
// Sylvain Plessis, Roy H. Stonger | ||
// | ||
// Copyright (C) 2013 The PECOS Development Team | ||
// | ||
// This library is free software; you can redistribute it and/or | ||
// modify it under the terms of the Version 2.1 GNU Lesser General | ||
// Public License as published by the Free Software Foundation. | ||
// | ||
// This library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
// Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public | ||
// License along with this library; if not, write to the Free Software | ||
// Foundation, Inc. 51 Franklin Street, Fifth Floor, | ||
// Boston, MA 02110-1301 USA | ||
// | ||
//-----------------------------------------------------------------------el- | ||
// | ||
// $Id$ | ||
// | ||
//-------------------------------------------------------------------------- | ||
//-------------------------------------------------------------------------- | ||
|
||
// C++ | ||
#include <iostream> | ||
#include <cmath> | ||
|
||
// Antioch | ||
#include "antioch/blottner_viscosity.h" | ||
|
||
template <typename Scalar> | ||
int test_viscosity( const Scalar mu, const Scalar mu_exact, const Scalar tol ) | ||
{ | ||
using std::abs; | ||
|
||
int return_flag = 0; | ||
|
||
const double rel_error = abs( (mu - mu_exact)/mu_exact); | ||
|
||
if( rel_error > tol ) | ||
{ | ||
std::cerr << "Error: Mismatch in viscosity" << std::endl | ||
<< "mu(T) = " << mu << std::endl | ||
<< "mu_exact = " << mu_exact << std::endl | ||
<< "rel_error = " << rel_error << std::endl | ||
<< "tol = " << tol << std::endl; | ||
return_flag = 1; | ||
} | ||
|
||
return return_flag; | ||
} | ||
|
||
template <typename Scalar> | ||
int tester() | ||
{ | ||
const Scalar a = 3.14e-3; | ||
const Scalar b = 2.71e-2; | ||
const Scalar c = 42.0e-5; | ||
|
||
Antioch::BlottnerViscosity<Scalar> mu(a,b,c); | ||
|
||
std::cout << mu << std::endl; | ||
|
||
const Scalar T = 1521.2; | ||
|
||
// octave gives | ||
const Scalar mu_exact = 0.144422234167703; | ||
|
||
int return_flag = 0; | ||
|
||
const Scalar tol = 1.0e-14; | ||
|
||
return_flag = test_viscosity( mu(T), mu_exact, tol ); | ||
|
||
const Scalar a2 = 1e-3; | ||
const Scalar b2 = 2e-2; | ||
const Scalar c2 = 3e-5; | ||
|
||
mu.reset_coeffs( a2, b2, c2 ); | ||
|
||
// octave gives | ||
const Scalar mu_exact2 = 0.122172495548880; | ||
|
||
return_flag = test_viscosity( mu(T), mu_exact2, tol ); | ||
|
||
return return_flag; | ||
} | ||
|
||
int main() | ||
{ | ||
return (tester<double>() || | ||
tester<long double>() || | ||
tester<float>()); | ||
} |