fvOptions: Added volumeFractionSource and solidEquilibriumEnergySource
The volumeFractionSource represents the effect of a reduction in the
volume of the domain due to the presence of a stationary phase, most
likely a solid porous media. It only represents the dynamic effects
associated with the reduction in volume; it does not does not model
loss, drag or heat transfer. Separate models (e.g., the existing
porosity models) will be necessary to represent these effects. An
example usage, in system/fvOptions, is as follows:
volumeFraction
{
type volumeFractionSource;
phase solid;
phi phi;
rho rho;
U U;
fields (rho U e);
}
The volume fraction will be read from constant/alpha.<phase>, and must
be generated in advance using setFields or a function object. Note that
the names of the flux, density (if compressible) and velocity must all
be specified. Every field for which a transport equation is solved
should also be specified in the "fields" entry.
The solidEquilibriumEnergySource adds the thermal inertia and diffusive
characteristics of a stationary solid phase to the energy equation of
the fluid, assuming that the two phases are in thermal equilibrium. An
example usage is as follows:
solidEqulibriumEnergy
{
type solidEqulibriumEnergySource;
phase solid;
field e;
}
This will read the volume fraction in the same way as the
volumeFractionSource option. In addition, thermal properties of the
solid will be constructed from settings in
system/thermophysicalProperties.<phase>.
Two tutorials have been added, demonstrating use of these options in
both incompressible and compressible simulations. These are
incompressible/pimpleFoam/laminar/blockedChannel and
compressible/rhoPimpleFoam/laminar/blockedChannel.
This commit is contained in:
@ -40,6 +40,8 @@ $(derivedSources)/buoyancyEnergy/buoyancyEnergyIO.C
|
|||||||
$(derivedSources)/verticalDamping/verticalDamping.C
|
$(derivedSources)/verticalDamping/verticalDamping.C
|
||||||
$(derivedSources)/phaseLimitStabilization/phaseLimitStabilization.C
|
$(derivedSources)/phaseLimitStabilization/phaseLimitStabilization.C
|
||||||
$(derivedSources)/accelerationSource/accelerationSource.C
|
$(derivedSources)/accelerationSource/accelerationSource.C
|
||||||
|
$(derivedSources)/volumeFractionSource/volumeFractionSource.C
|
||||||
|
$(derivedSources)/solidEqulibriumEnergySource/solidEqulibriumEnergySource.C
|
||||||
|
|
||||||
interRegion = sources/interRegion
|
interRegion = sources/interRegion
|
||||||
$(interRegion)/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C
|
$(interRegion)/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C
|
||||||
|
|||||||
@ -0,0 +1,184 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "solidEqulibriumEnergySource.H"
|
||||||
|
#include "fvmDdt.H"
|
||||||
|
#include "fvmLaplacian.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(solidEqulibriumEnergySource, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
option,
|
||||||
|
solidEqulibriumEnergySource,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
const Foam::volScalarField& Foam::fv::solidEqulibriumEnergySource::alpha() const
|
||||||
|
{
|
||||||
|
const word alphaName = IOobject::groupName("alpha", phaseName_);
|
||||||
|
|
||||||
|
if (!mesh_.foundObject<volScalarField>(alphaName))
|
||||||
|
{
|
||||||
|
volScalarField* alphaPtr =
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
alphaName,
|
||||||
|
mesh_.time().constant(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh_
|
||||||
|
);
|
||||||
|
|
||||||
|
alphaPtr->store();
|
||||||
|
}
|
||||||
|
|
||||||
|
return mesh_.lookupObject<volScalarField>(alphaName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::solidThermo& Foam::fv::solidEqulibriumEnergySource::thermo() const
|
||||||
|
{
|
||||||
|
const word thermoName =
|
||||||
|
IOobject::groupName(basicThermo::dictName, phaseName_);
|
||||||
|
|
||||||
|
if (!mesh_.foundObject<solidThermo>(thermoName))
|
||||||
|
{
|
||||||
|
solidThermo* thermoPtr = solidThermo::New(mesh_, phaseName_).ptr();
|
||||||
|
|
||||||
|
thermoPtr->store();
|
||||||
|
}
|
||||||
|
|
||||||
|
return mesh_.lookupObject<solidThermo>(thermoName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::solidEqulibriumEnergySource::solidEqulibriumEnergySource
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
option(name, modelType, dict, mesh),
|
||||||
|
phaseName_(dict.lookupType<word>("phase"))
|
||||||
|
{
|
||||||
|
read(dict);
|
||||||
|
alpha();
|
||||||
|
thermo();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::solidEqulibriumEnergySource::~solidEqulibriumEnergySource()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::solidEqulibriumEnergySource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const volScalarField alphahe(thermo().alphahe());
|
||||||
|
|
||||||
|
const volScalarField& A = this->alpha();
|
||||||
|
const volScalarField B(1 - A);
|
||||||
|
|
||||||
|
eqn -=
|
||||||
|
A/B*fvm::ddt(thermo().rho(), eqn.psi());
|
||||||
|
- 1/B*fvm::laplacian
|
||||||
|
(
|
||||||
|
A*alphahe,
|
||||||
|
eqn.psi(),
|
||||||
|
"laplacian(" + alphahe.name() + "," + eqn.psi().name() + ")"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::solidEqulibriumEnergySource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const volScalarField alphahe(alpha*thermo().alphahe());
|
||||||
|
|
||||||
|
const volScalarField& A = this->alpha();
|
||||||
|
const volScalarField B(1 - A);
|
||||||
|
|
||||||
|
eqn -=
|
||||||
|
A/B*fvm::ddt(alpha, thermo().rho(), eqn.psi());
|
||||||
|
- 1/B*fvm::laplacian
|
||||||
|
(
|
||||||
|
A*alphahe,
|
||||||
|
eqn.psi(),
|
||||||
|
"laplacian(" + alphahe.name() + "," + eqn.psi().name() + ")"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::solidEqulibriumEnergySource::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (option::read(dict))
|
||||||
|
{
|
||||||
|
fieldNames_ = wordList(1, coeffs_.lookupType<word>("field"));
|
||||||
|
|
||||||
|
applied_.setSize(fieldNames_.size(), false);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,161 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::fv::solidEqulibriumEnergySource
|
||||||
|
|
||||||
|
Description
|
||||||
|
This option adds the thermal inertia of a solid phase into the energy
|
||||||
|
equation. It assumes that the solid is in thermal equilibrium with the
|
||||||
|
surrounding fluid phase.
|
||||||
|
|
||||||
|
The volume fraction of the solid phase is read from constant/alpha.<phase>,
|
||||||
|
and the associated thermophysical properties are specified in
|
||||||
|
constant/thermophysicalProperties.<phase>.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
\table
|
||||||
|
Property | Description | Req'd? | Default
|
||||||
|
phase | Name of the solid phase | yes |
|
||||||
|
field | Name of the energy field to apply the option to \\
|
||||||
|
| yes |
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
Example specification:
|
||||||
|
\verbatim
|
||||||
|
<fvOptionName>
|
||||||
|
{
|
||||||
|
type solidEqulibriumEnergySource;
|
||||||
|
phase solid;
|
||||||
|
field e;
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef solidEqulibriumEnergySource_H
|
||||||
|
#define solidEqulibriumEnergySource_H
|
||||||
|
|
||||||
|
#include "fvOption.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "solidThermo.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class solidEqulibriumEnergySource Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class solidEqulibriumEnergySource
|
||||||
|
:
|
||||||
|
public option
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private Member Data
|
||||||
|
|
||||||
|
//- The name of the phase
|
||||||
|
const word phaseName_;
|
||||||
|
|
||||||
|
//- Get the volume fraction field
|
||||||
|
const volScalarField& alpha() const;
|
||||||
|
|
||||||
|
//- Get the thermo
|
||||||
|
const solidThermo& thermo() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
solidEqulibriumEnergySource(const solidEqulibriumEnergySource&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const solidEqulibriumEnergySource&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("solidEqulibriumEnergySource");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
solidEqulibriumEnergySource
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~solidEqulibriumEnergySource();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Evaluation
|
||||||
|
|
||||||
|
//- Explicit and implicit sources for compressible equations
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<scalar>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Explicit and implicit sources for phase equations
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<scalar>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// IO
|
||||||
|
|
||||||
|
//- Read dictionary
|
||||||
|
virtual bool read(const dictionary& dict);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace fv
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,467 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "volumeFractionSource.H"
|
||||||
|
#include "fvmDdt.H"
|
||||||
|
#include "fvmDiv.H"
|
||||||
|
#include "fvmLaplacian.H"
|
||||||
|
#include "surfaceInterpolate.H"
|
||||||
|
#include "turbulentFluidThermoModel.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(volumeFractionSource, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
option,
|
||||||
|
volumeFractionSource,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
const Foam::volScalarField& Foam::fv::volumeFractionSource::alpha() const
|
||||||
|
{
|
||||||
|
const word alphaName = IOobject::groupName("alpha", phaseName_);
|
||||||
|
|
||||||
|
if (!mesh_.foundObject<volScalarField>(alphaName))
|
||||||
|
{
|
||||||
|
volScalarField* alphaPtr =
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
alphaName,
|
||||||
|
mesh_.time().constant(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh_
|
||||||
|
);
|
||||||
|
|
||||||
|
alphaPtr->store();
|
||||||
|
}
|
||||||
|
|
||||||
|
return mesh_.lookupObject<volScalarField>(alphaName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::volScalarField> Foam::fv::volumeFractionSource::D
|
||||||
|
(
|
||||||
|
const label fieldi
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const surfaceScalarField& phi =
|
||||||
|
mesh().lookupObject<surfaceScalarField>(phiName_);
|
||||||
|
|
||||||
|
if (phi.dimensions() == dimVolume/dimTime)
|
||||||
|
{
|
||||||
|
const turbulenceModel& turbulence =
|
||||||
|
mesh().lookupObject<turbulenceModel>
|
||||||
|
(
|
||||||
|
turbulenceModel::propertiesName
|
||||||
|
);
|
||||||
|
|
||||||
|
return turbulence.nuEff();
|
||||||
|
}
|
||||||
|
else if (phi.dimensions() == dimMass/dimTime)
|
||||||
|
{
|
||||||
|
const compressible::turbulenceModel& turbulence =
|
||||||
|
mesh().lookupObject<compressible::turbulenceModel>
|
||||||
|
(
|
||||||
|
turbulenceModel::propertiesName
|
||||||
|
);
|
||||||
|
|
||||||
|
return
|
||||||
|
fieldNames_[fieldi] == turbulence.transport().T().name()
|
||||||
|
? turbulence.kappaEff()
|
||||||
|
: fieldNames_[fieldi] == turbulence.transport().he().name()
|
||||||
|
? turbulence.alphaEff()
|
||||||
|
: turbulence.muEff();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Dimensions of " << phi.name() << " not recognised"
|
||||||
|
<< exit(FatalError);
|
||||||
|
return tmp<volScalarField>(nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <class Type>
|
||||||
|
void Foam::fv::volumeFractionSource::addDivSup
|
||||||
|
(
|
||||||
|
fvMatrix<Type>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const surfaceScalarField& phi =
|
||||||
|
mesh().lookupObject<surfaceScalarField>(phiName_);
|
||||||
|
|
||||||
|
const volScalarField AByB(this->alpha()/(1 - this->alpha()));
|
||||||
|
|
||||||
|
eqn -= AByB*fvm::div(phi, eqn.psi());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addUDivSup
|
||||||
|
(
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const surfaceScalarField& phi =
|
||||||
|
mesh().lookupObject<surfaceScalarField>(phiName_);
|
||||||
|
|
||||||
|
const volScalarField AByB(this->alpha()/(1 - this->alpha()));
|
||||||
|
|
||||||
|
const word scheme("div(" + phiName_ + "," + eqn.psi().name() + ")");
|
||||||
|
|
||||||
|
eqn -= fvm::div(fvc::interpolate(AByB)*phi, eqn.psi(), scheme);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addRhoDivSup
|
||||||
|
(
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const surfaceScalarField& phi =
|
||||||
|
mesh().lookupObject<surfaceScalarField>(phiName_);
|
||||||
|
|
||||||
|
const volScalarField AByB(this->alpha()/(1 - this->alpha()));
|
||||||
|
|
||||||
|
eqn -= AByB*fvc::div(phi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <class Type, class AlphaFieldType>
|
||||||
|
void Foam::fv::volumeFractionSource::addLaplacianSup
|
||||||
|
(
|
||||||
|
const AlphaFieldType& alpha,
|
||||||
|
fvMatrix<Type>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const volScalarField B(1 - this->alpha());
|
||||||
|
|
||||||
|
const volScalarField D(this->D(fieldi));
|
||||||
|
|
||||||
|
const word scheme("laplacian(" + D.name() + "," + eqn.psi().name() + ")");
|
||||||
|
|
||||||
|
eqn +=
|
||||||
|
fvm::laplacian(D, eqn.psi())
|
||||||
|
- 1/B*fvm::laplacian(B*D, eqn.psi(), scheme);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::volumeFractionSource::volumeFractionSource
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
option(name, modelType, dict, mesh),
|
||||||
|
phaseName_(dict.lookupType<word>("phase")),
|
||||||
|
phiName_("phi"),
|
||||||
|
rhoName_("rho"),
|
||||||
|
UName_("U")
|
||||||
|
{
|
||||||
|
read(dict);
|
||||||
|
alpha();
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::volumeFractionSource::~volumeFractionSource()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (fieldNames_[fieldi] == rhoName_)
|
||||||
|
{
|
||||||
|
addRhoDivSup(eqn, fieldi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(geometricOneField(), eqn, fieldi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (fieldNames_[fieldi] == UName_)
|
||||||
|
{
|
||||||
|
addUDivSup(eqn, fieldi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(geometricOneField(), eqn, fieldi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(geometricOneField(), eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(geometricOneField(), eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(geometricOneField(), eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (fieldNames_[fieldi] == rhoName_)
|
||||||
|
{
|
||||||
|
addRhoDivSup(eqn, fieldi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(geometricOneField(), eqn, fieldi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (fieldNames_[fieldi] == UName_)
|
||||||
|
{
|
||||||
|
addUDivSup(eqn, fieldi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(geometricOneField(), eqn, fieldi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(geometricOneField(), eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(geometricOneField(), eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(geometricOneField(), eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<scalar>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (fieldNames_[fieldi] == rhoName_)
|
||||||
|
{
|
||||||
|
addRhoDivSup(eqn, fieldi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(alpha, eqn, fieldi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (fieldNames_[fieldi] == UName_)
|
||||||
|
{
|
||||||
|
addUDivSup(eqn, fieldi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(alpha, eqn, fieldi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<sphericalTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(alpha, eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<symmTensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(alpha, eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::volumeFractionSource::addSup
|
||||||
|
(
|
||||||
|
const volScalarField& alpha,
|
||||||
|
const volScalarField& rho,
|
||||||
|
fvMatrix<tensor>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addDivSup(eqn, fieldi);
|
||||||
|
addLaplacianSup(alpha, eqn, fieldi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::volumeFractionSource::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (option::read(dict))
|
||||||
|
{
|
||||||
|
if (coeffs_.found("fields"))
|
||||||
|
{
|
||||||
|
coeffs_.lookup("fields") >> fieldNames_;
|
||||||
|
}
|
||||||
|
|
||||||
|
applied_.setSize(fieldNames_.size(), false);
|
||||||
|
|
||||||
|
dict.readIfPresent("phi", phiName_);
|
||||||
|
|
||||||
|
dict.readIfPresent("rho", rhoName_);
|
||||||
|
|
||||||
|
dict.readIfPresent("U", UName_);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,297 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::fv::volumeFractionSource
|
||||||
|
|
||||||
|
Description
|
||||||
|
This option adds transport terms into the equations to account for the
|
||||||
|
presence of a constant volume fraction. The volume fraction is read from
|
||||||
|
constant/alpha.<phase>, where <phase> is given as a parameter to the
|
||||||
|
option. Both advective and diffusive terms are added, and the resulting
|
||||||
|
solution is time-accurate. The flux and velocity are treated as
|
||||||
|
superficial.
|
||||||
|
|
||||||
|
This can be used to represent the effect of porous media that are caused
|
||||||
|
purely by the reduction in volume of the fluid phase; i.e., additional
|
||||||
|
blockage, and changes to transport and diffusion rates. It does not
|
||||||
|
represent losses or transfers with the porous media. That requires separate
|
||||||
|
sub-modelling.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
\table
|
||||||
|
Property | Description | Req'd? | Default
|
||||||
|
phase | Name of the phase associated with the volume fraction \\
|
||||||
|
| yes |
|
||||||
|
phi | Name of the flux field | no | phi
|
||||||
|
rho | Name of the density field | no | rho
|
||||||
|
U | Name of the velocity field | no | U
|
||||||
|
fields | Names of the fields to apply the option to \\
|
||||||
|
| yes |
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
Example specification:
|
||||||
|
\verbatim
|
||||||
|
<fvOptionName>
|
||||||
|
{
|
||||||
|
type volumeFractionSource;
|
||||||
|
phase solid;
|
||||||
|
phi phi;
|
||||||
|
rho rho;
|
||||||
|
U U;
|
||||||
|
fields (rho U e);
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
volumeFractionSource.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef volumeFractionSource_H
|
||||||
|
#define volumeFractionSource_H
|
||||||
|
|
||||||
|
#include "fvOption.H"
|
||||||
|
#include "surfaceFields.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class volumeFractionSource Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class volumeFractionSource
|
||||||
|
:
|
||||||
|
public option
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private Member Data
|
||||||
|
|
||||||
|
//- The name of the phase
|
||||||
|
const word phaseName_;
|
||||||
|
|
||||||
|
//- The name of the flux field
|
||||||
|
word phiName_;
|
||||||
|
|
||||||
|
//- The name of the density field
|
||||||
|
word rhoName_;
|
||||||
|
|
||||||
|
//- The name of the velocity field
|
||||||
|
word UName_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Get the volume fraction field
|
||||||
|
const volScalarField& alpha() const;
|
||||||
|
|
||||||
|
//- Get the diffusivity for a given field
|
||||||
|
tmp<volScalarField> D(const label) const;
|
||||||
|
|
||||||
|
//- Add time-derivative terms to an equation
|
||||||
|
template <class Type>
|
||||||
|
void addDdtSup(fvMatrix<Type>&, const label);
|
||||||
|
|
||||||
|
//- Add time-derivative terms to a compressible equation
|
||||||
|
template <class Type>
|
||||||
|
void addDdtSup(const volScalarField&, fvMatrix<Type>&, const label);
|
||||||
|
|
||||||
|
//- Add time-derivative terms to a phase-compressible equation
|
||||||
|
template <class Type>
|
||||||
|
void addDdtSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<Type>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Add divergence terms to an equation
|
||||||
|
template <class Type>
|
||||||
|
void addDivSup(fvMatrix<Type>&, const label);
|
||||||
|
|
||||||
|
//- Add divergence terms to the momentum equation
|
||||||
|
void addUDivSup(fvMatrix<vector>&, const label);
|
||||||
|
|
||||||
|
//- Add divergence terms to the continuity equation
|
||||||
|
void addRhoDivSup(fvMatrix<scalar>&, const label);
|
||||||
|
|
||||||
|
//- Add Laplacian terms to an equation
|
||||||
|
template <class Type, class AlphaFieldType>
|
||||||
|
void addLaplacianSup
|
||||||
|
(
|
||||||
|
const AlphaFieldType& alpha,
|
||||||
|
fvMatrix<Type>& eqn,
|
||||||
|
const label fieldi
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
volumeFractionSource(const volumeFractionSource&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const volumeFractionSource&);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("volumeFractionSource");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
volumeFractionSource
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~volumeFractionSource();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Evaluation
|
||||||
|
|
||||||
|
// Explicit and implicit sources
|
||||||
|
|
||||||
|
virtual void addSup(fvMatrix<scalar>&, const label);
|
||||||
|
|
||||||
|
virtual void addSup(fvMatrix<vector>&, const label);
|
||||||
|
|
||||||
|
virtual void addSup(fvMatrix<symmTensor>&, const label);
|
||||||
|
|
||||||
|
virtual void addSup(fvMatrix<sphericalTensor>&, const label);
|
||||||
|
|
||||||
|
virtual void addSup(fvMatrix<tensor>&, const label);
|
||||||
|
|
||||||
|
|
||||||
|
// Explicit and implicit sources for compressible equations
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<scalar>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<vector>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<symmTensor>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<sphericalTensor>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<tensor>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Explicit and implicit sources for phase equations
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<scalar>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<vector>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<symmTensor>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<sphericalTensor>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
const volScalarField&,
|
||||||
|
const volScalarField&,
|
||||||
|
fvMatrix<tensor>&,
|
||||||
|
const label
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// IO
|
||||||
|
|
||||||
|
//- Read dictionary
|
||||||
|
virtual bool read(const dictionary& dict);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace fv
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object T;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 1 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 300;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 400;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object T.solid;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 1 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 300;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
location "0";
|
||||||
|
object U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (10 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type noSlip;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [1 -1 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 1e5;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object tracer;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 1;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
7
tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/Allclean
Executable file
7
tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/Allclean
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd ${0%/*} || exit 1
|
||||||
|
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||||
|
|
||||||
|
cleanCase && rm -f constant/alpha.solid
|
||||||
9
tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/Allrun
Executable file
9
tutorials/compressible/rhoPimpleFoam/laminar/blockedChannel/Allrun
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd ${0%/*} || exit 1
|
||||||
|
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
runApplication blockMesh
|
||||||
|
runApplication postProcess -func generateAlphaSolid
|
||||||
|
runApplication $(getApplication)
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object thermophysicalProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
thermoType
|
||||||
|
{
|
||||||
|
type hePsiThermo;
|
||||||
|
mixture pureMixture;
|
||||||
|
transport const;
|
||||||
|
thermo eConst;
|
||||||
|
equationOfState perfectGas;
|
||||||
|
specie specie;
|
||||||
|
energy sensibleInternalEnergy;
|
||||||
|
}
|
||||||
|
|
||||||
|
mixture
|
||||||
|
{
|
||||||
|
specie
|
||||||
|
{
|
||||||
|
molWeight 28.9;
|
||||||
|
}
|
||||||
|
thermodynamics
|
||||||
|
{
|
||||||
|
Cv 712;
|
||||||
|
Cp 1005;
|
||||||
|
Hf 0;
|
||||||
|
}
|
||||||
|
transport
|
||||||
|
{
|
||||||
|
mu 1.8e-05;
|
||||||
|
Pr 0.7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object thermophysicalProperties.solid;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
thermoType
|
||||||
|
{
|
||||||
|
type heSolidThermo;
|
||||||
|
mixture pureMixture;
|
||||||
|
transport constIso;
|
||||||
|
thermo hConst;
|
||||||
|
equationOfState rhoConst;
|
||||||
|
specie specie;
|
||||||
|
energy sensibleEnthalpy;
|
||||||
|
}
|
||||||
|
|
||||||
|
mixture
|
||||||
|
{
|
||||||
|
specie
|
||||||
|
{
|
||||||
|
molWeight 1;
|
||||||
|
}
|
||||||
|
equationOfState
|
||||||
|
{
|
||||||
|
rho 900;
|
||||||
|
}
|
||||||
|
thermodynamics
|
||||||
|
{
|
||||||
|
Hf 0;
|
||||||
|
Cp 1900;
|
||||||
|
}
|
||||||
|
transport
|
||||||
|
{
|
||||||
|
kappa 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object transportProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
transportModel Newtonian;
|
||||||
|
|
||||||
|
nu [0 2 -1 0 0 0 0] 1e-05;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object turbulenceProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
simulationType laminar;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,111 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 0.001;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(0 -16 -1) (256 -16 -1)
|
||||||
|
(0 16 -1) (256 16 -1)
|
||||||
|
(0 -16 1) (256 -16 1)
|
||||||
|
(0 16 1) (256 16 1)
|
||||||
|
|
||||||
|
(0 -52 -1) ( 32 -52 -1) (64 -44 -1) (128 -44 -1) (224 -52 -1) (256 -52 -1)
|
||||||
|
(0 -20 -1) ( 32 -20 -1) (64 -28 -1) (128 -28 -1) (224 -20 -1) (256 -20 -1)
|
||||||
|
(0 -52 1) ( 32 -52 1) (64 -44 1) (128 -44 1) (224 -52 1) (256 -52 1)
|
||||||
|
(0 -20 1) ( 32 -20 1) (64 -28 1) (128 -28 1) (224 -20 1) (256 -20 1)
|
||||||
|
|
||||||
|
(0 -88 -1) (256 -88 -1)
|
||||||
|
(0 -56 -1) (256 -56 -1)
|
||||||
|
(0 -88 1) (256 -88 1)
|
||||||
|
(0 -56 1) (256 -56 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 3 2 4 5 7 6) (256 32 1) simpleGrading (1 1 1)
|
||||||
|
|
||||||
|
hex (8 9 15 14 20 21 27 26) (32 32 1) simpleGrading (1 1 1)
|
||||||
|
hex (9 10 16 15 21 22 28 27) (32 32 1) simpleGrading (1 1 1)
|
||||||
|
hex (10 11 17 16 22 23 29 28) (32 32 1) simpleGrading (1 1 1)
|
||||||
|
hex (11 12 18 17 23 24 30 29) (96 32 1) simpleGrading (1 1 1)
|
||||||
|
hex (12 13 19 18 24 25 31 30) (64 32 1) simpleGrading (1 1 1)
|
||||||
|
|
||||||
|
hex (32 33 35 34 36 37 39 38) (256 32 1) simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
defaultPatch
|
||||||
|
{
|
||||||
|
name frontAndBack;
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
boundary
|
||||||
|
(
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 2 6 4)
|
||||||
|
|
||||||
|
(8 14 26 20)
|
||||||
|
|
||||||
|
(32 34 38 36)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(1 3 7 5)
|
||||||
|
|
||||||
|
(13 19 31 25)
|
||||||
|
|
||||||
|
(33 35 39 37)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 1 5 4)
|
||||||
|
(2 3 7 6)
|
||||||
|
|
||||||
|
(8 9 21 20)
|
||||||
|
(9 10 22 21)
|
||||||
|
(10 11 23 22)
|
||||||
|
(11 12 24 23)
|
||||||
|
(12 13 25 24)
|
||||||
|
(14 15 27 26)
|
||||||
|
(15 16 28 27)
|
||||||
|
(16 17 29 28)
|
||||||
|
(17 18 30 29)
|
||||||
|
(18 19 31 30)
|
||||||
|
|
||||||
|
(32 33 37 36)
|
||||||
|
(34 35 39 38)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
application rhoPimpleFoam;
|
||||||
|
|
||||||
|
startFrom latestTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 0.03;
|
||||||
|
|
||||||
|
deltaT 0.0001;
|
||||||
|
|
||||||
|
writeControl adjustableRunTime;
|
||||||
|
|
||||||
|
writeInterval 0.001;
|
||||||
|
|
||||||
|
purgeWrite 0;
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 6;
|
||||||
|
|
||||||
|
writeCompression off;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable yes;
|
||||||
|
|
||||||
|
adjustTimeStep yes;
|
||||||
|
|
||||||
|
maxCo 5;
|
||||||
|
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
#includeFunc scalarTransport
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object fvOptions;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
volumeFraction
|
||||||
|
{
|
||||||
|
type volumeFractionSource;
|
||||||
|
phase solid;
|
||||||
|
phi phi;
|
||||||
|
rho rho;
|
||||||
|
U U;
|
||||||
|
fields (rho U e);
|
||||||
|
}
|
||||||
|
|
||||||
|
solidEqulibriumEnergy
|
||||||
|
{
|
||||||
|
type solidEqulibriumEnergySource;
|
||||||
|
phase solid;
|
||||||
|
field e;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
limited cellLimited Gauss linear 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,U) Gauss linearUpwind limited;
|
||||||
|
div(phi,e) Gauss linearUpwind limited;
|
||||||
|
div(phi,tracer) Gauss linearUpwind limited;
|
||||||
|
div(phi,K) Gauss linear;
|
||||||
|
div(phiv,p) Gauss linear;
|
||||||
|
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
"rho.*"
|
||||||
|
{
|
||||||
|
solver diagonal;
|
||||||
|
}
|
||||||
|
|
||||||
|
p
|
||||||
|
{
|
||||||
|
solver GAMG;
|
||||||
|
smoother DICGaussSeidel;
|
||||||
|
tolerance 1e-7;
|
||||||
|
relTol 0.01;
|
||||||
|
}
|
||||||
|
|
||||||
|
pFinal
|
||||||
|
{
|
||||||
|
$p;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(U|e|tracer)"
|
||||||
|
{
|
||||||
|
solver PBiCGStab;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-05;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(U|e|tracer)Final"
|
||||||
|
{
|
||||||
|
$U;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
nCorrectors 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
type coded;
|
||||||
|
libs ("libutilityFunctionObjects.so");
|
||||||
|
|
||||||
|
name generateAlphaSolid;
|
||||||
|
|
||||||
|
codeWrite
|
||||||
|
#{
|
||||||
|
const dimensionedVector dx(dimless/dimLength, vector(1, 0, 0));
|
||||||
|
const dimensionedVector dy(dimless/dimLength, vector(0, 1, 0));
|
||||||
|
|
||||||
|
const volScalarField x(mesh().C() & dx), y(mesh().C() & dy);
|
||||||
|
|
||||||
|
const scalar x0 = 0.032, x1 = 0.064, x2 = 0.128, x3 = 0.224;
|
||||||
|
const scalar y0 = -0.088, y1 = -0.056;
|
||||||
|
|
||||||
|
volScalarField alpha
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName("alpha", "solid"),
|
||||||
|
mesh().time().constant(),
|
||||||
|
mesh()
|
||||||
|
),
|
||||||
|
mesh(),
|
||||||
|
dimless,
|
||||||
|
zeroGradientFvPatchScalarField::typeName
|
||||||
|
);
|
||||||
|
|
||||||
|
alpha =
|
||||||
|
0.5
|
||||||
|
*(
|
||||||
|
pos(x - x0)*pos(x1 - x)*(x - x0)/(x1 - x0)
|
||||||
|
+ pos(x - x1)*pos(x2 - x)
|
||||||
|
+ pos(x - x2)*pos(x3 - x)*(x3 - x)/(x3 - x2)
|
||||||
|
)
|
||||||
|
*pos(y - y0)*pos(y1 - y);
|
||||||
|
|
||||||
|
alpha.write();
|
||||||
|
#};
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Description
|
||||||
|
Solves a transport equation for a scalar field.
|
||||||
|
|
||||||
|
The name of the scalar field is specified in this file. A sample scalar
|
||||||
|
field file, that must be initialised for the case, typically in the 0
|
||||||
|
directory, is available in $FOAM_ETC/caseDicts/solvers/scalarTransport.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#includeEtc "caseDicts/postProcessing/solvers/scalarTransport/scalarTransport.cfg"
|
||||||
|
|
||||||
|
field tracer;
|
||||||
|
|
||||||
|
fvOptions
|
||||||
|
{
|
||||||
|
volumeFraction
|
||||||
|
{
|
||||||
|
type volumeFractionSource;
|
||||||
|
phase solid;
|
||||||
|
phi phi;
|
||||||
|
rho rho;
|
||||||
|
U U;
|
||||||
|
fields (tracer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
location "0";
|
||||||
|
object U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (10 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type noSlip;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object tracer;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 1;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
7
tutorials/incompressible/pimpleFoam/laminar/blockedChannel/Allclean
Executable file
7
tutorials/incompressible/pimpleFoam/laminar/blockedChannel/Allclean
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd ${0%/*} || exit 1
|
||||||
|
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||||
|
|
||||||
|
cleanCase && rm -f constant/alpha.solid
|
||||||
9
tutorials/incompressible/pimpleFoam/laminar/blockedChannel/Allrun
Executable file
9
tutorials/incompressible/pimpleFoam/laminar/blockedChannel/Allrun
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd ${0%/*} || exit 1
|
||||||
|
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
runApplication blockMesh
|
||||||
|
runApplication postProcess -func generateAlphaSolid
|
||||||
|
runApplication $(getApplication)
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object transportProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
transportModel Newtonian;
|
||||||
|
|
||||||
|
nu [0 2 -1 0 0 0 0] 1e-05;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object turbulenceProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
simulationType laminar;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,111 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 0.001;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(0 -16 -1) (256 -16 -1)
|
||||||
|
(0 16 -1) (256 16 -1)
|
||||||
|
(0 -16 1) (256 -16 1)
|
||||||
|
(0 16 1) (256 16 1)
|
||||||
|
|
||||||
|
(0 -52 -1) ( 32 -52 -1) (64 -44 -1) (128 -44 -1) (224 -52 -1) (256 -52 -1)
|
||||||
|
(0 -20 -1) ( 32 -20 -1) (64 -28 -1) (128 -28 -1) (224 -20 -1) (256 -20 -1)
|
||||||
|
(0 -52 1) ( 32 -52 1) (64 -44 1) (128 -44 1) (224 -52 1) (256 -52 1)
|
||||||
|
(0 -20 1) ( 32 -20 1) (64 -28 1) (128 -28 1) (224 -20 1) (256 -20 1)
|
||||||
|
|
||||||
|
(0 -88 -1) (256 -88 -1)
|
||||||
|
(0 -56 -1) (256 -56 -1)
|
||||||
|
(0 -88 1) (256 -88 1)
|
||||||
|
(0 -56 1) (256 -56 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 3 2 4 5 7 6) (256 32 1) simpleGrading (1 1 1)
|
||||||
|
|
||||||
|
hex (8 9 15 14 20 21 27 26) (32 32 1) simpleGrading (1 1 1)
|
||||||
|
hex (9 10 16 15 21 22 28 27) (32 32 1) simpleGrading (1 1 1)
|
||||||
|
hex (10 11 17 16 22 23 29 28) (32 32 1) simpleGrading (1 1 1)
|
||||||
|
hex (11 12 18 17 23 24 30 29) (96 32 1) simpleGrading (1 1 1)
|
||||||
|
hex (12 13 19 18 24 25 31 30) (64 32 1) simpleGrading (1 1 1)
|
||||||
|
|
||||||
|
hex (32 33 35 34 36 37 39 38) (256 32 1) simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
defaultPatch
|
||||||
|
{
|
||||||
|
name frontAndBack;
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
boundary
|
||||||
|
(
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 2 6 4)
|
||||||
|
|
||||||
|
(8 14 26 20)
|
||||||
|
|
||||||
|
(32 34 38 36)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(1 3 7 5)
|
||||||
|
|
||||||
|
(13 19 31 25)
|
||||||
|
|
||||||
|
(33 35 39 37)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 1 5 4)
|
||||||
|
(2 3 7 6)
|
||||||
|
|
||||||
|
(8 9 21 20)
|
||||||
|
(9 10 22 21)
|
||||||
|
(10 11 23 22)
|
||||||
|
(11 12 24 23)
|
||||||
|
(12 13 25 24)
|
||||||
|
(14 15 27 26)
|
||||||
|
(15 16 28 27)
|
||||||
|
(16 17 29 28)
|
||||||
|
(17 18 30 29)
|
||||||
|
(18 19 31 30)
|
||||||
|
|
||||||
|
(32 33 37 36)
|
||||||
|
(34 35 39 38)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
application pimpleFoam;
|
||||||
|
|
||||||
|
startFrom latestTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 0.03;
|
||||||
|
|
||||||
|
deltaT 0.0001;
|
||||||
|
|
||||||
|
writeControl adjustableRunTime;
|
||||||
|
|
||||||
|
writeInterval 0.001;
|
||||||
|
|
||||||
|
purgeWrite 0;
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 6;
|
||||||
|
|
||||||
|
writeCompression off;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable yes;
|
||||||
|
|
||||||
|
adjustTimeStep yes;
|
||||||
|
|
||||||
|
maxCo 5;
|
||||||
|
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
#includeFunc scalarTransport
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object fvOptions;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
volumeFraction
|
||||||
|
{
|
||||||
|
type volumeFractionSource;
|
||||||
|
phase solid;
|
||||||
|
phi phi;
|
||||||
|
U U;
|
||||||
|
fields (U);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
limited cellLimited Gauss linear 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
|
||||||
|
div(phi,U) Gauss linearUpwind limited;
|
||||||
|
div(phi,tracer) Gauss linearUpwind limited;
|
||||||
|
div((nuEff*dev2(T(grad(U))))) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
p
|
||||||
|
{
|
||||||
|
solver GAMG;
|
||||||
|
smoother DICGaussSeidel;
|
||||||
|
tolerance 1e-7;
|
||||||
|
relTol 0.01;
|
||||||
|
}
|
||||||
|
|
||||||
|
pFinal
|
||||||
|
{
|
||||||
|
$p;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(U|tracer)"
|
||||||
|
{
|
||||||
|
solver PBiCGStab;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-05;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(U|tracer)Final"
|
||||||
|
{
|
||||||
|
$U;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
nCorrectors 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
type coded;
|
||||||
|
libs ("libutilityFunctionObjects.so");
|
||||||
|
|
||||||
|
name generateAlphaSolid;
|
||||||
|
|
||||||
|
codeWrite
|
||||||
|
#{
|
||||||
|
const dimensionedVector dx(dimless/dimLength, vector(1, 0, 0));
|
||||||
|
const dimensionedVector dy(dimless/dimLength, vector(0, 1, 0));
|
||||||
|
|
||||||
|
const volScalarField x(mesh().C() & dx), y(mesh().C() & dy);
|
||||||
|
|
||||||
|
const scalar x0 = 0.032, x1 = 0.064, x2 = 0.128, x3 = 0.224;
|
||||||
|
const scalar y0 = -0.088, y1 = -0.056;
|
||||||
|
|
||||||
|
volScalarField alpha
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName("alpha", "solid"),
|
||||||
|
mesh().time().constant(),
|
||||||
|
mesh()
|
||||||
|
),
|
||||||
|
mesh(),
|
||||||
|
dimless,
|
||||||
|
zeroGradientFvPatchScalarField::typeName
|
||||||
|
);
|
||||||
|
|
||||||
|
alpha =
|
||||||
|
0.5
|
||||||
|
*(
|
||||||
|
pos(x - x0)*pos(x1 - x)*(x - x0)/(x1 - x0)
|
||||||
|
+ pos(x - x1)*pos(x2 - x)
|
||||||
|
+ pos(x - x2)*pos(x3 - x)*(x3 - x)/(x3 - x2)
|
||||||
|
)
|
||||||
|
*pos(y - y0)*pos(y1 - y);
|
||||||
|
|
||||||
|
alpha.write();
|
||||||
|
#};
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration | Website: https://openfoam.org
|
||||||
|
\\ / A nd | Version: dev
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Description
|
||||||
|
Solves a transport equation for a scalar field.
|
||||||
|
|
||||||
|
The name of the scalar field is specified in this file. A sample scalar
|
||||||
|
field file, that must be initialised for the case, typically in the 0
|
||||||
|
directory, is available in $FOAM_ETC/caseDicts/solvers/scalarTransport.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#includeEtc "caseDicts/postProcessing/solvers/scalarTransport/scalarTransport.cfg"
|
||||||
|
|
||||||
|
field tracer;
|
||||||
|
|
||||||
|
fvOptions
|
||||||
|
{
|
||||||
|
volumeFraction
|
||||||
|
{
|
||||||
|
type volumeFractionSource;
|
||||||
|
phase solid;
|
||||||
|
phi phi;
|
||||||
|
U U;
|
||||||
|
fields (tracer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user