From 0ce7b35a49981ea344b1569730a56783a4f24e40 Mon Sep 17 00:00:00 2001 From: ignis Date: Fri, 20 Apr 2018 02:05:49 +0900 Subject: [PATCH] skeleton code for diffusivity implementation --- Make/files | 2 + Make/options | 1 + createFields.H | 2 + diffusivityModel/diffusivityModel.C | 99 +++++++++++++++++++ diffusivityModel/diffusivityModel.H | 142 +++++++++++++++++++++++++++ diffusivityModel/diffusivityModelI.H | 58 +++++++++++ eReactingFoam.C | 2 + 7 files changed, 306 insertions(+) create mode 100644 diffusivityModel/diffusivityModel.C create mode 100644 diffusivityModel/diffusivityModel.H create mode 100644 diffusivityModel/diffusivityModelI.H diff --git a/Make/files b/Make/files index de06199..124d01c 100644 --- a/Make/files +++ b/Make/files @@ -1,3 +1,5 @@ +diffusivityModel/diffusivityModel.C + eReactingFoam.C EXE = $(FOAM_USER_APPBIN)/eReactingFoam diff --git a/Make/options b/Make/options index 6363f6d..54ba2e4 100644 --- a/Make/options +++ b/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -IdiffusivityModel \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ diff --git a/createFields.H b/createFields.H index da22c1a..47f2222 100644 --- a/createFields.H +++ b/createFields.H @@ -13,6 +13,8 @@ PtrList& Y = composition.Y(); word inertSpecie(thermo.lookup("inertSpecie")); +diffusivityModel diff(); + volScalarField rho ( IOobject diff --git a/diffusivityModel/diffusivityModel.C b/diffusivityModel/diffusivityModel.C new file mode 100644 index 0000000..2f0ebf4 --- /dev/null +++ b/diffusivityModel/diffusivityModel.C @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM 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 General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "diffusivityModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +// const dataType Foam::diffusivityModel::staticData(); + + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diffusivityModel::diffusivityModel() +: + data_() +{} + + +Foam::diffusivityModel::diffusivityModel(const scalar& data) +: + data_(data) +{} + + +Foam::diffusivityModel::diffusivityModel(const diffusivityModel&) +: + data_() +{} + + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::diffusivityModel::New() +{ + return autoPtr(new diffusivityModel); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::diffusivityModel::~diffusivityModel() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // + +void Foam::diffusivityModel::operator=(const diffusivityModel& rhs) +{ + // Check for assignment to self + if (this == &rhs) + { + FatalErrorInFunction + << "Attempted assignment to self" + << abort(FatalError); + } +} + +// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * // + + +// ************************************************************************* // diff --git a/diffusivityModel/diffusivityModel.H b/diffusivityModel/diffusivityModel.H new file mode 100644 index 0000000..67f9d95 --- /dev/null +++ b/diffusivityModel/diffusivityModel.H @@ -0,0 +1,142 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM 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 General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::diffusivityModel + +Description + +SourceFiles + diffusivityModelI.H + diffusivityModel.C + diffusivityModelIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef diffusivityModel_H +#define diffusivityModel_H + +#include "scalar.H" +#include "autoPtr.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes + +// Forward declaration of friend functions and operators +class diffusivityModel; + + +/*---------------------------------------------------------------------------*\ + Class diffusivityModel Declaration +\*---------------------------------------------------------------------------*/ + +class diffusivityModel +{ + // Private data + + //- Description of data_ + scalar data_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + diffusivityModel(const diffusivityModel&); + + //- Disallow default bitwise assignment + void operator=(const diffusivityModel&); + + +public: + + // Static data members + + //- Static data staticData + // static const dataType staticData; + + + // Constructors + + //- Construct null + diffusivityModel(); + + //- Construct from components + diffusivityModel(const scalar& data); + + //- Construct from Istream + diffusivityModel(Istream&); + + //- Construct as copy + // diffusivityModel(const diffusivityModel&); + + + // Selectors + + //- Select null constructed + static autoPtr New(); + + + //- Destructor + ~diffusivityModel(); + + + // Member Functions + + // Access + + // Check + + // Edit + + // Write + + + // Member Operators + + // void operator=(const diffusivityModel&); + + + // Friend Functions + + // Friend Operators + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "diffusivityModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/diffusivityModel/diffusivityModelI.H b/diffusivityModel/diffusivityModelI.H new file mode 100644 index 0000000..eca8d9e --- /dev/null +++ b/diffusivityModel/diffusivityModelI.H @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM 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 General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +// ************************************************************************* // diff --git a/eReactingFoam.C b/eReactingFoam.C index efcc5eb..70f506f 100644 --- a/eReactingFoam.C +++ b/eReactingFoam.C @@ -38,6 +38,8 @@ Description #include "localEulerDdtScheme.H" #include "fvcSmooth.H" +#include "diffusivityModel.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[])