Commit 0505dbee authored by Andrew Heather's avatar Andrew Heather
Browse files

tidy-up and added CaCO3 - put solids in their own namespace?

parent 0e2b526c
......@@ -268,7 +268,7 @@ void Foam::KinematicParcel<ParcelType>::transformProperties
}
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "KinematicParcelIO.C"
......
......@@ -385,7 +385,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
}
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ReactingMultiphaseParcelIO.C"
......
......@@ -236,7 +236,7 @@ Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange
}
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ReactingParcelIO.C"
......
......@@ -174,7 +174,7 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
}
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ThermoParcelIO.C"
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "C.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(C, 0);
addToRunTimeSelectionTable(solid, C,);
addToRunTimeSelectionTable(solid, C, Istream);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::C::C()
:
solid(2010, 710, 0.04, 0.0, 1.0)
{
WarningIn("C::C()")
<< "Properties of graphite need to be checked!!!"
<< endl;
}
Foam::C::C(const solid& s)
:
solid(s)
{}
Foam::C::C(Istream& is)
:
solid(is)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::C::writeData(Ostream& os) const
{
solid::writeData(os);
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
Foam::Ostream& operator<<(Ostream& os, const C& s)
{
s.writeData(os);
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::C
Description
Graphite
SourceFiles
C.C
\*---------------------------------------------------------------------------*/
#ifndef solid_C_H
#define solid_C_H
#include "solid.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class C;
Ostream& operator<<
(
Ostream&,
const C&
);
/*---------------------------------------------------------------------------*\
Class C Declaration
\*---------------------------------------------------------------------------*/
class C
:
public solid
{
public:
//- Runtime type information
TypeName("C");
// Constructors
//- Construct null
C();
//- Construct from solid
C(const solid& s);
//- Construct from Istream
C(Istream& is);
// I-O
//- Write the function coefficients
void writeData(Ostream& os) const;
//- Ostream Operator
friend Ostream& operator<<(Ostream& os, const C& s);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "CaCO3.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(CaCO3, 0);
addToRunTimeSelectionTable(solid, CaCO3,);
addToRunTimeSelectionTable(solid, CaCO3, Istream);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::CaCO3::CaCO3()
:
solid(2710, 850, 1.3, 0.0, 1.0)
{
WarningIn("CaCO3::CaCO3()")
<< "Properties of CaCO3 need to be checked!!!"
<< endl;
}
Foam::CaCO3::CaCO3(const solid& s)
:
solid(s)
{}
Foam::CaCO3::CaCO3(Istream& is)
:
solid(is)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::CaCO3::writeData(Ostream& os) const
{
solid::writeData(os);
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
Foam::Ostream& operator<<(Ostream& os, const CaCO3& s)
{
s.writeData(os);
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
......@@ -23,18 +23,18 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::Cs
Foam::CaCO3
Description
Graphite
Calcium carbonate (limestone)
SourceFiles
Cs.C
CaCO3.C
\*---------------------------------------------------------------------------*/
#ifndef solid_Cs_H
#define solid_Cs_H
#ifndef solid_CaCO3_H
#define solid_CaCO3_H
#include "solid.H"
......@@ -43,11 +43,20 @@ SourceFiles
namespace Foam
{
class CaCO3;
Ostream& operator<<
(
Ostream&,
const CaCO3&
);
/*---------------------------------------------------------------------------*\
Class Cs Declaration
Class CaCO3 Declaration
\*---------------------------------------------------------------------------*/
class Cs
class CaCO3
:
public solid
{
......@@ -55,50 +64,30 @@ class Cs
public:
//- Runtime type information
TypeName("Cs");
TypeName("CaCO3");
// Constructors
//- Construct null
Cs()
:
solid(2010, 710, 0.04, 0.0, 1.0)
{
WarningIn("Cs::Cs()")
<< "Properties of graphite need to be checked!!!"
<< endl;
}
CaCO3();
//- Construct from solid
Cs
(
const solid& s
)
:
solid(s)
{}
CaCO3(const solid& s);
//- Construct from Istream
Cs(Istream& is)
:
solid(is)
{}
CaCO3(Istream& is);
// I-O
//- Write the function coefficients
void writeData(Ostream& os) const
{
solid::writeData(os);
}
void writeData(Ostream& os) const;
// Ostream Operator
friend Ostream& operator<<(Ostream& os, const Cs& s)
{
s.writeData(os);
return os;
}
friend Ostream& operator<<(Ostream& os, const CaCO3& s);
};
......
solid/solid.C
solid/newSolid.C
ash/ash.C
Cs/Cs.C
C/C.C
CaCO3/CaCO3.C
LIB = $(FOAM_LIBBIN)/libsolids
......@@ -38,6 +38,47 @@ defineTypeNameAndDebug(ash, 0);
addToRunTimeSelectionTable(solid, ash,);
addToRunTimeSelectionTable(solid, ash, Istream);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ash::ash()
:
solid(2010, 710, 0.04, 0.0, 1.0)
{
WarningIn("ash::ash()")
<< "Properties of ash need to be checked!!!"
<< endl;
}
Foam::ash::ash(const solid& s)
:
solid(s)
{}
Foam::ash::ash(Istream& is)
:
solid(is)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::ash::writeData(Ostream& os) const
{
solid::writeData(os);
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
Foam::Ostream& operator<<(Ostream& os, const ash& s)
{
s.writeData(os);
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
......
......@@ -43,6 +43,15 @@ SourceFiles
namespace Foam
{
class ash;
Ostream& operator<<
(
Ostream&,
const ash&
);
/*---------------------------------------------------------------------------*\
Class ash Declaration
\*---------------------------------------------------------------------------*/
......@@ -61,45 +70,24 @@ public:
// Constructors
//- Construct null
ash()
:
// rho Cp K Hf e
// [kg/m3] [J/(kg.K)] [W/(m.K)] [J/kg] [-]
solid(2010, 710, 0.04, 0.0, 1.0) // TODO
{
WarningIn("ash::ash()")
<< "Properties of ash need to be checked!!!"
<< endl;
}
ash
(
const solid& s
)
:
solid(s)
{}
ash();
//- Construct from solid
ash(const solid& s);
//- Construct from Istream
ash(Istream& is)
:
solid(is)
{}
ash(Istream& is);
// I-O
//- Write the function coefficients
void writeData(Ostream& os) const
{
solid::writeData(os);
}
void writeData(Ostream& os) const;
// Ostream Operator
friend Ostream& operator<<(Ostream& os, const ash& s)
{
s.writeData(os);
return os;
}
friend Ostream& operator<<(Ostream& os, const ash& s);
};
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "solid.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::solid> Foam::solid::New(Istream& is)
{
if (debug)
{
Info<< "solid::New(Istream&): "
<< "constructing solid"
<< endl;
}
word solidType(is);
word coeffs(is);
if (coeffs == "defaultCoeffs")
{
ConstructorTable::iterator cstrIter =
ConstructorTablePtr_->find(solidType);
if (cstrIter == ConstructorTablePtr_->end())
{
FatalErrorIn("solid::New(Istream&)")
<< "Unknown solid type " << solidType << nl << nl
<< "Valid solid types are:" << endl
<< ConstructorTablePtr_->toc()
<< exit(FatalError);
}
return autoPtr<solid>(cstrIter()());
}
else if (coeffs == "coeffs")
{
IstreamConstructorTable::iterator cstrIter =
IstreamConstructorTablePtr_->find(solidType);
if (cstrIter == IstreamConstructorTablePtr_->end())
{
FatalErrorIn("solid::New(Istream&)")
<< "Unknown solid type " << solidType << nl << nl
<< "Valid solid types are:" << endl
<< IstreamConstructorTablePtr_->toc()