mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
adding les/ras cavitating solvers and barotropicCompressibilityModel library
This commit is contained in:
@ -1,8 +1,3 @@
|
||||
cavitatingFoam.C
|
||||
compressibilityModels/compressibilityModel/compressibilityModel.C
|
||||
compressibilityModels/compressibilityModel/newCompressibilityModel.C
|
||||
compressibilityModels/linear/linear.C
|
||||
compressibilityModels/Wallis/Wallis.C
|
||||
compressibilityModels/Chung/Chung.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/cavitatingFoam
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-IcompressibilityModels/compressibilityModel
|
||||
-I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lbarotropicCompressibilityModel
|
||||
|
||||
@ -30,7 +30,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "compressibilityModel.H"
|
||||
#include "barotropicCompressibilityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -1,95 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "Chung.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
defineTypeNameAndDebug(Chung, 0);
|
||||
addToRunTimeSelectionTable(compressibilityModel, Chung, dictionary);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModels::Chung::Chung
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityModel(compressibilityProperties, gamma),
|
||||
psiv_(compressibilityProperties_.lookup("psiv")),
|
||||
psil_(compressibilityProperties_.lookup("psil")),
|
||||
rhovSat_(compressibilityProperties_.lookup("rhovSat")),
|
||||
rholSat_(compressibilityProperties_.lookup("rholSat"))
|
||||
{
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::compressibilityModels::Chung::correct()
|
||||
{
|
||||
volScalarField sfa = sqrt
|
||||
(
|
||||
(rhovSat_/psiv_)
|
||||
/((scalar(1) - gamma_)*rhovSat_/psiv_ + gamma_*rholSat_/psil_)
|
||||
);
|
||||
|
||||
psi_ = sqr
|
||||
(
|
||||
((scalar(1) - gamma_)/sqrt(psiv_) + gamma_*sfa/sqrt(psil_))
|
||||
*sqrt(psiv_*psil_)/sfa
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::compressibilityModels::Chung::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityModel::read(compressibilityProperties);
|
||||
|
||||
compressibilityProperties_.lookup("psiv") >> psiv_;
|
||||
compressibilityProperties_.lookup("psil") >> psil_;
|
||||
compressibilityProperties_.lookup("rhovSat") >> rhovSat_;
|
||||
compressibilityProperties_.lookup("rholSat") >> rholSat_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,107 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModels::Chung
|
||||
|
||||
Description
|
||||
Chung compressibility model.
|
||||
|
||||
SourceFiles
|
||||
Chung.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Chung_H
|
||||
#define Chung_H
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
#include "dimensionedScalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Chung Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Chung
|
||||
:
|
||||
public compressibilityModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar psiv_;
|
||||
dimensionedScalar psil_;
|
||||
|
||||
dimensionedScalar rhovSat_;
|
||||
dimensionedScalar rholSat_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Chung");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
Chung
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~Chung()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the Chung compressibility
|
||||
void correct();
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& compressibilityProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace compressibilityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,86 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "Wallis.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
defineTypeNameAndDebug(Wallis, 0);
|
||||
addToRunTimeSelectionTable(compressibilityModel, Wallis, dictionary);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModels::Wallis::Wallis
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityModel(compressibilityProperties, gamma),
|
||||
psiv_(compressibilityProperties_.lookup("psiv")),
|
||||
psil_(compressibilityProperties_.lookup("psil")),
|
||||
rhovSat_(compressibilityProperties_.lookup("rhovSat")),
|
||||
rholSat_(compressibilityProperties_.lookup("rholSat"))
|
||||
{
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::compressibilityModels::Wallis::correct()
|
||||
{
|
||||
psi_ = (gamma_*rhovSat_ + (scalar(1) - gamma_)*rholSat_)
|
||||
*(gamma_*psiv_/rhovSat_ + (scalar(1) - gamma_)*psil_/rholSat_);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::compressibilityModels::Wallis::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityModel::read(compressibilityProperties);
|
||||
|
||||
compressibilityProperties_.lookup("psiv") >> psiv_;
|
||||
compressibilityProperties_.lookup("psil") >> psil_;
|
||||
compressibilityProperties_.lookup("rhovSat") >> rhovSat_;
|
||||
compressibilityProperties_.lookup("rholSat") >> rholSat_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,107 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModels::Wallis
|
||||
|
||||
Description
|
||||
Wallis compressibility model.
|
||||
|
||||
SourceFiles
|
||||
Wallis.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Wallis_H
|
||||
#define Wallis_H
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
#include "dimensionedScalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Wallis Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Wallis
|
||||
:
|
||||
public compressibilityModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar psiv_;
|
||||
dimensionedScalar psil_;
|
||||
|
||||
dimensionedScalar rhovSat_;
|
||||
dimensionedScalar rholSat_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Wallis");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
Wallis
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~Wallis()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the Wallis compressibility
|
||||
void correct();
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& compressibilityProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace compressibilityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,77 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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
|
||||
|
||||
InClass
|
||||
compressibilityModel
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(compressibilityModel, 0);
|
||||
defineRunTimeSelectionTable(compressibilityModel, dictionary);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModel::compressibilityModel
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityProperties_(compressibilityProperties),
|
||||
psi_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"psi",
|
||||
gamma.mesh().time().timeName(),
|
||||
gamma.mesh()
|
||||
),
|
||||
gamma.mesh(),
|
||||
dimensionedScalar("psi", dimensionSet(0, -2, 2, 0, 0), 0)
|
||||
),
|
||||
gamma_(gamma)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::compressibilityModel::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityProperties_ = compressibilityProperties;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,154 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModel
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
compressibilityModel.C
|
||||
newCompressibilityModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef compressibilityModel_H
|
||||
#define compressibilityModel_H
|
||||
|
||||
#include "IOdictionary.H"
|
||||
#include "typeInfo.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "volFields.H"
|
||||
#include "dimensionedScalar.H"
|
||||
#include "autoPtr.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class compressibilityModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class compressibilityModel
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
dictionary compressibilityProperties_;
|
||||
|
||||
volScalarField psi_;
|
||||
const volScalarField& gamma_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
compressibilityModel(const compressibilityModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const compressibilityModel&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("compressibilityModel");
|
||||
|
||||
|
||||
// Declare run-time constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
compressibilityModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
),
|
||||
(compressibilityProperties, gamma)
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected compressibility model
|
||||
static autoPtr<compressibilityModel> New
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
compressibilityModel
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~compressibilityModel()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the phase transport properties dictionary
|
||||
const dictionary& compressibilityProperties() const
|
||||
{
|
||||
return compressibilityProperties_;
|
||||
}
|
||||
|
||||
//- Return the compressibility
|
||||
const volScalarField& psi() const
|
||||
{
|
||||
return psi_;
|
||||
}
|
||||
|
||||
//- Correct the compressibility
|
||||
virtual void correct() = 0;
|
||||
|
||||
//- Read compressibilityProperties dictionary
|
||||
virtual bool read(const dictionary& compressibilityProperties) = 0;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,67 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "compressibilityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::compressibilityModel> Foam::compressibilityModel::New
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
{
|
||||
word compressibilityModelTypeName
|
||||
(
|
||||
compressibilityProperties.lookup("compressibilityModel")
|
||||
);
|
||||
|
||||
Info<< "Selecting compressibility model "
|
||||
<< compressibilityModelTypeName << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(compressibilityModelTypeName);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"compressibilityModel::New(const volScalarField&)"
|
||||
) << "Unknown compressibilityModel type "
|
||||
<< compressibilityModelTypeName << endl << endl
|
||||
<< "Valid compressibilityModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<compressibilityModel>
|
||||
(
|
||||
cstrIter()(compressibilityProperties, gamma)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,82 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "linear.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
defineTypeNameAndDebug(linear, 0);
|
||||
addToRunTimeSelectionTable(compressibilityModel, linear, dictionary);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModels::linear::linear
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityModel(compressibilityProperties, gamma),
|
||||
psiv_(compressibilityProperties_.lookup("psiv")),
|
||||
psil_(compressibilityProperties_.lookup("psil"))
|
||||
{
|
||||
correct();
|
||||
psi_.oldTime();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::compressibilityModels::linear::correct()
|
||||
{
|
||||
psi_ = gamma_*psiv_ + (scalar(1) - gamma_)*psil_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::compressibilityModels::linear::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityModel::read(compressibilityProperties);
|
||||
|
||||
compressibilityProperties_.lookup("psiv") >> psiv_;
|
||||
compressibilityProperties_.lookup("psil") >> psil_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,104 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModels::linear
|
||||
|
||||
Description
|
||||
linear compressibility model.
|
||||
|
||||
SourceFiles
|
||||
linear.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef linear_H
|
||||
#define linear_H
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
#include "dimensionedScalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class linear Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class linear
|
||||
:
|
||||
public compressibilityModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar psiv_;
|
||||
dimensionedScalar psil_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("linear");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
linear
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~linear()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the linear compressibility
|
||||
void correct();
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& compressibilityProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace compressibilityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -39,12 +39,13 @@
|
||||
);
|
||||
gamma.oldTime();
|
||||
|
||||
Info<< "Creating compressibilityModel\n" << endl;
|
||||
autoPtr<compressibilityModel> psiModel = compressibilityModel::New
|
||||
(
|
||||
thermodynamicProperties,
|
||||
gamma
|
||||
);
|
||||
Info<< "Creating barotropicompressibilityModel\n" << endl;
|
||||
autoPtr<barotropicCompressibilityModel> psiModel =
|
||||
barotropicCompressibilityModel::New
|
||||
(
|
||||
thermodynamicProperties,
|
||||
gamma
|
||||
);
|
||||
|
||||
const volScalarField& psi = psiModel->psi();
|
||||
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
lesCavitatingFoam.C
|
||||
compressibilityModels/compressibilityModel/compressibilityModel.C
|
||||
compressibilityModels/compressibilityModel/newCompressibilityModel.C
|
||||
compressibilityModels/linear/linear.C
|
||||
compressibilityModels/Wallis/Wallis.C
|
||||
compressibilityModels/Chung/Chung.C
|
||||
|
||||
devOneEqEddy/devOneEqEddy.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/lesCavitatingFoam
|
||||
EXE = $(FOAM_APPBIN)/lesCavitatingFoam
|
||||
|
||||
@ -6,10 +6,11 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/LESmodels \
|
||||
-I$(LIB_SRC)/LESmodels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/LESmodels/LESdeltas/lnInclude \
|
||||
-IcompressibilityModels/compressibilityModel
|
||||
-I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleLESmodels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lbarotropicCompressibilityModel
|
||||
|
||||
|
||||
@ -1,95 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "Chung.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
defineTypeNameAndDebug(Chung, 0);
|
||||
addToRunTimeSelectionTable(compressibilityModel, Chung, dictionary);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModels::Chung::Chung
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityModel(compressibilityProperties, gamma),
|
||||
psiv_(compressibilityProperties_.lookup("psiv")),
|
||||
psil_(compressibilityProperties_.lookup("psil")),
|
||||
rhovSat_(compressibilityProperties_.lookup("rhovSat")),
|
||||
rholSat_(compressibilityProperties_.lookup("rholSat"))
|
||||
{
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::compressibilityModels::Chung::correct()
|
||||
{
|
||||
volScalarField sfa = sqrt
|
||||
(
|
||||
(rhovSat_/psiv_)
|
||||
/((scalar(1) - gamma_)*rhovSat_/psiv_ + gamma_*rholSat_/psil_)
|
||||
);
|
||||
|
||||
psi_ = sqr
|
||||
(
|
||||
((scalar(1) - gamma_)/sqrt(psiv_) + gamma_*sfa/sqrt(psil_))
|
||||
*sqrt(psiv_*psil_)/sfa
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::compressibilityModels::Chung::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityModel::read(compressibilityProperties);
|
||||
|
||||
compressibilityProperties_.lookup("psiv") >> psiv_;
|
||||
compressibilityProperties_.lookup("psil") >> psil_;
|
||||
compressibilityProperties_.lookup("rhovSat") >> rhovSat_;
|
||||
compressibilityProperties_.lookup("rholSat") >> rholSat_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,107 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModels::Chung
|
||||
|
||||
Description
|
||||
Chung compressibility model.
|
||||
|
||||
SourceFiles
|
||||
Chung.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Chung_H
|
||||
#define Chung_H
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
#include "dimensionedScalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Chung Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Chung
|
||||
:
|
||||
public compressibilityModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar psiv_;
|
||||
dimensionedScalar psil_;
|
||||
|
||||
dimensionedScalar rhovSat_;
|
||||
dimensionedScalar rholSat_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Chung");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
Chung
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~Chung()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the Chung compressibility
|
||||
void correct();
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& compressibilityProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace compressibilityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,86 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "Wallis.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
defineTypeNameAndDebug(Wallis, 0);
|
||||
addToRunTimeSelectionTable(compressibilityModel, Wallis, dictionary);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModels::Wallis::Wallis
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityModel(compressibilityProperties, gamma),
|
||||
psiv_(compressibilityProperties_.lookup("psiv")),
|
||||
psil_(compressibilityProperties_.lookup("psil")),
|
||||
rhovSat_(compressibilityProperties_.lookup("rhovSat")),
|
||||
rholSat_(compressibilityProperties_.lookup("rholSat"))
|
||||
{
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::compressibilityModels::Wallis::correct()
|
||||
{
|
||||
psi_ = (gamma_*rhovSat_ + (scalar(1) - gamma_)*rholSat_)
|
||||
*(gamma_*psiv_/rhovSat_ + (scalar(1) - gamma_)*psil_/rholSat_);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::compressibilityModels::Wallis::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityModel::read(compressibilityProperties);
|
||||
|
||||
compressibilityProperties_.lookup("psiv") >> psiv_;
|
||||
compressibilityProperties_.lookup("psil") >> psil_;
|
||||
compressibilityProperties_.lookup("rhovSat") >> rhovSat_;
|
||||
compressibilityProperties_.lookup("rholSat") >> rholSat_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,107 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModels::Wallis
|
||||
|
||||
Description
|
||||
Wallis compressibility model.
|
||||
|
||||
SourceFiles
|
||||
Wallis.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Wallis_H
|
||||
#define Wallis_H
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
#include "dimensionedScalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Wallis Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Wallis
|
||||
:
|
||||
public compressibilityModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar psiv_;
|
||||
dimensionedScalar psil_;
|
||||
|
||||
dimensionedScalar rhovSat_;
|
||||
dimensionedScalar rholSat_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Wallis");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
Wallis
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~Wallis()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the Wallis compressibility
|
||||
void correct();
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& compressibilityProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace compressibilityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,77 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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
|
||||
|
||||
InClass
|
||||
compressibilityModel
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(compressibilityModel, 0);
|
||||
defineRunTimeSelectionTable(compressibilityModel, dictionary);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModel::compressibilityModel
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityProperties_(compressibilityProperties),
|
||||
psi_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"psi",
|
||||
gamma.mesh().time().timeName(),
|
||||
gamma.mesh()
|
||||
),
|
||||
gamma.mesh(),
|
||||
dimensionedScalar("psi", dimensionSet(0, -2, 2, 0, 0), 0)
|
||||
),
|
||||
gamma_(gamma)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::compressibilityModel::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityProperties_ = compressibilityProperties;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,154 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModel
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
compressibilityModel.C
|
||||
newCompressibilityModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef compressibilityModel_H
|
||||
#define compressibilityModel_H
|
||||
|
||||
#include "IOdictionary.H"
|
||||
#include "typeInfo.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "volFields.H"
|
||||
#include "dimensionedScalar.H"
|
||||
#include "autoPtr.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class compressibilityModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class compressibilityModel
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
dictionary compressibilityProperties_;
|
||||
|
||||
volScalarField psi_;
|
||||
const volScalarField& gamma_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
compressibilityModel(const compressibilityModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const compressibilityModel&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("compressibilityModel");
|
||||
|
||||
|
||||
// Declare run-time constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
compressibilityModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
),
|
||||
(compressibilityProperties, gamma)
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected compressibility model
|
||||
static autoPtr<compressibilityModel> New
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
compressibilityModel
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~compressibilityModel()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the phase transport properties dictionary
|
||||
const dictionary& compressibilityProperties() const
|
||||
{
|
||||
return compressibilityProperties_;
|
||||
}
|
||||
|
||||
//- Return the compressibility
|
||||
const volScalarField& psi() const
|
||||
{
|
||||
return psi_;
|
||||
}
|
||||
|
||||
//- Correct the compressibility
|
||||
virtual void correct() = 0;
|
||||
|
||||
//- Read compressibilityProperties dictionary
|
||||
virtual bool read(const dictionary& compressibilityProperties) = 0;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,67 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "compressibilityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::compressibilityModel> Foam::compressibilityModel::New
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
{
|
||||
word compressibilityModelTypeName
|
||||
(
|
||||
compressibilityProperties.lookup("compressibilityModel")
|
||||
);
|
||||
|
||||
Info<< "Selecting compressibility model "
|
||||
<< compressibilityModelTypeName << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(compressibilityModelTypeName);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"compressibilityModel::New(const volScalarField&)"
|
||||
) << "Unknown compressibilityModel type "
|
||||
<< compressibilityModelTypeName << endl << endl
|
||||
<< "Valid compressibilityModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<compressibilityModel>
|
||||
(
|
||||
cstrIter()(compressibilityProperties, gamma)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,82 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "linear.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
defineTypeNameAndDebug(linear, 0);
|
||||
addToRunTimeSelectionTable(compressibilityModel, linear, dictionary);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModels::linear::linear
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityModel(compressibilityProperties, gamma),
|
||||
psiv_(compressibilityProperties_.lookup("psiv")),
|
||||
psil_(compressibilityProperties_.lookup("psil"))
|
||||
{
|
||||
correct();
|
||||
psi_.oldTime();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::compressibilityModels::linear::correct()
|
||||
{
|
||||
psi_ = gamma_*psiv_ + (scalar(1) - gamma_)*psil_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::compressibilityModels::linear::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityModel::read(compressibilityProperties);
|
||||
|
||||
compressibilityProperties_.lookup("psiv") >> psiv_;
|
||||
compressibilityProperties_.lookup("psil") >> psil_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,104 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModels::linear
|
||||
|
||||
Description
|
||||
linear compressibility model.
|
||||
|
||||
SourceFiles
|
||||
linear.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef linear_H
|
||||
#define linear_H
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
#include "dimensionedScalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class linear Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class linear
|
||||
:
|
||||
public compressibilityModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar psiv_;
|
||||
dimensionedScalar psil_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("linear");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
linear
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~linear()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the linear compressibility
|
||||
void correct();
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& compressibilityProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace compressibilityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -40,11 +40,12 @@
|
||||
gamma.oldTime();
|
||||
|
||||
Info<< "Creating compressibilityModel\n" << endl;
|
||||
autoPtr<compressibilityModel> psiModel = compressibilityModel::New
|
||||
(
|
||||
thermodynamicProperties,
|
||||
gamma
|
||||
);
|
||||
autoPtr<barotropicCompressibilityModel> psiModel =
|
||||
barotropicCompressibilityModel::New
|
||||
(
|
||||
thermodynamicProperties,
|
||||
gamma
|
||||
);
|
||||
|
||||
const volScalarField& psi = psiModel->psi();
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "compressibilityModel.H"
|
||||
#include "barotropicCompressibilityModel.H"
|
||||
#include "twoPhaseMixture.H"
|
||||
#include "incompressible/LESmodel/LESmodel.H"
|
||||
|
||||
|
||||
@ -1,8 +1,3 @@
|
||||
rasCavitatingFoam.C
|
||||
compressibilityModels/compressibilityModel/compressibilityModel.C
|
||||
compressibilityModels/compressibilityModel/newCompressibilityModel.C
|
||||
compressibilityModels/linear/linear.C
|
||||
compressibilityModels/Wallis/Wallis.C
|
||||
compressibilityModels/Chung/Chung.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/rasCavitatingFoam
|
||||
EXE = $(FOAM_APPBIN)/rasCavitatingFoam
|
||||
|
||||
@ -4,10 +4,11 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-IcompressibilityModels/compressibilityModel
|
||||
-I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lbarotropicCompressibilityModel
|
||||
|
||||
|
||||
@ -1,95 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "Chung.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
defineTypeNameAndDebug(Chung, 0);
|
||||
addToRunTimeSelectionTable(compressibilityModel, Chung, dictionary);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModels::Chung::Chung
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityModel(compressibilityProperties, gamma),
|
||||
psiv_(compressibilityProperties_.lookup("psiv")),
|
||||
psil_(compressibilityProperties_.lookup("psil")),
|
||||
rhovSat_(compressibilityProperties_.lookup("rhovSat")),
|
||||
rholSat_(compressibilityProperties_.lookup("rholSat"))
|
||||
{
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::compressibilityModels::Chung::correct()
|
||||
{
|
||||
volScalarField sfa = sqrt
|
||||
(
|
||||
(rhovSat_/psiv_)
|
||||
/((scalar(1) - gamma_)*rhovSat_/psiv_ + gamma_*rholSat_/psil_)
|
||||
);
|
||||
|
||||
psi_ = sqr
|
||||
(
|
||||
((scalar(1) - gamma_)/sqrt(psiv_) + gamma_*sfa/sqrt(psil_))
|
||||
*sqrt(psiv_*psil_)/sfa
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::compressibilityModels::Chung::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityModel::read(compressibilityProperties);
|
||||
|
||||
compressibilityProperties_.lookup("psiv") >> psiv_;
|
||||
compressibilityProperties_.lookup("psil") >> psil_;
|
||||
compressibilityProperties_.lookup("rhovSat") >> rhovSat_;
|
||||
compressibilityProperties_.lookup("rholSat") >> rholSat_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,107 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModels::Chung
|
||||
|
||||
Description
|
||||
Chung compressibility model.
|
||||
|
||||
SourceFiles
|
||||
Chung.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Chung_H
|
||||
#define Chung_H
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
#include "dimensionedScalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Chung Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Chung
|
||||
:
|
||||
public compressibilityModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar psiv_;
|
||||
dimensionedScalar psil_;
|
||||
|
||||
dimensionedScalar rhovSat_;
|
||||
dimensionedScalar rholSat_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Chung");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
Chung
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~Chung()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the Chung compressibility
|
||||
void correct();
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& compressibilityProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace compressibilityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,86 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "Wallis.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
defineTypeNameAndDebug(Wallis, 0);
|
||||
addToRunTimeSelectionTable(compressibilityModel, Wallis, dictionary);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModels::Wallis::Wallis
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityModel(compressibilityProperties, gamma),
|
||||
psiv_(compressibilityProperties_.lookup("psiv")),
|
||||
psil_(compressibilityProperties_.lookup("psil")),
|
||||
rhovSat_(compressibilityProperties_.lookup("rhovSat")),
|
||||
rholSat_(compressibilityProperties_.lookup("rholSat"))
|
||||
{
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::compressibilityModels::Wallis::correct()
|
||||
{
|
||||
psi_ = (gamma_*rhovSat_ + (scalar(1) - gamma_)*rholSat_)
|
||||
*(gamma_*psiv_/rhovSat_ + (scalar(1) - gamma_)*psil_/rholSat_);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::compressibilityModels::Wallis::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityModel::read(compressibilityProperties);
|
||||
|
||||
compressibilityProperties_.lookup("psiv") >> psiv_;
|
||||
compressibilityProperties_.lookup("psil") >> psil_;
|
||||
compressibilityProperties_.lookup("rhovSat") >> rhovSat_;
|
||||
compressibilityProperties_.lookup("rholSat") >> rholSat_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,107 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModels::Wallis
|
||||
|
||||
Description
|
||||
Wallis compressibility model.
|
||||
|
||||
SourceFiles
|
||||
Wallis.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Wallis_H
|
||||
#define Wallis_H
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
#include "dimensionedScalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Wallis Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Wallis
|
||||
:
|
||||
public compressibilityModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar psiv_;
|
||||
dimensionedScalar psil_;
|
||||
|
||||
dimensionedScalar rhovSat_;
|
||||
dimensionedScalar rholSat_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Wallis");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
Wallis
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~Wallis()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the Wallis compressibility
|
||||
void correct();
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& compressibilityProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace compressibilityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,77 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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
|
||||
|
||||
InClass
|
||||
compressibilityModel
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(compressibilityModel, 0);
|
||||
defineRunTimeSelectionTable(compressibilityModel, dictionary);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModel::compressibilityModel
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityProperties_(compressibilityProperties),
|
||||
psi_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"psi",
|
||||
gamma.mesh().time().timeName(),
|
||||
gamma.mesh()
|
||||
),
|
||||
gamma.mesh(),
|
||||
dimensionedScalar("psi", dimensionSet(0, -2, 2, 0, 0), 0)
|
||||
),
|
||||
gamma_(gamma)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::compressibilityModel::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityProperties_ = compressibilityProperties;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,154 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModel
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
compressibilityModel.C
|
||||
newCompressibilityModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef compressibilityModel_H
|
||||
#define compressibilityModel_H
|
||||
|
||||
#include "IOdictionary.H"
|
||||
#include "typeInfo.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "volFields.H"
|
||||
#include "dimensionedScalar.H"
|
||||
#include "autoPtr.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class compressibilityModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class compressibilityModel
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
dictionary compressibilityProperties_;
|
||||
|
||||
volScalarField psi_;
|
||||
const volScalarField& gamma_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
compressibilityModel(const compressibilityModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const compressibilityModel&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("compressibilityModel");
|
||||
|
||||
|
||||
// Declare run-time constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
compressibilityModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
),
|
||||
(compressibilityProperties, gamma)
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected compressibility model
|
||||
static autoPtr<compressibilityModel> New
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
compressibilityModel
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~compressibilityModel()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the phase transport properties dictionary
|
||||
const dictionary& compressibilityProperties() const
|
||||
{
|
||||
return compressibilityProperties_;
|
||||
}
|
||||
|
||||
//- Return the compressibility
|
||||
const volScalarField& psi() const
|
||||
{
|
||||
return psi_;
|
||||
}
|
||||
|
||||
//- Correct the compressibility
|
||||
virtual void correct() = 0;
|
||||
|
||||
//- Read compressibilityProperties dictionary
|
||||
virtual bool read(const dictionary& compressibilityProperties) = 0;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,67 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "compressibilityModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::compressibilityModel> Foam::compressibilityModel::New
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
{
|
||||
word compressibilityModelTypeName
|
||||
(
|
||||
compressibilityProperties.lookup("compressibilityModel")
|
||||
);
|
||||
|
||||
Info<< "Selecting compressibility model "
|
||||
<< compressibilityModelTypeName << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(compressibilityModelTypeName);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"compressibilityModel::New(const volScalarField&)"
|
||||
) << "Unknown compressibilityModel type "
|
||||
<< compressibilityModelTypeName << endl << endl
|
||||
<< "Valid compressibilityModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<compressibilityModel>
|
||||
(
|
||||
cstrIter()(compressibilityProperties, gamma)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,82 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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 "linear.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
defineTypeNameAndDebug(linear, 0);
|
||||
addToRunTimeSelectionTable(compressibilityModel, linear, dictionary);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibilityModels::linear::linear
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
)
|
||||
:
|
||||
compressibilityModel(compressibilityProperties, gamma),
|
||||
psiv_(compressibilityProperties_.lookup("psiv")),
|
||||
psil_(compressibilityProperties_.lookup("psil"))
|
||||
{
|
||||
correct();
|
||||
psi_.oldTime();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::compressibilityModels::linear::correct()
|
||||
{
|
||||
psi_ = gamma_*psiv_ + (scalar(1) - gamma_)*psil_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::compressibilityModels::linear::read
|
||||
(
|
||||
const dictionary& compressibilityProperties
|
||||
)
|
||||
{
|
||||
compressibilityModel::read(compressibilityProperties);
|
||||
|
||||
compressibilityProperties_.lookup("psiv") >> psiv_;
|
||||
compressibilityProperties_.lookup("psil") >> psil_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,104 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 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::compressibilityModels::linear
|
||||
|
||||
Description
|
||||
linear compressibility model.
|
||||
|
||||
SourceFiles
|
||||
linear.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef linear_H
|
||||
#define linear_H
|
||||
|
||||
#include "compressibilityModel.H"
|
||||
#include "dimensionedScalar.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace compressibilityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class linear Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class linear
|
||||
:
|
||||
public compressibilityModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
dimensionedScalar psiv_;
|
||||
dimensionedScalar psil_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("linear");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- construct from components
|
||||
linear
|
||||
(
|
||||
const dictionary& compressibilityProperties,
|
||||
const volScalarField& gamma
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~linear()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the linear compressibility
|
||||
void correct();
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& compressibilityProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace compressibilityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -40,11 +40,12 @@
|
||||
gamma.oldTime();
|
||||
|
||||
Info<< "Creating compressibilityModel\n" << endl;
|
||||
autoPtr<compressibilityModel> psiModel = compressibilityModel::New
|
||||
(
|
||||
thermodynamicProperties,
|
||||
gamma
|
||||
);
|
||||
autoPtr<barotropicCompressibilityModel> psiModel =
|
||||
barotropicCompressibilityModel::New
|
||||
(
|
||||
thermodynamicProperties,
|
||||
gamma
|
||||
);
|
||||
|
||||
const volScalarField& psi = psiModel->psi();
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "compressibilityModel.H"
|
||||
#include "barotropicCompressibilityModel.H"
|
||||
#include "twoPhaseMixture.H"
|
||||
#include "incompressible/turbulenceModel/turbulenceModel.H"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user