Merge branch 'master' into cvm
Conflicts: applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C
This commit is contained in:
commit
e09a140a28
@ -6,7 +6,7 @@ autoPtr<psiChemistryModel> pChemistry
|
||||
);
|
||||
psiChemistryModel& chemistry = pChemistry();
|
||||
|
||||
hCombustionThermo& thermo = chemistry.thermo();
|
||||
hsCombustionThermo& thermo = chemistry.thermo();
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
@ -50,7 +50,7 @@ volVectorField U
|
||||
volScalarField& p = thermo.p();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
volScalarField& h = thermo.h();
|
||||
volScalarField& hs = thermo.hs();
|
||||
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
@ -92,4 +92,18 @@ forAll(Y, i)
|
||||
{
|
||||
fields.add(Y[i]);
|
||||
}
|
||||
fields.add(h);
|
||||
fields.add(hs);
|
||||
|
||||
DimensionedField<scalar, volMesh> chemistrySh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"chemistry::Sh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
|
||||
);
|
||||
|
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
dieselFoam
|
||||
dieselEngineFoam
|
||||
|
||||
Description
|
||||
Solver for diesel engine spray and combustion.
|
||||
@ -103,13 +103,15 @@ int main(int argc, char *argv[])
|
||||
kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk);
|
||||
}
|
||||
|
||||
chemistrySh = kappa*chemistry.Sh()();
|
||||
|
||||
#include "rhoEqn.H"
|
||||
#include "UEqn.H"
|
||||
|
||||
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
|
||||
{
|
||||
#include "YEqn.H"
|
||||
#include "hEqn.H"
|
||||
#include "hsEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
|
@ -1,13 +0,0 @@
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, h)
|
||||
+ mvConvection->fvmDiv(phi, h)
|
||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||
==
|
||||
DpDt
|
||||
+ dieselSpray.heatTransferSource()
|
||||
);
|
||||
|
||||
thermo.correct();
|
||||
}
|
14
applications/solvers/combustion/dieselEngineFoam/hsEqn.H
Normal file
14
applications/solvers/combustion/dieselEngineFoam/hsEqn.H
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, hs)
|
||||
+ mvConvection->fvmDiv(phi, hs)
|
||||
- fvm::laplacian(turbulence->alphaEff(), hs)
|
||||
==
|
||||
DpDt
|
||||
+ dieselSpray.heatTransferSource()().dimensionedInternalField()
|
||||
+ chemistrySh
|
||||
);
|
||||
|
||||
thermo.correct();
|
||||
}
|
@ -100,7 +100,7 @@ int main(int argc, char *argv[])
|
||||
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
|
||||
{
|
||||
#include "YEqn.H"
|
||||
#include "hEqn.H"
|
||||
#include "hsEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
|
8
applications/solvers/combustion/fireFoam/Allwclean
Executable file
8
applications/solvers/combustion/fireFoam/Allwclean
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso combustionModels
|
||||
wclean
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
8
applications/solvers/combustion/fireFoam/Allwmake
Executable file
8
applications/solvers/combustion/fireFoam/Allwmake
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
set -x
|
||||
|
||||
wmake libso combustionModels
|
||||
wmake
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
4
applications/solvers/combustion/fireFoam/Make/files
Normal file
4
applications/solvers/combustion/fireFoam/Make/files
Normal file
@ -0,0 +1,4 @@
|
||||
fireFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/fireFoam
|
||||
|
19
applications/solvers/combustion/fireFoam/Make/options
Normal file
19
applications/solvers/combustion/fireFoam/Make/options
Normal file
@ -0,0 +1,19 @@
|
||||
EXE_INC = \
|
||||
-I./combustionModels/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
-lcombustionModels \
|
||||
-lspecie \
|
||||
-lreactionThermophysicalModels \
|
||||
-lbasicThermophysicalModels \
|
||||
-lfiniteVolume \
|
||||
-lcompressibleLESModels \
|
||||
-lcompressibleRASModels \
|
||||
-lradiation
|
36
applications/solvers/combustion/fireFoam/UEqn.H
Normal file
36
applications/solvers/combustion/fireFoam/UEqn.H
Normal file
@ -0,0 +1,36 @@
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(phi, U)
|
||||
+ turbulence->divDevRhoReff(U)
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
if (oCorr == nOuterCorr - 1)
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
fvc::interpolate(rho)*(g & mesh.Sf())
|
||||
- fvc::snGrad(p)*mesh.magSf()
|
||||
),
|
||||
mesh.solver("UFinal")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
fvc::interpolate(rho)*(g & mesh.Sf())
|
||||
- fvc::snGrad(p)*mesh.magSf()
|
||||
)
|
||||
);
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
combustionModel/combustionModel.C
|
||||
combustionModel/newCombustionModel.C
|
||||
|
||||
infinitelyFastChemistry/infinitelyFastChemistry.C
|
||||
|
||||
noCombustion/noCombustion.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libcombustionModels
|
||||
|
@ -0,0 +1,11 @@
|
||||
EXE_INC = \
|
||||
-I../sensibleEnthalpyCombustionThermophysicalModels/basic/lnInclude \
|
||||
-I../sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(FOAM_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||
-I$(FOAM_SRC)/finiteVolume/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume
|
@ -0,0 +1,109 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "combustionModel.H"
|
||||
#include "fvm.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(combustionModel, 0);
|
||||
defineRunTimeSelectionTable(combustionModel, dictionary);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModel::combustionModel
|
||||
(
|
||||
const dictionary& combustionProperties,
|
||||
const hsCombustionThermo& thermo,
|
||||
const compressible::turbulenceModel& turbulence,
|
||||
const surfaceScalarField& phi,
|
||||
const volScalarField& rho
|
||||
)
|
||||
:
|
||||
combustionModelCoeffs_
|
||||
(
|
||||
combustionProperties.subDict
|
||||
(
|
||||
word(combustionProperties.lookup("combustionModel")) + "Coeffs"
|
||||
)
|
||||
),
|
||||
thermo_(thermo),
|
||||
turbulence_(turbulence),
|
||||
mesh_(phi.mesh()),
|
||||
phi_(phi),
|
||||
rho_(rho),
|
||||
stoicRatio_(thermo.lookup("stoichiometricAirFuelMassRatio")),
|
||||
s_(thermo.lookup("stoichiometricOxygenFuelMassRatio")),
|
||||
qFuel_(thermo_.lookup("qFuel")),
|
||||
composition_(thermo.composition())
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModel::~combustionModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::fvScalarMatrix>
|
||||
Foam::combustionModel::combustionModel::R(volScalarField& fu) const
|
||||
{
|
||||
const basicMultiComponentMixture& composition = thermo_.composition();
|
||||
const volScalarField& ft = composition.Y("ft");
|
||||
volScalarField fres = composition.fres(ft, stoicRatio_.value());
|
||||
volScalarField wFuelNorm = this->wFuelNorm()*pos(fu - fres);
|
||||
|
||||
return wFuelNorm*fres - fvm::Sp(wFuelNorm, fu);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::combustionModel::combustionModel::dQ
|
||||
(
|
||||
const fvScalarMatrix& Rfu
|
||||
) const
|
||||
{
|
||||
const basicMultiComponentMixture& composition = thermo_.composition();
|
||||
const volScalarField& fu = composition.Y("fu");
|
||||
|
||||
return (-qFuel_)*(Rfu & fu);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::combustionModel::read(const dictionary& combustionProperties)
|
||||
{
|
||||
combustionModelCoeffs_ = combustionProperties.subDict(type() + "Coeffs");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,210 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::combustionModel
|
||||
|
||||
Description
|
||||
Base class for all non-premixed combustion models.
|
||||
|
||||
SourceFiles
|
||||
combustionModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef combustionModel_H
|
||||
#define combustionModel_H
|
||||
|
||||
#include "IOdictionary.H"
|
||||
#include "hsCombustionThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "multivariateSurfaceInterpolationScheme.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class combustionModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class combustionModel
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Dictionary of coefficients for the particular model
|
||||
dictionary combustionModelCoeffs_;
|
||||
|
||||
//- Reference to the thermodynamic
|
||||
const hsCombustionThermo& thermo_;
|
||||
|
||||
//- Reference to the turbulence model
|
||||
const compressible::turbulenceModel& turbulence_;
|
||||
|
||||
//- Reference to the mesh database
|
||||
const fvMesh& mesh_;
|
||||
|
||||
//- Reference to mass-flux field
|
||||
const surfaceScalarField& phi_;
|
||||
|
||||
//- Reference to the density field
|
||||
const volScalarField& rho_;
|
||||
|
||||
//- Stoichiometric air-fuel mass ratio
|
||||
dimensionedScalar stoicRatio_;
|
||||
|
||||
//- Stoichiometric oxygen-fuel mass ratio
|
||||
dimensionedScalar s_;
|
||||
|
||||
//- Heat of combustion (J/Kg)
|
||||
dimensionedScalar qFuel_;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
combustionModel(const combustionModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const combustionModel&);
|
||||
|
||||
const basicMultiComponentMixture& composition_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("combustionModel");
|
||||
|
||||
|
||||
// Declare run-time constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
combustionModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& combustionProperties,
|
||||
const hsCombustionThermo& thermo,
|
||||
const compressible::turbulenceModel& turbulence,
|
||||
const surfaceScalarField& phi,
|
||||
const volScalarField& rho
|
||||
),
|
||||
(
|
||||
combustionProperties,
|
||||
thermo,
|
||||
turbulence,
|
||||
phi,
|
||||
rho
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected combustion model
|
||||
static autoPtr<combustionModel> New
|
||||
(
|
||||
const dictionary& combustionProperties,
|
||||
const hsCombustionThermo& thermo,
|
||||
const compressible::turbulenceModel& turbulence,
|
||||
const surfaceScalarField& phi,
|
||||
const volScalarField& rho
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
combustionModel
|
||||
(
|
||||
const dictionary& combustionProperties,
|
||||
const hsCombustionThermo& thermo,
|
||||
const compressible::turbulenceModel& turbulence,
|
||||
const surfaceScalarField& phi,
|
||||
const volScalarField& rho
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~combustionModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access functions
|
||||
|
||||
//- Access composition
|
||||
const basicMultiComponentMixture& composition() const
|
||||
{
|
||||
return composition_;
|
||||
}
|
||||
|
||||
//- Access combustion dictionary
|
||||
const dictionary combustionModelCoeffs() const
|
||||
{
|
||||
return combustionModelCoeffs_;
|
||||
}
|
||||
|
||||
//- Access heat of combustion
|
||||
const dimensionedScalar qFuel() const
|
||||
{
|
||||
return qFuel_;
|
||||
}
|
||||
|
||||
//- Return normalised consumption rate of (fu - fres)
|
||||
virtual tmp<volScalarField> wFuelNorm() const = 0;
|
||||
|
||||
//- Fuel consumption rate matrix i.e. source-term for the fuel equation
|
||||
virtual tmp<fvScalarMatrix> R(volScalarField& fu) const;
|
||||
|
||||
//- Heat-release rate calculated from the given
|
||||
// fuel consumption rate matrix
|
||||
virtual tmp<volScalarField> dQ(const fvScalarMatrix& Rfu) const;
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct() = 0;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& combustionProperties) = 0;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,67 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "combustionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::combustionModel> Foam::combustionModel::New
|
||||
(
|
||||
const dictionary& combustionProperties,
|
||||
const hsCombustionThermo& thermo,
|
||||
const compressible::turbulenceModel& turbulence,
|
||||
const surfaceScalarField& phi,
|
||||
const volScalarField& rho
|
||||
)
|
||||
{
|
||||
word combustionModelTypeName = combustionProperties.lookup
|
||||
(
|
||||
"combustionModel"
|
||||
);
|
||||
|
||||
Info<< "Selecting combustion model " << combustionModelTypeName << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(combustionModelTypeName);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"combustionModel::New"
|
||||
) << "Unknown combustionModel type "
|
||||
<< combustionModelTypeName << endl << endl
|
||||
<< "Valid combustionModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->toc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<combustionModel>
|
||||
(cstrIter()(combustionProperties, thermo, turbulence, phi, rho));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,94 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "infinitelyFastChemistry.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
defineTypeNameAndDebug(infinitelyFastChemistry, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
combustionModel,
|
||||
infinitelyFastChemistry,
|
||||
dictionary
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModels::infinitelyFastChemistry::infinitelyFastChemistry
|
||||
(
|
||||
const dictionary& combustionProperties,
|
||||
const hsCombustionThermo& thermo,
|
||||
const compressible::turbulenceModel& turbulence,
|
||||
const surfaceScalarField& phi,
|
||||
const volScalarField& rho
|
||||
)
|
||||
:
|
||||
combustionModel(combustionProperties, thermo, turbulence, phi, rho),
|
||||
C_(readScalar(combustionModelCoeffs_.lookup("C")))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModels::infinitelyFastChemistry::~infinitelyFastChemistry()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::combustionModels::infinitelyFastChemistry::correct()
|
||||
{}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::infinitelyFastChemistry::wFuelNorm() const
|
||||
{
|
||||
return rho_/(mesh_.time().deltaT()*C_);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::combustionModels::infinitelyFastChemistry::read
|
||||
(
|
||||
const dictionary& combustionProperties
|
||||
)
|
||||
{
|
||||
combustionModel::read(combustionProperties);
|
||||
combustionModelCoeffs_.lookup("C") >> C_ ;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,119 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::combustionModels::infinitelyFastChemistry
|
||||
|
||||
Description
|
||||
Simple infinitely fast chemistry combustion model based on the principle
|
||||
mixed is burnt. Additional parameter C is used to distribute the heat
|
||||
release rate.in time
|
||||
|
||||
SourceFiles
|
||||
infinitelyFastChemistry.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef infinitelyFastChemistry_H
|
||||
#define infinitelyFastChemistry_H
|
||||
|
||||
#include "fvc.H"
|
||||
#include "combustionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class infinitelyFastChemistry Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class infinitelyFastChemistry
|
||||
:
|
||||
public combustionModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Model constant
|
||||
scalar C_;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
infinitelyFastChemistry(const infinitelyFastChemistry&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const infinitelyFastChemistry&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("infinitelyFastChemistry");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
infinitelyFastChemistry
|
||||
(
|
||||
const dictionary& combustionProperties,
|
||||
const hsCombustionThermo& thermo,
|
||||
const compressible::turbulenceModel& turbulence,
|
||||
const surfaceScalarField& phi,
|
||||
const volScalarField& rho
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~infinitelyFastChemistry();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& combustionProperties);
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
//- Return normalised consumption rate of (fu - fres)
|
||||
virtual tmp<volScalarField> wFuelNorm() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace combustionModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,103 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "noCombustion.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
defineTypeNameAndDebug(noCombustion, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
combustionModel,
|
||||
noCombustion,
|
||||
dictionary
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModels::noCombustion::noCombustion
|
||||
(
|
||||
const dictionary& combustionProperties,
|
||||
const hsCombustionThermo& thermo,
|
||||
const compressible::turbulenceModel& turbulence,
|
||||
const surfaceScalarField& phi,
|
||||
const volScalarField& rho
|
||||
)
|
||||
:
|
||||
combustionModel(combustionProperties, thermo, turbulence, phi, rho)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::combustionModels::noCombustion::~noCombustion()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::combustionModels::noCombustion::correct()
|
||||
{}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::combustionModels::noCombustion::wFuelNorm() const
|
||||
{
|
||||
return tmp<Foam::volScalarField>
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"wFuelNorm",
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("wFuelNorm", dimMass/dimTime/pow3(dimLength), 0.0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::combustionModels::noCombustion::read
|
||||
(
|
||||
const dictionary& combustionProperties
|
||||
)
|
||||
{
|
||||
return combustionModel::read(combustionProperties);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,113 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::combustionModel::noCombustion
|
||||
|
||||
Description
|
||||
No combustion
|
||||
|
||||
SourceFiles
|
||||
noCombustion.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef noCombustion_H
|
||||
#define noCombustion_H
|
||||
|
||||
#include "combustionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace combustionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class noCombustion Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class noCombustion
|
||||
:
|
||||
public combustionModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
noCombustion(const noCombustion&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const noCombustion&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("noCombustion");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
noCombustion
|
||||
(
|
||||
const dictionary& combustionProperties,
|
||||
const hsCombustionThermo& thermo,
|
||||
const compressible::turbulenceModel& turbulence,
|
||||
const surfaceScalarField& phi,
|
||||
const volScalarField& rho
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~noCombustion();
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update properties from given dictionary
|
||||
virtual bool read(const dictionary& combustionProperties);
|
||||
|
||||
//- Correct combustion rate
|
||||
virtual void correct();
|
||||
|
||||
//- Return normalised consumption rate of (fu - fres)
|
||||
virtual tmp<volScalarField> wFuelNorm() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace combustionModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
130
applications/solvers/combustion/fireFoam/createFields.H
Normal file
130
applications/solvers/combustion/fireFoam/createFields.H
Normal file
@ -0,0 +1,130 @@
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
autoPtr<hsCombustionThermo> pThermo
|
||||
(
|
||||
hsCombustionThermo::New(mesh)
|
||||
);
|
||||
|
||||
hsCombustionThermo& thermo = pThermo();
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo.rho()
|
||||
);
|
||||
|
||||
dimensionedScalar stoicRatio
|
||||
(
|
||||
thermo.lookup("stoichiometricAirFuelMassRatio")
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
volScalarField& hs = thermo.hs();
|
||||
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
volScalarField& ft = composition.Y("ft");
|
||||
volScalarField& fu = composition.Y("fu");
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::turbulenceModel::New(rho, U, phi, thermo)
|
||||
);
|
||||
|
||||
IOdictionary combustionProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"combustionProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating combustion model\n" << endl;
|
||||
autoPtr<combustionModel::combustionModel> combustion
|
||||
(
|
||||
combustionModel::combustionModel::New
|
||||
(
|
||||
combustionProperties,
|
||||
thermo,
|
||||
turbulence(),
|
||||
phi,
|
||||
rho
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField dQ
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dQ",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("dQ", dimMass/pow3(dimTime)/dimLength, 0.0)
|
||||
);
|
||||
|
||||
|
||||
Info<< "Creating field DpDt\n" << endl;
|
||||
volScalarField DpDt =
|
||||
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
||||
|
||||
|
||||
Info<< "Calculating field g.h\n" << endl;
|
||||
volScalarField gh("gh", g & mesh.C());
|
||||
|
||||
surfaceScalarField ghf("gh", g & mesh.Cf());
|
||||
|
||||
p += rho*gh;
|
||||
|
||||
thermo.correct();
|
||||
|
||||
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
||||
|
||||
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
if (composition.contains("ft"))
|
||||
{
|
||||
fields.add(composition.Y("ft"));
|
||||
}
|
||||
|
||||
if (composition.contains("fu"))
|
||||
{
|
||||
fields.add(composition.Y("fu"));
|
||||
}
|
||||
|
||||
fields.add(hs);
|
103
applications/solvers/combustion/fireFoam/fireFoam.C
Normal file
103
applications/solvers/combustion/fireFoam/fireFoam.C
Normal file
@ -0,0 +1,103 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
fireFoam
|
||||
|
||||
Description
|
||||
Transient Solver for Fires and turbulent diffusion flames
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "hsCombustionThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "combustionModel.H"
|
||||
|
||||
#include "radiationModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createFields.H"
|
||||
#include "createRadiationModel.H"
|
||||
#include "readTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readPISOControls.H"
|
||||
#include "readTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
runTime++;
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
|
||||
{
|
||||
#include "UEqn.H"
|
||||
|
||||
#include "ftEqn.H"
|
||||
#include "fuhsEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=0; corr<nCorr; corr++)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
25
applications/solvers/combustion/fireFoam/ftEqn.H
Normal file
25
applications/solvers/combustion/fireFoam/ftEqn.H
Normal file
@ -0,0 +1,25 @@
|
||||
tmp<fv::convectionScheme<scalar> > mvConvection
|
||||
(
|
||||
fv::convectionScheme<scalar>::New
|
||||
(
|
||||
mesh,
|
||||
fields,
|
||||
phi,
|
||||
mesh.divScheme("div(phi,ft_b_h)")
|
||||
)
|
||||
);
|
||||
|
||||
{
|
||||
fvScalarMatrix ftEqn
|
||||
(
|
||||
fvm::ddt(rho, ft)
|
||||
+ mvConvection->fvmDiv(phi, ft)
|
||||
- fvm::laplacian(turbulence->alphaEff(), ft)
|
||||
);
|
||||
|
||||
ftEqn.relax();
|
||||
ftEqn.solve();
|
||||
}
|
||||
|
||||
Info<< "max(ft) = " << max(ft).value() << endl;
|
||||
Info<< "min(ft) = " << min(ft).value() << endl;
|
47
applications/solvers/combustion/fireFoam/fuhsEqn.H
Normal file
47
applications/solvers/combustion/fireFoam/fuhsEqn.H
Normal file
@ -0,0 +1,47 @@
|
||||
{
|
||||
// Solve fuel equation
|
||||
// ~~~~~~~~~~~~~~~~~~~
|
||||
fvScalarMatrix R = combustion->R(fu);
|
||||
|
||||
{
|
||||
fvScalarMatrix fuEqn
|
||||
(
|
||||
fvm::ddt(rho, fu)
|
||||
+ mvConvection->fvmDiv(phi, fu)
|
||||
- fvm::laplacian(turbulence->alphaEff(), fu)
|
||||
==
|
||||
R
|
||||
);
|
||||
|
||||
fuEqn.relax();
|
||||
fuEqn.solve();
|
||||
}
|
||||
|
||||
Info<< "max(fu) = " << max(fu).value() << endl;
|
||||
Info<< "min(fu) = " << min(fu).value() << endl;
|
||||
|
||||
|
||||
// Solve sensible enthalpy equation
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
radiation->correct();
|
||||
dQ = combustion->dQ(R);
|
||||
|
||||
{
|
||||
fvScalarMatrix hsEqn
|
||||
(
|
||||
fvm::ddt(rho, hs)
|
||||
+ mvConvection->fvmDiv(phi,hs)
|
||||
- fvm::laplacian(turbulence->alphaEff(), hs)
|
||||
==
|
||||
DpDt
|
||||
+ dQ
|
||||
+ radiation->Shs(thermo)
|
||||
);
|
||||
|
||||
hsEqn.relax();
|
||||
hsEqn.solve();
|
||||
}
|
||||
|
||||
thermo.correct();
|
||||
combustion->correct();
|
||||
}
|
64
applications/solvers/combustion/fireFoam/pEqn.H
Normal file
64
applications/solvers/combustion/fireFoam/pEqn.H
Normal file
@ -0,0 +1,64 @@
|
||||
bool closedVolume = false;
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
volScalarField rUA = 1.0/UEqn.A();
|
||||
surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
|
||||
U = rUA*UEqn.H();
|
||||
|
||||
surfaceScalarField phiU
|
||||
(
|
||||
fvc::interpolate(rho)
|
||||
*(
|
||||
(fvc::interpolate(U) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
||||
)
|
||||
);
|
||||
|
||||
phi = phiU + rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
surfaceScalarField rhorUAf = fvc::interpolate(rho*rUA);
|
||||
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi,p)
|
||||
+ fvc::div(phi)
|
||||
- fvm::laplacian(rhorUAf, p)
|
||||
);
|
||||
|
||||
closedVolume = p.needReference();
|
||||
|
||||
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
|
||||
{
|
||||
pEqn.solve(mesh.solver(p.name() + "Final"));
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve(mesh.solver(p.name()));
|
||||
}
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
}
|
||||
|
||||
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
||||
|
||||
#include "rhoEqn.H"
|
||||
#include "compressibleContinuityErrs.H"
|
||||
|
||||
U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf);
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
// For closed-volume cases adjust the pressure and density levels
|
||||
// to obey overall mass continuity
|
||||
if (closedVolume)
|
||||
{
|
||||
p +=
|
||||
(initialMass - fvc::domainIntegrate(thermo.psi()*p))
|
||||
/fvc::domainIntegrate(thermo.psi());
|
||||
rho = thermo.rho();
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
EXE_INC = \
|
||||
-I../XiFoam \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
|
15
applications/solvers/combustion/reactingFoam/UEqn.H
Normal file
15
applications/solvers/combustion/reactingFoam/UEqn.H
Normal file
@ -0,0 +1,15 @@
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(phi, U)
|
||||
+ turbulence->divDevRhoReff(U)
|
||||
==
|
||||
rho*g
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
if (momentumPredictor)
|
||||
{
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
}
|
@ -21,4 +21,6 @@
|
||||
{
|
||||
kappa = 1.0;
|
||||
}
|
||||
|
||||
chemistrySh = kappa*chemistry.Sh()();
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ autoPtr<psiChemistryModel> pChemistry
|
||||
);
|
||||
psiChemistryModel& chemistry = pChemistry();
|
||||
|
||||
hCombustionThermo& thermo = chemistry.thermo();
|
||||
hsCombustionThermo& thermo = chemistry.thermo();
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
@ -40,8 +40,8 @@ volVectorField U
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
volScalarField& h = thermo.h();
|
||||
|
||||
volScalarField& hs = thermo.hs();
|
||||
const volScalarField& T = thermo.T();
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
@ -81,5 +81,18 @@ forAll(Y, i)
|
||||
{
|
||||
fields.add(Y[i]);
|
||||
}
|
||||
fields.add(h);
|
||||
fields.add(hs);
|
||||
|
||||
DimensionedField<scalar, volMesh> chemistrySh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"chemistry::Sh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
|
||||
);
|
||||
|
20
applications/solvers/combustion/reactingFoam/hsEqn.H
Normal file
20
applications/solvers/combustion/reactingFoam/hsEqn.H
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
fvScalarMatrix hsEqn
|
||||
(
|
||||
fvm::ddt(rho, hs)
|
||||
+ mvConvection->fvmDiv(phi, hs)
|
||||
- fvm::laplacian(turbulence->alphaEff(), hs)
|
||||
// - fvm::laplacian(turbulence->muEff(), hs) // unit lewis no.
|
||||
==
|
||||
DpDt
|
||||
+ chemistrySh
|
||||
);
|
||||
|
||||
hsEqn.relax();
|
||||
hsEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
|
||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||
<< max(T).value() << endl;
|
||||
}
|
68
applications/solvers/combustion/reactingFoam/pEqn.H
Normal file
68
applications/solvers/combustion/reactingFoam/pEqn.H
Normal file
@ -0,0 +1,68 @@
|
||||
rho = thermo.rho();
|
||||
|
||||
volScalarField rUA = 1.0/UEqn.A();
|
||||
U = rUA*UEqn.H();
|
||||
|
||||
if (transonic)
|
||||
{
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(
|
||||
(fvc::interpolate(U) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
||||
)
|
||||
);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvm::div(phid, p)
|
||||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi == pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
phi =
|
||||
fvc::interpolate(rho)
|
||||
*(
|
||||
(fvc::interpolate(U) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
||||
);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvc::div(phi)
|
||||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "rhoEqn.H"
|
||||
#include "compressibleContinuityErrs.H"
|
||||
|
||||
U -= rUA*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
@ -73,9 +73,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "YEqn.H"
|
||||
|
||||
#define Db turbulence->alphaEff()
|
||||
#include "hEqn.H"
|
||||
#include "hsEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
|
@ -1,5 +1,4 @@
|
||||
EXE_INC = \
|
||||
-I../XiFoam \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
|
15
applications/solvers/combustion/rhoReactingFoam/UEqn.H
Normal file
15
applications/solvers/combustion/rhoReactingFoam/UEqn.H
Normal file
@ -0,0 +1,15 @@
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(phi, U)
|
||||
+ turbulence->divDevRhoReff(U)
|
||||
==
|
||||
rho*g
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
if (momentumPredictor)
|
||||
{
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
}
|
@ -21,4 +21,6 @@
|
||||
{
|
||||
kappa = 1.0;
|
||||
}
|
||||
|
||||
chemistrySh = kappa*chemistry.Sh()();
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ autoPtr<rhoChemistryModel> pChemistry
|
||||
);
|
||||
rhoChemistryModel& chemistry = pChemistry();
|
||||
|
||||
hReactionThermo& thermo = chemistry.thermo();
|
||||
hsReactionThermo& thermo = chemistry.thermo();
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
@ -40,7 +40,8 @@ volVectorField U
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
volScalarField& h = thermo.h();
|
||||
volScalarField& hs = thermo.hs();
|
||||
const volScalarField& T = thermo.T();
|
||||
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
@ -81,5 +82,18 @@ forAll(Y, i)
|
||||
{
|
||||
fields.add(Y[i]);
|
||||
}
|
||||
fields.add(h);
|
||||
fields.add(hs);
|
||||
|
||||
DimensionedField<scalar, volMesh> chemistrySh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"chemistry::Sh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
|
||||
);
|
||||
|
19
applications/solvers/combustion/rhoReactingFoam/hsEqn.H
Normal file
19
applications/solvers/combustion/rhoReactingFoam/hsEqn.H
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
fvScalarMatrix hsEqn
|
||||
(
|
||||
fvm::ddt(rho, hs)
|
||||
+ mvConvection->fvmDiv(phi, hs)
|
||||
- fvm::laplacian(turbulence->alphaEff(), hs)
|
||||
==
|
||||
DpDt
|
||||
+ chemistrySh
|
||||
);
|
||||
|
||||
hsEqn.relax();
|
||||
hsEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
|
||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||
<< max(T).value() << endl;
|
||||
}
|
@ -74,7 +74,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "YEqn.H"
|
||||
#include "hEqn.H"
|
||||
#include "hsEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
|
@ -22,4 +22,6 @@
|
||||
{
|
||||
kappa = 1.0;
|
||||
}
|
||||
|
||||
chemistrySh = kappa*chemistry.Sh()();
|
||||
}
|
||||
|
@ -84,16 +84,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
coalParcels.evolve();
|
||||
|
||||
coalParcels.info();
|
||||
|
||||
Info<< endl;
|
||||
|
||||
limestoneParcels.evolve();
|
||||
|
||||
limestoneParcels.info();
|
||||
|
||||
Info<< endl;
|
||||
|
||||
#include "chemistry.H"
|
||||
#include "rhoEqn.H"
|
||||
|
||||
@ -102,16 +94,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "YEqn.H"
|
||||
#include "hEqn.H"
|
||||
#include "hsEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||
<< max(T).value() << endl;
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
@ -6,7 +6,7 @@
|
||||
);
|
||||
psiChemistryModel& chemistry = pChemistry();
|
||||
|
||||
hCombustionThermo& thermo = chemistry.thermo();
|
||||
hsCombustionThermo& thermo = chemistry.thermo();
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
@ -22,7 +22,7 @@
|
||||
}
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
volScalarField& h = thermo.h();
|
||||
volScalarField& hs = thermo.hs();
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
{
|
||||
fields.add(Y[i]);
|
||||
}
|
||||
fields.add(h);
|
||||
fields.add(hs);
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
@ -133,5 +133,19 @@
|
||||
"energy",
|
||||
mesh,
|
||||
dimEnergy/dimTime/dimVolume,
|
||||
"h"
|
||||
"hs"
|
||||
);
|
||||
|
||||
DimensionedField<scalar, volMesh> chemistrySh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"chemistry::Sh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
|
||||
);
|
||||
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
fvScalarMatrix hEqn
|
||||
(
|
||||
fvm::ddt(rho, h)
|
||||
+ mvConvection->fvmDiv(phi, h)
|
||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||
==
|
||||
DpDt
|
||||
+ coalParcels.Sh()
|
||||
+ limestoneParcels.Sh()
|
||||
+ enthalpySource.Su()
|
||||
+ radiation->Sh(thermo)
|
||||
);
|
||||
|
||||
hEqn.relax();
|
||||
|
||||
hEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
|
||||
radiation->correct();
|
||||
}
|
26
applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H
Normal file
26
applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
fvScalarMatrix hsEqn
|
||||
(
|
||||
fvm::ddt(rho, hs)
|
||||
+ mvConvection->fvmDiv(phi, hs)
|
||||
- fvm::laplacian(turbulence->alphaEff(), hs)
|
||||
==
|
||||
DpDt
|
||||
+ coalParcels.Sh()
|
||||
+ limestoneParcels.Sh()
|
||||
+ enthalpySource.Su()
|
||||
+ radiation->Shs(thermo)
|
||||
+ chemistrySh
|
||||
);
|
||||
|
||||
hsEqn.relax();
|
||||
|
||||
hsEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
|
||||
radiation->correct();
|
||||
|
||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||
<< max(T).value() << endl;
|
||||
}
|
@ -22,4 +22,6 @@
|
||||
{
|
||||
kappa = 1.0;
|
||||
}
|
||||
|
||||
chemistrySh = kappa*chemistry.Sh()();
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
);
|
||||
rhoChemistryModel& chemistry = pChemistry();
|
||||
|
||||
hReactionThermo& thermo = chemistry.thermo();
|
||||
hsReactionThermo& thermo = chemistry.thermo();
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
@ -22,7 +22,7 @@
|
||||
}
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
volScalarField& h = thermo.h();
|
||||
volScalarField& hs = thermo.hs();
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
@ -88,4 +88,18 @@
|
||||
{
|
||||
fields.add(Y[i]);
|
||||
}
|
||||
fields.add(h);
|
||||
fields.add(hs);
|
||||
|
||||
DimensionedField<scalar, volMesh> chemistrySh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"chemistry::Sh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
|
||||
);
|
||||
|
@ -32,14 +32,15 @@
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, h)
|
||||
+ mvConvection->fvmDiv(phi, h)
|
||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||
fvm::ddt(rho, hs)
|
||||
+ mvConvection->fvmDiv(phi, hs)
|
||||
- fvm::laplacian(turbulence->alphaEff(), hs)
|
||||
==
|
||||
pWork()
|
||||
+ parcels.Sh()
|
||||
+ radiation->Sh(thermo)
|
||||
+ radiation->Shs(thermo)
|
||||
+ energySource.Su()
|
||||
+ chemistrySh
|
||||
);
|
||||
|
||||
thermo.correct();
|
@ -33,7 +33,7 @@ Description
|
||||
The solver includes:
|
||||
- reacting multiphase parcel cloud
|
||||
- porous media
|
||||
- point mass sources
|
||||
- mass, momentum and energy sources
|
||||
- polynomial based, incompressible thermodynamics (f(T))
|
||||
|
||||
Note: ddtPhiCorr not used here when porous zones are active
|
||||
@ -89,13 +89,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
parcels.evolve();
|
||||
|
||||
parcels.info();
|
||||
|
||||
#include "chemistry.H"
|
||||
#include "rhoEqn.H"
|
||||
#include "UEqn.H"
|
||||
#include "YEqn.H"
|
||||
#include "hEqn.H"
|
||||
#include "hsEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=0; corr<nCorr; corr++)
|
||||
|
@ -22,4 +22,6 @@
|
||||
{
|
||||
kappa = 1.0;
|
||||
}
|
||||
|
||||
chemistrySh = kappa*chemistry.Sh()();
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
);
|
||||
psiChemistryModel& chemistry = pChemistry();
|
||||
|
||||
hCombustionThermo& thermo = chemistry.thermo();
|
||||
hsCombustionThermo& thermo = chemistry.thermo();
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
@ -22,7 +22,7 @@
|
||||
}
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
volScalarField& h = thermo.h();
|
||||
volScalarField& hs = thermo.hs();
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
@ -94,4 +94,18 @@
|
||||
{
|
||||
fields.add(Y[i]);
|
||||
}
|
||||
fields.add(h);
|
||||
fields.add(hs);
|
||||
|
||||
DimensionedField<scalar, volMesh> chemistrySh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"chemistry::Sh",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("chemistry::Sh", dimEnergy/dimTime/dimVolume, 0.0)
|
||||
);
|
||||
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
fvScalarMatrix hEqn
|
||||
(
|
||||
fvm::ddt(rho, h)
|
||||
+ mvConvection->fvmDiv(phi, h)
|
||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||
==
|
||||
DpDt
|
||||
+ parcels.Sh()
|
||||
+ radiation->Sh(thermo)
|
||||
);
|
||||
|
||||
hEqn.relax();
|
||||
|
||||
hEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
|
||||
radiation->correct();
|
||||
}
|
24
applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H
Normal file
24
applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
fvScalarMatrix hEqn
|
||||
(
|
||||
fvm::ddt(rho, hs)
|
||||
+ mvConvection->fvmDiv(phi, hs)
|
||||
- fvm::laplacian(turbulence->alphaEff(), hs)
|
||||
==
|
||||
DpDt
|
||||
+ parcels.Sh()
|
||||
+ radiation->Shs(thermo)
|
||||
+ chemistrySh
|
||||
);
|
||||
|
||||
hEqn.relax();
|
||||
|
||||
hEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
|
||||
radiation->correct();
|
||||
|
||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||
<< max(T).value() << endl;
|
||||
}
|
@ -74,8 +74,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
parcels.evolve();
|
||||
|
||||
parcels.info();
|
||||
|
||||
#include "chemistry.H"
|
||||
#include "rhoEqn.H"
|
||||
|
||||
@ -88,12 +86,9 @@ int main(int argc, char *argv[])
|
||||
// --- PISO loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
{
|
||||
#include "hEqn.H"
|
||||
#include "hsEqn.H"
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||
<< max(T).value() << endl;
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
@ -61,7 +61,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Evolving " << kinematicCloud.name() << endl;
|
||||
kinematicCloud.evolve();
|
||||
kinematicCloud.info();
|
||||
|
||||
runTime.write();
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -90,7 +90,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (args.optionFound("flag"))
|
||||
{
|
||||
Info<<"-flag:" << args.option("flag") << endl;
|
||||
Info<<"-flag:" << args["flag"] << endl;
|
||||
}
|
||||
|
||||
if (args.optionReadIfPresent<scalar>("float", xxx))
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -109,10 +109,8 @@ int main(int argc, char *argv[])
|
||||
argList::validArgs.append("ODESolver");
|
||||
argList args(argc, argv);
|
||||
|
||||
word ODESolverName(args.additionalArgs()[0]);
|
||||
|
||||
testODE ode;
|
||||
autoPtr<ODESolver> odeSolver = ODESolver::New(ODESolverName, ode);
|
||||
autoPtr<ODESolver> odeSolver = ODESolver::New(args[1], ode);
|
||||
|
||||
scalar xStart = 1.0;
|
||||
scalarField yStart(ode.nEqns());
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -130,15 +130,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
else if (args.additionalArgs().empty())
|
||||
else if (args.size() <= 1)
|
||||
{
|
||||
args.printUsage();
|
||||
}
|
||||
|
||||
|
||||
forAll(args.additionalArgs(), argI)
|
||||
for (label argI=1; argI < args.size(); ++argI)
|
||||
{
|
||||
const string& srcFile = args.additionalArgs()[argI];
|
||||
const string& srcFile = args[argI];
|
||||
Info<< nl << "reading " << srcFile << nl;
|
||||
|
||||
IFstream ifs(srcFile);
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -51,7 +51,7 @@ int main(int argc, char *argv[])
|
||||
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
|
||||
<< endl;
|
||||
|
||||
if (args.additionalArgs().empty())
|
||||
if (args.size() <= 1)
|
||||
{
|
||||
{
|
||||
dictionary dict1(IFstream("testDict")());
|
||||
@ -114,9 +114,9 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
IOobject::writeDivider(Info);
|
||||
forAll(args.additionalArgs(), argI)
|
||||
for (label argI=1; argI < args.size(); ++argI)
|
||||
{
|
||||
const string& dictFile = args.additionalArgs()[argI];
|
||||
const string& dictFile = args[argI];
|
||||
IFstream is(dictFile);
|
||||
|
||||
dictionary dict(is);
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -70,7 +70,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
argList args(argc, argv, false, true);
|
||||
|
||||
if (args.additionalArgs().empty() && args.options().empty())
|
||||
if (args.size() <= 1 && args.options().empty())
|
||||
{
|
||||
args.printUsage();
|
||||
}
|
||||
@ -90,9 +90,9 @@ int main(int argc, char *argv[])
|
||||
printCleaning(pathName);
|
||||
}
|
||||
|
||||
forAll(args.additionalArgs(), argI)
|
||||
for (label argI=1; argI < args.size(); ++argI)
|
||||
{
|
||||
pathName = args.additionalArgs()[argI];
|
||||
pathName = args[argI];
|
||||
printCleaning(pathName);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,7 +45,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
point sample(IStringStream(args.additionalArgs()[0])());
|
||||
const point sample = args.argRead<point>(1);
|
||||
|
||||
treeBoundBox meshBb(mesh.points());
|
||||
|
||||
@ -82,8 +82,8 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
Info<< "Point:" << sample << " is in shape "
|
||||
<< oc.find(sample) << endl;
|
||||
Info<< "Point:" << sample << " is in cell "
|
||||
<< oc.find(sample) << nl
|
||||
<< "Point:" << sample << " is in cell "
|
||||
<< mesh.findCell(sample) << endl;
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,20 +45,20 @@ int main(int argc, char *argv[])
|
||||
|
||||
argList args(argc, argv, false, true);
|
||||
|
||||
if (args.additionalArgs().empty())
|
||||
if (args.size() <= 1)
|
||||
{
|
||||
args.printUsage();
|
||||
}
|
||||
|
||||
label ok = 0;
|
||||
|
||||
forAll(args.additionalArgs(), argI)
|
||||
for (label argI=1; argI < args.size(); ++argI)
|
||||
{
|
||||
const string& srcFile = args.additionalArgs()[argI];
|
||||
const string& srcFile = args[argI];
|
||||
|
||||
if (args.optionFound("ext"))
|
||||
{
|
||||
if (mvBak(srcFile, args.option("ext")))
|
||||
if (mvBak(srcFile, args["ext"]))
|
||||
{
|
||||
ok++;
|
||||
}
|
||||
@ -72,7 +72,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "mvBak called for " << args.additionalArgs().size()
|
||||
Info<< "mvBak called for " << args.size()-1
|
||||
<< " files (moved " << ok << ")\n" << endl;
|
||||
|
||||
return 0;
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -43,7 +43,7 @@ int main(int argc, char *argv[])
|
||||
#include "createMesh.H"
|
||||
runTime.functionObjects().off();
|
||||
|
||||
const word cloudName(args.additionalArgs()[0]);
|
||||
const word cloudName = args[1];
|
||||
|
||||
{
|
||||
// Start with empty cloud
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -221,7 +221,7 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
# include "createPolyMesh.H"
|
||||
|
||||
word patchName(args.additionalArgs()[0]);
|
||||
const word patchName = args[1];
|
||||
|
||||
label patchI = mesh.boundaryMesh().findPatchID(patchName);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,20 +42,15 @@ int main(int argc, char *argv[])
|
||||
argList args(argc, argv);
|
||||
|
||||
fileName thermoFileName = fileName::null;
|
||||
if (args.options().found("thermo"))
|
||||
{
|
||||
thermoFileName = args.options()["thermo"];
|
||||
}
|
||||
args.optionReadIfPresent("thermo", thermoFileName);
|
||||
|
||||
fileName CHEMKINFileName(args.additionalArgs()[0]);
|
||||
chemkinReader ck(args[1], thermoFileName);
|
||||
|
||||
chemkinReader ck(CHEMKINFileName, thermoFileName);
|
||||
|
||||
//Info<< ck.isotopeAtomicWts() << endl;
|
||||
//Info<< ck.specieNames() << endl;
|
||||
//Info<< ck.speciePhase() << endl;
|
||||
//Info<< ck.specieThermo() << endl;
|
||||
//Info<< ck.reactions() << endl;
|
||||
//Info<< ck.isotopeAtomicWts() << nl
|
||||
// << ck.specieNames() << nl
|
||||
// << ck.speciePhase() << nl
|
||||
// << ck.specieThermo() << nl
|
||||
// << ck.reactions() << endl;
|
||||
|
||||
const SLPtrList<gasReaction>& reactions = ck.reactions();
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
argList args(argc, argv, false, true);
|
||||
|
||||
if (args.additionalArgs().empty())
|
||||
if (args.size() <= 1)
|
||||
{
|
||||
args.printUsage();
|
||||
}
|
||||
@ -73,9 +73,9 @@ int main(int argc, char *argv[])
|
||||
useCatmullRom = true;
|
||||
}
|
||||
|
||||
forAll(args.additionalArgs(), argI)
|
||||
for (label argI=1; argI < args.size(); ++argI)
|
||||
{
|
||||
const string& srcFile = args.additionalArgs()[argI];
|
||||
const string& srcFile = args[argI];
|
||||
Info<< nl << "reading " << srcFile << nl;
|
||||
IFstream ifs(srcFile);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -51,7 +51,7 @@ int main(int argc, char *argv[])
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
// Get name of patch
|
||||
word patchName(args.additionalArgs()[0]);
|
||||
const word patchName = args[1];
|
||||
|
||||
// Find the label in patches by name.
|
||||
label patchI = patches.findPatchID(patchName);
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -54,9 +54,9 @@ int main(int argc, char *argv[])
|
||||
cpuTime timer;
|
||||
for (label count = 0; count < repeat; ++count)
|
||||
{
|
||||
forAll(args.additionalArgs(), argI)
|
||||
for (label argI=1; argI < args.size(); ++argI)
|
||||
{
|
||||
const string& rawArg = args.additionalArgs()[argI];
|
||||
const string& rawArg = args[argI];
|
||||
if (count == 0)
|
||||
{
|
||||
Info<< "input string: " << rawArg << nl;
|
||||
@ -94,11 +94,11 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
for (label count = 0; count < repeat; ++count)
|
||||
{
|
||||
IFstream is(args.option("file"));
|
||||
IFstream is(args["file"]);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
Info<< "tokenizing file: " << args.option("file") << nl;
|
||||
Info<< "tokenizing file: " << args["file"] << nl;
|
||||
}
|
||||
|
||||
while (is.good())
|
||||
|
@ -17,7 +17,7 @@ FoamFile
|
||||
|
||||
|
||||
// Surface to keep to
|
||||
surface "plexi.ftr";
|
||||
surface "plexi.obj";
|
||||
|
||||
// What is outside. These points have to be inside a cell (so not on a face!)
|
||||
outsidePoints ((-0.99001 -0.99001 -0.99001));
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -453,8 +453,8 @@ label simplifyFaces
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "addOverwriteOption.H"
|
||||
argList::noParallel();
|
||||
argList::addBoolOption("overwrite");
|
||||
argList::validArgs.append("edge length [m]");
|
||||
argList::validArgs.append("merge angle (degrees)");
|
||||
|
||||
@ -464,9 +464,9 @@ int main(int argc, char *argv[])
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
|
||||
bool overwrite = args.optionFound("overwrite");
|
||||
const scalar minLen = args.argRead<scalar>(1);
|
||||
const scalar angle = args.argRead<scalar>(2);
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
scalar maxCos = Foam::cos(degToRad(angle));
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -428,10 +428,17 @@ label mergeEdges(const scalar minCos, polyMesh& mesh)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "addOverwriteOption.H"
|
||||
|
||||
argList::validArgs.append("feature angle [0..180]");
|
||||
argList::addOption("concaveAngle", "[0..180]");
|
||||
argList::addOption
|
||||
(
|
||||
"concaveAngle",
|
||||
"[0..180]",
|
||||
"specify concave angle [0..180] degrees (default: 30.0 degrees)"
|
||||
);
|
||||
|
||||
argList::addBoolOption("snapMesh");
|
||||
argList::addBoolOption("overwrite");
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
@ -439,18 +446,16 @@ int main(int argc, char *argv[])
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
|
||||
scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
const scalar featureAngle = args.argRead<scalar>(1);
|
||||
const scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
|
||||
// Sin of angle between two consecutive edges on a face.
|
||||
// If sin(angle) larger than this the face will be considered concave.
|
||||
scalar concaveAngle = args.optionLookupOrDefault("concaveAngle", 30.0);
|
||||
|
||||
scalar concaveSin = Foam::sin(degToRad(concaveAngle));
|
||||
|
||||
bool snapMeshDict = args.optionFound("snapMesh");
|
||||
bool overwrite = args.optionFound("overwrite");
|
||||
const bool snapMeshDict = args.optionFound("snapMesh");
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
Info<< "Merging all faces of a cell" << nl
|
||||
<< " - which are on the same patch" << nl
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -328,7 +328,7 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addBoolOption("overwrite");
|
||||
# include "addOverwriteOption.H"
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
@ -336,7 +336,7 @@ int main(int argc, char *argv[])
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
bool overwrite = args.optionFound("overwrite");
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
Info<< "Reading modifyMeshDict\n" << endl;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -52,8 +52,9 @@ using namespace Foam;
|
||||
// Main program:
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addBoolOption("overwrite");
|
||||
# include "addOverwriteOption.H"
|
||||
argList::validArgs.append("cellSet");
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
@ -63,7 +64,7 @@ int main(int argc, char *argv[])
|
||||
pointMesh pMesh(mesh);
|
||||
|
||||
word cellSetName(args.args()[1]);
|
||||
bool overwrite = args.optionFound("overwrite");
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
Info<< "Reading cells to refine from cellSet " << cellSetName
|
||||
<< nl << endl;
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,12 +47,12 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "addOverwriteOption.H"
|
||||
argList::noParallel();
|
||||
argList::validArgs.append("patchName");
|
||||
argList::validArgs.append("edgeWeight");
|
||||
|
||||
argList::addOption("useSet", "cellSet");
|
||||
argList::addBoolOption("overwrite");
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
@ -60,11 +60,9 @@ int main(int argc, char *argv[])
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
word patchName(args.additionalArgs()[0]);
|
||||
|
||||
scalar weight(readScalar(IStringStream(args.additionalArgs()[1])()));
|
||||
bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
const word patchName = args[1];
|
||||
const scalar weight = args.argRead<scalar>(2);
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
label patchID = mesh.boundaryMesh().findPatchID(patchName);
|
||||
|
||||
@ -103,20 +101,17 @@ int main(int argc, char *argv[])
|
||||
// List of cells to refine
|
||||
//
|
||||
|
||||
bool useSet = args.optionFound("useSet");
|
||||
|
||||
if (useSet)
|
||||
word setName;
|
||||
if (args.optionReadIfPresent("useSet", setName))
|
||||
{
|
||||
word setName(args.option("useSet"));
|
||||
|
||||
Info<< "Subsetting cells to cut based on cellSet" << setName << endl
|
||||
<< endl;
|
||||
Info<< "Subsetting cells to cut based on cellSet"
|
||||
<< setName << nl << endl;
|
||||
|
||||
cellSet cells(mesh, setName);
|
||||
|
||||
Info<< "Read " << cells.size() << " cells from cellSet "
|
||||
<< cells.instance()/cells.local()/cells.name()
|
||||
<< endl << endl;
|
||||
<< nl << endl;
|
||||
|
||||
for
|
||||
(
|
||||
@ -127,8 +122,8 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
cutCells.erase(iter.key());
|
||||
}
|
||||
Info<< "Removed from cells to cut all the ones not in set " << setName
|
||||
<< endl << endl;
|
||||
Info<< "Removed from cells to cut all the ones not in set "
|
||||
<< setName << nl << endl;
|
||||
}
|
||||
|
||||
// Mark all meshpoints on patch
|
||||
@ -182,9 +177,9 @@ int main(int argc, char *argv[])
|
||||
allCutEdges.shrink();
|
||||
allCutEdgeWeights.shrink();
|
||||
|
||||
Info<< "Cutting:" << endl
|
||||
<< " cells:" << cutCells.size() << endl
|
||||
<< " edges:" << allCutEdges.size() << endl
|
||||
Info<< "Cutting:" << nl
|
||||
<< " cells:" << cutCells.size() << nl
|
||||
<< " edges:" << allCutEdges.size() << nl
|
||||
<< endl;
|
||||
|
||||
// Transfer DynamicLists to straight ones.
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -48,7 +48,7 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addBoolOption("overwrite");
|
||||
# include "addOverwriteOption.H"
|
||||
argList::validArgs.append("faceSet");
|
||||
|
||||
# include "setRootCase.H"
|
||||
@ -57,9 +57,8 @@ int main(int argc, char *argv[])
|
||||
# include "createMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
word setName(args.additionalArgs()[0]);
|
||||
const word setName = args[1];
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
// Read faces
|
||||
faceSet candidateSet(mesh, setName);
|
||||
|
@ -21,7 +21,7 @@ FoamFile
|
||||
useSurface false;
|
||||
|
||||
// Surface to keep to
|
||||
surface "plexi.ftr";
|
||||
surface "plexi.obj";
|
||||
|
||||
// What is outside
|
||||
outsidePoints ((-1 -1 -1));
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -524,11 +524,11 @@ void collectCuts
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "addOverwriteOption.H"
|
||||
argList::noParallel();
|
||||
argList::addOption("set", "cellSet name");
|
||||
argList::addBoolOption("geometry");
|
||||
argList::addOption("tol", "edge snap tolerance");
|
||||
argList::addBoolOption("overwrite");
|
||||
argList::validArgs.append("edge angle [0..360]");
|
||||
|
||||
# include "setRootCase.H"
|
||||
@ -537,14 +537,13 @@ int main(int argc, char *argv[])
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
const scalar featureAngle = args.argRead<scalar>(1);
|
||||
const scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
const scalar minSin = Foam::sin(degToRad(featureAngle));
|
||||
|
||||
scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
scalar minSin = Foam::sin(degToRad(featureAngle));
|
||||
|
||||
bool readSet = args.optionFound("set");
|
||||
bool geometry = args.optionFound("geometry");
|
||||
bool overwrite = args.optionFound("overwrite");
|
||||
const bool readSet = args.optionFound("set");
|
||||
const bool geometry = args.optionFound("geometry");
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
scalar edgeTol = args.optionLookupOrDefault("tol", 0.2);
|
||||
|
||||
@ -553,7 +552,7 @@ int main(int argc, char *argv[])
|
||||
<< "edge snapping tol : " << edgeTol << nl;
|
||||
if (readSet)
|
||||
{
|
||||
Info<< "candidate cells : cellSet " << args.option("set") << nl;
|
||||
Info<< "candidate cells : cellSet " << args["set"] << nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -581,7 +580,7 @@ int main(int argc, char *argv[])
|
||||
if (readSet)
|
||||
{
|
||||
// Read cells to cut from cellSet
|
||||
cellSet cells(mesh, args.option("set"));
|
||||
cellSet cells(mesh, args["set"]);
|
||||
|
||||
cellsToCut = cells;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -615,7 +615,7 @@ int main(int argc, char *argv[])
|
||||
wordList foamPatchNames;
|
||||
|
||||
{
|
||||
fileName ccmFile(args.additionalArgs()[0]);
|
||||
const fileName ccmFile = args[1];
|
||||
|
||||
if (!isFile(ccmFile))
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,8 @@ Application
|
||||
ansysToFoam
|
||||
|
||||
Description
|
||||
Converts an ANSYS input mesh file, exported from I-DEAS, to FOAM format.
|
||||
Converts an ANSYS input mesh file, exported from I-DEAS,
|
||||
to OpenFOAM format.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -252,7 +253,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
fileName ansysFile(args.additionalArgs()[0]);
|
||||
const fileName ansysFile = args[1];
|
||||
ifstream ansysStream(ansysFile.c_str());
|
||||
|
||||
if (!ansysStream)
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ Application
|
||||
cfx4ToFoam
|
||||
|
||||
Description
|
||||
Converts a CFX 4 mesh to FOAM format
|
||||
Converts a CFX 4 mesh to OpenFOAM format
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
IFstream cfxFile(args.additionalArgs()[0]);
|
||||
IFstream cfxFile(args[1]);
|
||||
|
||||
// Read the cfx information using a fixed format reader.
|
||||
// Comments in the file are in C++ style, so the stream parser will remove
|
||||
@ -603,7 +603,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "CFX patch " << patchI
|
||||
<< ", of type " << cfxPatchTypes[patchI]
|
||||
<< ", name " << cfxPatchNames[patchI]
|
||||
<< " already exists as FOAM patch " << existingPatch
|
||||
<< " already exists as OpenFOAM patch " << existingPatch
|
||||
<< ". Adding faces." << endl;
|
||||
|
||||
faceList& renumberedPatch = boundary[existingPatch];
|
||||
@ -655,7 +655,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "CFX patch " << patchI
|
||||
<< ", of type " << cfxPatchTypes[patchI]
|
||||
<< ", name " << cfxPatchNames[patchI]
|
||||
<< " converted into FOAM patch " << nCreatedPatches
|
||||
<< " converted into OpenFOAM patch " << nCreatedPatches
|
||||
<< " type ";
|
||||
|
||||
if (cfxPatchTypes[patchI] == "WALL")
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -795,7 +795,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
fileName fluentFile(args.additionalArgs()[0]);
|
||||
const fileName fluentFile = args[1];
|
||||
IFstream fluentStream(fluentFile);
|
||||
|
||||
if (!fluentStream)
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ Application
|
||||
fluentMeshToFoam
|
||||
|
||||
Description
|
||||
Converts a Fluent mesh to FOAM format
|
||||
Converts a Fluent mesh to OpenFOAM format
|
||||
including multiple region and region boundary handling.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -881,12 +881,12 @@ int main(int argc, char *argv[])
|
||||
scalar scaleFactor = 1.0;
|
||||
args.optionReadIfPresent("scale", scaleFactor);
|
||||
|
||||
bool writeSets = args.optionFound("writeSets");
|
||||
bool writeZones = args.optionFound("writeZones");
|
||||
const bool writeSets = args.optionFound("writeSets");
|
||||
const bool writeZones = args.optionFound("writeZones");
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
fileName fluentFile(args.additionalArgs()[0]);
|
||||
const fileName fluentFile = args[1];
|
||||
std::ifstream fluentStream(fluentFile.c_str());
|
||||
|
||||
if (!fluentStream)
|
||||
|
@ -199,7 +199,8 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
fluentMeshFile << l.size() << " ";
|
||||
|
||||
// Note: In Fluent, all boundary faces point inwards, which is
|
||||
// opposite from the FOAM convention. Turn them round on printout
|
||||
// opposite from the OpenFOAM convention.
|
||||
// Turn them around on printout
|
||||
forAllReverse (l, lI)
|
||||
{
|
||||
fluentMeshFile << l[lI] + 1 << " ";
|
||||
|
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
Writes out the FOAM mesh in Fluent mesh format.
|
||||
Writes out the OpenFOAM mesh in Fluent mesh format.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,16 +39,6 @@ Usage
|
||||
Specify an alternative geometry scaling factor.
|
||||
The default is @b 1000 (scale @em [m] to @em [mm]).
|
||||
|
||||
@param -surface \n
|
||||
Extract the surface of the volume mesh only.
|
||||
This can be useful, for example, for surface morphing in an external
|
||||
package.
|
||||
|
||||
@param -tri \n
|
||||
Extract a triangulated surface.
|
||||
The @b -surface options is implicitly selected.
|
||||
|
||||
|
||||
Note
|
||||
The cellTable information available in the files
|
||||
@c constant/cellTable and @c constant/polyMesh/cellTableId
|
||||
@ -87,34 +77,13 @@ int main(int argc, char *argv[])
|
||||
"noBnd",
|
||||
"suppress writing the .bnd file"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"tri",
|
||||
"Extract a triangulated surface. Implies -surface"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"surface",
|
||||
"extract the surface of the volume mesh only"
|
||||
);
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
|
||||
bool surfaceOnly = false;
|
||||
if (args.optionFound("surface") || args.optionFound("tri"))
|
||||
{
|
||||
surfaceOnly = true;
|
||||
}
|
||||
|
||||
fileName exportName = meshWriter::defaultMeshName;
|
||||
if (surfaceOnly)
|
||||
{
|
||||
exportName = meshWriter::defaultSurfaceName;
|
||||
}
|
||||
|
||||
if (args.optionFound("case"))
|
||||
{
|
||||
exportName += '-' + args.globalCaseName();
|
||||
@ -132,7 +101,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createPolyMesh.H"
|
||||
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
@ -156,21 +124,7 @@ int main(int argc, char *argv[])
|
||||
meshName += '_' + runTime.timeName();
|
||||
}
|
||||
|
||||
if (surfaceOnly)
|
||||
{
|
||||
if (args.optionFound("tri"))
|
||||
{
|
||||
writer.writeSurface(meshName, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.writeSurface(meshName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.write(meshName);
|
||||
}
|
||||
writer.write(meshName);
|
||||
}
|
||||
|
||||
Info<< nl << endl;
|
||||
|
@ -36,6 +36,9 @@ Usage
|
||||
Specify an alternative geometry scaling factor.
|
||||
Eg, use @b 1000 to scale @em [m] to @em [mm].
|
||||
|
||||
@param -tri \n
|
||||
Triangulate surface.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
@ -62,15 +65,19 @@ int main(int argc, char *argv[])
|
||||
"scale",
|
||||
"specify geometry scaling factor"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"tri",
|
||||
"triangulate surface"
|
||||
);
|
||||
|
||||
# include "setRootCase.H"
|
||||
|
||||
const stringList& params = args.additionalArgs();
|
||||
fileName exportName = args[1];
|
||||
|
||||
scalar scaleFactor = 0;
|
||||
args.optionReadIfPresent<scalar>("scale", scaleFactor);
|
||||
|
||||
fileName exportName(params[0]);
|
||||
const bool doTriangulate = args.optionFound("tri");
|
||||
|
||||
fileName exportBase = exportName.lessExt();
|
||||
word exportExt = exportName.ext();
|
||||
@ -107,6 +114,12 @@ int main(int argc, char *argv[])
|
||||
surf.scalePoints(scaleFactor);
|
||||
|
||||
Info<< "writing " << exportName;
|
||||
if (doTriangulate)
|
||||
{
|
||||
Info<< " triangulated";
|
||||
surf.triangulate();
|
||||
}
|
||||
|
||||
if (scaleFactor <= 0)
|
||||
{
|
||||
Info<< " without scaling" << endl;
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ Application
|
||||
gambitToFoam
|
||||
|
||||
Description
|
||||
Converts a GAMBIT mesh to FOAM format.
|
||||
Converts a GAMBIT mesh to OpenFOAM format.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -653,7 +653,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
fileName gambitFile(args.additionalArgs()[0]);
|
||||
const fileName gambitFile = args[1];
|
||||
ifstream gambitStream(gambitFile.c_str());
|
||||
|
||||
if (!gambitStream)
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -722,9 +722,8 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
fileName mshName(args.additionalArgs()[0]);
|
||||
|
||||
bool keepOrientation = args.optionFound("keepOrientation");
|
||||
const bool keepOrientation = args.optionFound("keepOrientation");
|
||||
IFstream inFile(args[1]);
|
||||
|
||||
// Storage for points
|
||||
pointField points;
|
||||
@ -749,9 +748,6 @@ int main(int argc, char *argv[])
|
||||
// Version 1 or 2 format
|
||||
bool version2Format = false;
|
||||
|
||||
|
||||
IFstream inFile(mshName);
|
||||
|
||||
while (inFile.good())
|
||||
{
|
||||
string line;
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -595,9 +595,8 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
fileName ideasName(args.additionalArgs()[0]);
|
||||
|
||||
IFstream inFile(ideasName.c_str());
|
||||
const fileName ideasName = args[1];
|
||||
IFstream inFile(ideasName);
|
||||
|
||||
if (!inFile.good())
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ Application
|
||||
kivaToFoam
|
||||
|
||||
Description
|
||||
Converts a KIVA3v grid to FOAM format
|
||||
Converts a KIVA3v grid to OpenFOAM format
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -68,15 +68,12 @@ int main(int argc, char *argv[])
|
||||
# include "createTime.H"
|
||||
|
||||
fileName kivaFileName("otape17");
|
||||
if (args.optionFound("file"))
|
||||
{
|
||||
kivaFileName = args.option("file");
|
||||
}
|
||||
args.optionReadIfPresent("file", kivaFileName);
|
||||
|
||||
kivaVersions kivaVersion = kiva3v;
|
||||
if (args.optionFound("version"))
|
||||
{
|
||||
word kivaVersionName = args.option("version");
|
||||
const word kivaVersionName = args["version"];
|
||||
|
||||
if (kivaVersionName == "kiva3")
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -62,10 +62,8 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
bool readHex = args.optionFound("hex");
|
||||
|
||||
fileName mshFile(args.additionalArgs()[0]);
|
||||
IFstream mshStream(mshFile);
|
||||
const bool readHex = args.optionFound("hex");
|
||||
IFstream mshStream(args[1]);
|
||||
|
||||
label nCells;
|
||||
mshStream >> nCells;
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -93,11 +93,7 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
fileName neuFile(args.additionalArgs()[0]);
|
||||
|
||||
|
||||
IFstream str(neuFile);
|
||||
|
||||
IFstream str(args[1]);
|
||||
|
||||
//
|
||||
// Read nodes.
|
||||
@ -106,7 +102,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "nNodes:" << nNodes << endl;
|
||||
|
||||
|
||||
pointField points(nNodes);
|
||||
|
||||
forAll(points, pointI)
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -85,7 +85,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
IFstream plot3dFile(args.additionalArgs()[0]);
|
||||
IFstream plot3dFile(args[1]);
|
||||
|
||||
// Read the plot3d information using a fixed format reader.
|
||||
// Comments in the file are in C++ style, so the stream parser will remove
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -353,6 +353,7 @@ void dumpFeatures
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "addOverwriteOption.H"
|
||||
argList::noParallel();
|
||||
timeSelector::addOptions(true, false);
|
||||
|
||||
@ -360,7 +361,6 @@ int main(int argc, char *argv[])
|
||||
argList::addBoolOption("splitAllFaces");
|
||||
argList::addBoolOption("concaveMultiCells");
|
||||
argList::addBoolOption("doNotPreserveFaceZones");
|
||||
argList::addBoolOption("overwrite");
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
@ -385,9 +385,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
|
||||
scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
const scalar featureAngle = args.argRead<scalar>(1);
|
||||
const scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||
|
||||
Info<< "Feature:" << featureAngle << endl
|
||||
<< "minCos :" << minCos << endl
|
||||
|
@ -30,6 +30,6 @@ Description
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define starMesh sammMesh
|
||||
#include "../starToFoam/readPoints.C"
|
||||
#include "../star3ToFoam/readPoints.C"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -47,7 +47,7 @@ const cellModel* sammMesh::sammTrim4Ptr_ = cellModeller::lookup("sammTrim4");
|
||||
const cellModel* sammMesh::sammTrim5Ptr_ = cellModeller::lookup("sammTrim5");
|
||||
const cellModel* sammMesh::sammTrim8Ptr_ = cellModeller::lookup("hexagonalPrism");
|
||||
|
||||
// lookup table giving FOAM face number when looked up with shape index
|
||||
// lookup table giving OpenFOAM face number when looked up with shape index
|
||||
// (first index) and STAR face number
|
||||
// - first column is always -1
|
||||
// - last column is -1 for all but hexagonal prism
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ Application
|
||||
sammToFoam
|
||||
|
||||
Description
|
||||
Converts a STAR-CD SAMM mesh to FOAM format
|
||||
Converts a Star-CD (v3) SAMM mesh to OpenFOAM format.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -54,8 +54,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
fileName sammFile(args.additionalArgs()[0]);
|
||||
sammMesh makeMesh(sammFile, runTime, scaleFactor);
|
||||
sammMesh makeMesh(args[1], runTime, scaleFactor);
|
||||
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
@ -14,6 +14,6 @@ createBoundaryFaces.C
|
||||
createPolyBoundary.C
|
||||
purgeCellShapes.C
|
||||
writeMesh.C
|
||||
starToFoam.C
|
||||
star3ToFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/starToFoam
|
||||
EXE = $(FOAM_APPBIN)/star3ToFoam
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user