mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -23,16 +23,21 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fvScalarMatrix DrhoDtEqn
|
||||||
|
(
|
||||||
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||||
|
+ fvc::div(phi)
|
||||||
|
==
|
||||||
|
parcels.Srho()
|
||||||
|
+ massSource.SuTot()
|
||||||
|
);
|
||||||
|
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
DrhoDtEqn
|
||||||
+ fvc::div(phi)
|
|
||||||
- fvm::laplacian(rho*rAU, p)
|
- fvm::laplacian(rho*rAU, p)
|
||||||
==
|
|
||||||
parcels.Srho()
|
|
||||||
+ massSource.SuTot()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.solve();
|
pEqn.solve();
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
estimateScalarError.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/estimateScalarError
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/errorEstimation/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lerrorEstimation \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lmeshTools \
|
|
||||||
-ldynamicMesh
|
|
||||||
@ -1,133 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2004-2010 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 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Application
|
|
||||||
estimateScalarError
|
|
||||||
|
|
||||||
Description
|
|
||||||
Estimates the error in the solution for a scalar transport equation in the
|
|
||||||
standard form
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
#include "errorEstimate.H"
|
|
||||||
#include "resError.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
timeSelector::addOptions();
|
|
||||||
|
|
||||||
# include "setRootCase.H"
|
|
||||||
# include "createTime.H"
|
|
||||||
|
|
||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
|
||||||
|
|
||||||
Info<< "\nEstimating error in scalar transport equation\n"
|
|
||||||
<< "Reading transportProperties\n" << endl;
|
|
||||||
|
|
||||||
IOdictionary transportProperties
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"transportProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
Info<< "Reading diffusivity DT\n" << endl;
|
|
||||||
|
|
||||||
dimensionedScalar DT
|
|
||||||
(
|
|
||||||
transportProperties.lookup("DT")
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
forAll(timeDirs, timeI)
|
|
||||||
{
|
|
||||||
runTime.setTime(timeDirs[timeI], timeI);
|
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
|
||||||
|
|
||||||
mesh.readUpdate();
|
|
||||||
|
|
||||||
IOobject THeader
|
|
||||||
(
|
|
||||||
"T",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
);
|
|
||||||
|
|
||||||
IOobject Uheader
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
);
|
|
||||||
|
|
||||||
if (THeader.headerOk() && Uheader.headerOk())
|
|
||||||
{
|
|
||||||
Info<< "Reading T" << endl;
|
|
||||||
volScalarField T(THeader, mesh);
|
|
||||||
|
|
||||||
Info<< "Reading U" << endl;
|
|
||||||
volVectorField U(Uheader, mesh);
|
|
||||||
|
|
||||||
# include "createPhi.H"
|
|
||||||
|
|
||||||
errorEstimate<scalar> ee
|
|
||||||
(
|
|
||||||
resError::div(phi, T)
|
|
||||||
- resError::laplacian(DT, T)
|
|
||||||
);
|
|
||||||
|
|
||||||
ee.residual()().write();
|
|
||||||
volScalarField e(ee.error());
|
|
||||||
e.write();
|
|
||||||
mag(e)().write();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< " No T or U" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
icoErrorEstimate.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/icoErrorEstimate
|
|
||||||
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/errorEstimation/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lerrorEstimation \
|
|
||||||
-lmeshTools \
|
|
||||||
-ldynamicMesh \
|
|
||||||
-lfiniteVolume
|
|
||||||
@ -1,129 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2004-2010 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 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Application
|
|
||||||
icoErrorEstimate
|
|
||||||
|
|
||||||
Description
|
|
||||||
Estimates error for the incompressible laminar CFD application icoFoam.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
#include "errorEstimate.H"
|
|
||||||
#include "resError.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
timeSelector::addOptions();
|
|
||||||
|
|
||||||
# include "setRootCase.H"
|
|
||||||
# include "createTime.H"
|
|
||||||
|
|
||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
|
||||||
|
|
||||||
Info<< "\nEstimating error in the incompressible momentum equation\n"
|
|
||||||
<< "Reading transportProperties\n" << endl;
|
|
||||||
|
|
||||||
IOdictionary transportProperties
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"transportProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar nu
|
|
||||||
(
|
|
||||||
transportProperties.lookup("nu")
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(timeDirs, timeI)
|
|
||||||
{
|
|
||||||
runTime.setTime(timeDirs[timeI], timeI);
|
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
|
||||||
|
|
||||||
mesh.readUpdate();
|
|
||||||
|
|
||||||
IOobject pHeader
|
|
||||||
(
|
|
||||||
"p",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
);
|
|
||||||
|
|
||||||
IOobject Uheader
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
);
|
|
||||||
|
|
||||||
if (pHeader.headerOk() && Uheader.headerOk())
|
|
||||||
{
|
|
||||||
Info<< "Reading p" << endl;
|
|
||||||
volScalarField p(pHeader, mesh);
|
|
||||||
|
|
||||||
Info<< "Reading U" << endl;
|
|
||||||
volVectorField U(Uheader, mesh);
|
|
||||||
|
|
||||||
# include "createPhi.H"
|
|
||||||
|
|
||||||
errorEstimate<vector> ee
|
|
||||||
(
|
|
||||||
resError::div(phi, U)
|
|
||||||
- resError::laplacian(nu, U)
|
|
||||||
==
|
|
||||||
-fvc::grad(p)
|
|
||||||
);
|
|
||||||
|
|
||||||
volVectorField e(ee.error());
|
|
||||||
e.write();
|
|
||||||
mag(e)().write();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< " No p or U" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
icoMomentError.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/icoMomentError
|
|
||||||
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/errorEstimation/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lerrorEstimation \
|
|
||||||
-lmeshTools \
|
|
||||||
-ldynamicMesh \
|
|
||||||
-lfiniteVolume
|
|
||||||
@ -1,188 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2004-2010 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 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Application
|
|
||||||
icoMomentError
|
|
||||||
|
|
||||||
Description
|
|
||||||
Estimates error for the incompressible laminar CFD application icoFoam.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
#include "linear.H"
|
|
||||||
#include "gaussConvectionScheme.H"
|
|
||||||
#include "gaussLaplacianScheme.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
timeSelector::addOptions();
|
|
||||||
|
|
||||||
# include "setRootCase.H"
|
|
||||||
# include "createTime.H"
|
|
||||||
|
|
||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
|
||||||
|
|
||||||
Info<< "\nEstimating error in the incompressible momentum equation\n"
|
|
||||||
<< "Reading transportProperties\n" << endl;
|
|
||||||
|
|
||||||
IOdictionary transportProperties
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"transportProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar nu
|
|
||||||
(
|
|
||||||
transportProperties.lookup("nu")
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(timeDirs, timeI)
|
|
||||||
{
|
|
||||||
runTime.setTime(timeDirs[timeI], timeI);
|
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
|
||||||
|
|
||||||
mesh.readUpdate();
|
|
||||||
|
|
||||||
IOobject pHeader
|
|
||||||
(
|
|
||||||
"p",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
);
|
|
||||||
|
|
||||||
IOobject Uheader
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
);
|
|
||||||
|
|
||||||
if (pHeader.headerOk() && Uheader.headerOk())
|
|
||||||
{
|
|
||||||
Info<< "Reading p" << endl;
|
|
||||||
volScalarField p(pHeader, mesh);
|
|
||||||
|
|
||||||
Info<< "Reading U" << endl;
|
|
||||||
volVectorField U(Uheader, mesh);
|
|
||||||
|
|
||||||
# include "createPhi.H"
|
|
||||||
|
|
||||||
volScalarField ek(0.5*magSqr(U));
|
|
||||||
volTensorField gradU(fvc::grad(U));
|
|
||||||
|
|
||||||
// Divergence of the error in U squared
|
|
||||||
|
|
||||||
volScalarField L
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"L",
|
|
||||||
mesh.time().timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("one", dimLength, 1.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
L.internalField() =
|
|
||||||
mesh.V()/fvc::surfaceSum(mesh.magSf())().internalField();
|
|
||||||
|
|
||||||
// Warning: 4th row of this equation specially modified
|
|
||||||
// for the momentum equation. The "real" formulation would
|
|
||||||
// have diffusivity*(gradV && gradV)
|
|
||||||
volScalarField momError
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"momErrorL" + U.name(),
|
|
||||||
mesh.time().timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
sqrt
|
|
||||||
(
|
|
||||||
2.0*mag
|
|
||||||
(
|
|
||||||
(
|
|
||||||
fv::gaussConvectionScheme<scalar>
|
|
||||||
(
|
|
||||||
mesh,
|
|
||||||
phi,
|
|
||||||
tmp<surfaceInterpolationScheme<scalar> >
|
|
||||||
(
|
|
||||||
new linear<scalar>(mesh)
|
|
||||||
)
|
|
||||||
).fvcDiv(phi, ek)
|
|
||||||
|
|
||||||
- nu*
|
|
||||||
fv::gaussLaplacianScheme<scalar, scalar>(mesh)
|
|
||||||
.fvcLaplacian
|
|
||||||
(
|
|
||||||
ek
|
|
||||||
)
|
|
||||||
- (U & fvc::grad(p))
|
|
||||||
// + nu*(gradU && gradU)
|
|
||||||
+ 0.5*nu*
|
|
||||||
(
|
|
||||||
gradU && (gradU + gradU.T())
|
|
||||||
)
|
|
||||||
)*L/(mag(U) + nu/L)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
momError.boundaryField() = 0.0;
|
|
||||||
momError.write();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< " No p or U" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
momentScalarError.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/momentScalarError
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/errorEstimation/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lmeshTools \
|
|
||||||
-ldynamicMesh \
|
|
||||||
-lfiniteVolume
|
|
||||||
@ -1,185 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2004-2010 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 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Application
|
|
||||||
momentScalarError
|
|
||||||
|
|
||||||
Description
|
|
||||||
Estimates the error in the solution for a scalar transport equation in the
|
|
||||||
standard form
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
#include "linear.H"
|
|
||||||
#include "gaussConvectionScheme.H"
|
|
||||||
#include "gaussLaplacianScheme.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
timeSelector::addOptions();
|
|
||||||
|
|
||||||
# include "setRootCase.H"
|
|
||||||
# include "createTime.H"
|
|
||||||
|
|
||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
|
||||||
|
|
||||||
# include "createMesh.H"
|
|
||||||
|
|
||||||
Info<< "\nEstimating error in scalar transport equation\n"
|
|
||||||
<< "Reading transportProperties\n" << endl;
|
|
||||||
|
|
||||||
IOdictionary transportProperties
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"transportProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
Info<< "Reading diffusivity DT\n" << endl;
|
|
||||||
|
|
||||||
dimensionedScalar DT
|
|
||||||
(
|
|
||||||
transportProperties.lookup("DT")
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
forAll(timeDirs, timeI)
|
|
||||||
{
|
|
||||||
runTime.setTime(timeDirs[timeI], timeI);
|
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
|
||||||
|
|
||||||
mesh.readUpdate();
|
|
||||||
|
|
||||||
IOobject THeader
|
|
||||||
(
|
|
||||||
"T",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
);
|
|
||||||
|
|
||||||
IOobject Uheader
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
);
|
|
||||||
|
|
||||||
if (THeader.headerOk() && Uheader.headerOk())
|
|
||||||
{
|
|
||||||
Info<< "Reading T" << endl;
|
|
||||||
volScalarField T(THeader, mesh);
|
|
||||||
|
|
||||||
Info<< "Reading U" << endl;
|
|
||||||
volVectorField U(Uheader, mesh);
|
|
||||||
|
|
||||||
# include "createPhi.H"
|
|
||||||
|
|
||||||
volVectorField gradT(fvc::grad(T));
|
|
||||||
|
|
||||||
volScalarField TE(0.5*sqr(T));
|
|
||||||
|
|
||||||
volScalarField L
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"L",
|
|
||||||
mesh.time().timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("one", dimLength, 1.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
L.internalField() =
|
|
||||||
mesh.V()/fvc::surfaceSum(mesh.magSf())().internalField();
|
|
||||||
|
|
||||||
// Divergence of the error in the T squared
|
|
||||||
volScalarField momError
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"momErrorL" + T.name(),
|
|
||||||
mesh.time().timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
sqrt
|
|
||||||
(
|
|
||||||
2.0*mag
|
|
||||||
(
|
|
||||||
(
|
|
||||||
fv::gaussConvectionScheme<scalar>
|
|
||||||
(
|
|
||||||
mesh,
|
|
||||||
phi,
|
|
||||||
tmp<surfaceInterpolationScheme<scalar> >
|
|
||||||
(
|
|
||||||
new linear<scalar>(mesh)
|
|
||||||
)
|
|
||||||
).fvcDiv(phi, TE)
|
|
||||||
|
|
||||||
- DT*
|
|
||||||
fv::gaussLaplacianScheme<scalar, scalar>(mesh)
|
|
||||||
.fvcLaplacian
|
|
||||||
(
|
|
||||||
TE
|
|
||||||
)
|
|
||||||
+ DT*(gradT & gradT)
|
|
||||||
)*L/(mag(U) + DT/L)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
momError.boundaryField() = 0.0;
|
|
||||||
momError.write();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< " No T or U" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -19,7 +19,6 @@ EXE_LIBS = \
|
|||||||
-ldynamicMesh \
|
-ldynamicMesh \
|
||||||
-ledgeMesh \
|
-ledgeMesh \
|
||||||
-lengine \
|
-lengine \
|
||||||
-lerrorEstimation \
|
|
||||||
-lextrudeModel \
|
-lextrudeModel \
|
||||||
-lfieldFunctionObjects \
|
-lfieldFunctionObjects \
|
||||||
-lfileFormats \
|
-lfileFormats \
|
||||||
|
|||||||
@ -105,8 +105,8 @@ int main()
|
|||||||
Z[Count] = Phi + 1.0;
|
Z[Count] = Phi + 1.0;
|
||||||
Count++;
|
Count++;
|
||||||
|
|
||||||
X[Count] = -X[Count - 1];
|
X[Count] = -X[Count - 1];
|
||||||
Y[Count] = -Y[Count - 1];
|
Y[Count] = -Y[Count - 1];
|
||||||
Z[Count] = -Z[Count - 1];
|
Z[Count] = -Z[Count - 1];
|
||||||
Count++;
|
Count++;
|
||||||
|
|
||||||
@ -115,18 +115,18 @@ int main()
|
|||||||
Z[Count] = Phi - 1.0;
|
Z[Count] = Phi - 1.0;
|
||||||
Count++;
|
Count++;
|
||||||
|
|
||||||
X[Count] = -X[Count - 1];
|
X[Count] = -X[Count - 1];
|
||||||
Y[Count] = -Y[Count - 1];
|
Y[Count] = -Y[Count - 1];
|
||||||
Z[Count] = -Z[Count - 1];
|
Z[Count] = -Z[Count - 1];
|
||||||
Count++;
|
Count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
INTEGER4 IsDouble = 1;
|
INTEGER4 IsDouble = 1;
|
||||||
|
|
||||||
I = TECDAT112(&NumPts, X, &IsDouble);
|
I = TECDAT112(&NumPts, X, &IsDouble);
|
||||||
I = TECDAT112(&NumPts, Y, &IsDouble);
|
I = TECDAT112(&NumPts, Y, &IsDouble);
|
||||||
I = TECDAT112(&NumPts, Z, &IsDouble);
|
I = TECDAT112(&NumPts, Z, &IsDouble);
|
||||||
|
|
||||||
delete X;
|
delete X;
|
||||||
delete Y;
|
delete Y;
|
||||||
delete Z;
|
delete Z;
|
||||||
@ -371,6 +371,6 @@ int main()
|
|||||||
I = TECEND112();
|
I = TECEND112();
|
||||||
/* DOCEND */
|
/* DOCEND */
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@ -38,7 +38,7 @@ cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$WM_THIRD_PARTY_DIR/platform
|
|||||||
|
|
||||||
# determine the cmake to be used
|
# determine the cmake to be used
|
||||||
unset CMAKE_HOME
|
unset CMAKE_HOME
|
||||||
for cmake in cmake-2.8.3 cmake-2.8.1
|
for cmake in cmake-2.8.4 cmake-2.8.3 cmake-2.8.1
|
||||||
do
|
do
|
||||||
cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
|
cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
|
||||||
if [ -r $cmake ]
|
if [ -r $cmake ]
|
||||||
|
|||||||
@ -39,7 +39,7 @@ if ( $status == 0 ) setenv PATH $cleaned
|
|||||||
|
|
||||||
# determine the cmake to be used
|
# determine the cmake to be used
|
||||||
unsetenv CMAKE_HOME
|
unsetenv CMAKE_HOME
|
||||||
foreach cmake ( cmake-2.8.3 cmake-2.8.1 )
|
foreach cmake ( cmake-2.8.4 cmake-2.8.3 cmake-2.8.1 )
|
||||||
set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
|
set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
|
||||||
if ( -r $cmake ) then
|
if ( -r $cmake ) then
|
||||||
setenv CMAKE_HOME $cmake
|
setenv CMAKE_HOME $cmake
|
||||||
|
|||||||
@ -84,7 +84,7 @@ _foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_L
|
|||||||
# Compiler settings
|
# Compiler settings
|
||||||
# ~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~
|
||||||
unset gcc_version gmp_version mpfr_version mpc_version
|
unset gcc_version gmp_version mpfr_version mpc_version
|
||||||
unsetenv MPFR_ARCH_PATH
|
unsetenv MPFR_ARCH_PATH GMP_ARCH_PATH
|
||||||
|
|
||||||
|
|
||||||
# Location of compiler installation
|
# Location of compiler installation
|
||||||
@ -178,6 +178,7 @@ case ThirdParty:
|
|||||||
|
|
||||||
# used by boost/CGAL:
|
# used by boost/CGAL:
|
||||||
setenv MPFR_ARCH_PATH $mpfrDir
|
setenv MPFR_ARCH_PATH $mpfrDir
|
||||||
|
setenv GMP_ARCH_PATH $gmpDir
|
||||||
endif
|
endif
|
||||||
unset gcc_version gccDir
|
unset gcc_version gccDir
|
||||||
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
||||||
@ -228,7 +229,7 @@ endif
|
|||||||
# boost and CGAL
|
# boost and CGAL
|
||||||
# ~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
set boost_version=boost_1_42_0
|
set boost_version=boost_1_45_0
|
||||||
set cgal_version=CGAL-3.7
|
set cgal_version=CGAL-3.7
|
||||||
|
|
||||||
setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
|
setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
|
||||||
@ -243,7 +244,7 @@ if ( -d "$CGAL_ARCH_PATH" ) then
|
|||||||
endif
|
endif
|
||||||
_foamAddLib $CGAL_ARCH_PATH/lib
|
_foamAddLib $CGAL_ARCH_PATH/lib
|
||||||
else
|
else
|
||||||
unsetenv BOOST_ARCH_PATH CGAL_ARCH_PATH MPFR_ARCH_PATH
|
unsetenv BOOST_ARCH_PATH CGAL_ARCH_PATH MPFR_ARCH_PATH GMP_ARCH_PATH
|
||||||
endif
|
endif
|
||||||
|
|
||||||
unset boost_version cgal_version
|
unset boost_version cgal_version
|
||||||
|
|||||||
@ -107,7 +107,7 @@ _foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_EXT_LIBBIN:$
|
|||||||
# Compiler settings
|
# Compiler settings
|
||||||
# ~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~
|
||||||
unset gcc_version gmp_version mpfr_version mpc_version
|
unset gcc_version gmp_version mpfr_version mpc_version
|
||||||
unset MPFR_ARCH_PATH
|
unset MPFR_ARCH_PATH GMP_ARCH_PATH
|
||||||
|
|
||||||
# Location of compiler installation
|
# Location of compiler installation
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -198,6 +198,7 @@ OpenFOAM | ThirdParty)
|
|||||||
|
|
||||||
# used by boost/CGAL:
|
# used by boost/CGAL:
|
||||||
export MPFR_ARCH_PATH=$mpfrDir
|
export MPFR_ARCH_PATH=$mpfrDir
|
||||||
|
export GMP_ARCH_PATH=$gmpDir
|
||||||
fi
|
fi
|
||||||
unset gcc_version gccDir
|
unset gcc_version gccDir
|
||||||
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
||||||
@ -247,7 +248,7 @@ fi
|
|||||||
# boost and CGAL
|
# boost and CGAL
|
||||||
# ~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
boost_version=boost_1_42_0
|
boost_version=boost_1_45_0
|
||||||
cgal_version=CGAL-3.7
|
cgal_version=CGAL-3.7
|
||||||
|
|
||||||
export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
|
export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
|
||||||
@ -264,7 +265,7 @@ then
|
|||||||
fi
|
fi
|
||||||
_foamAddLib $CGAL_ARCH_PATH/lib
|
_foamAddLib $CGAL_ARCH_PATH/lib
|
||||||
else
|
else
|
||||||
unset BOOST_ARCH_PATH CGAL_ARCH_PATH MPFR_ARCH_PATH
|
unset BOOST_ARCH_PATH CGAL_ARCH_PATH MPFR_ARCH_PATH GMP_ARCH_PATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset boost_version cgal_version
|
unset boost_version cgal_version
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -46,11 +46,11 @@ UNARY_FUNCTION(tensor, tensor, dev2, transform)
|
|||||||
UNARY_FUNCTION(scalar, tensor, det, transform)
|
UNARY_FUNCTION(scalar, tensor, det, transform)
|
||||||
UNARY_FUNCTION(tensor, tensor, cof, cof)
|
UNARY_FUNCTION(tensor, tensor, cof, cof)
|
||||||
UNARY_FUNCTION(tensor, tensor, inv, inv)
|
UNARY_FUNCTION(tensor, tensor, inv, inv)
|
||||||
UNARY_FUNCTION(vector, tensor, eigenValues, sign)
|
UNARY_FUNCTION(vector, tensor, eigenValues, transform)
|
||||||
UNARY_FUNCTION(tensor, tensor, eigenVectors, transform)
|
UNARY_FUNCTION(tensor, tensor, eigenVectors, sign)
|
||||||
|
|
||||||
UNARY_FUNCTION(vector, symmTensor, eigenValues, sign)
|
UNARY_FUNCTION(vector, symmTensor, eigenValues, transform)
|
||||||
UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, transform)
|
UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, sign)
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * global operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * global operators * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -59,11 +59,11 @@ UNARY_FUNCTION(tensor, tensor, dev2, transform)
|
|||||||
UNARY_FUNCTION(scalar, tensor, det, transform)
|
UNARY_FUNCTION(scalar, tensor, det, transform)
|
||||||
UNARY_FUNCTION(tensor, tensor, cof, cof)
|
UNARY_FUNCTION(tensor, tensor, cof, cof)
|
||||||
UNARY_FUNCTION(tensor, tensor, inv, inv)
|
UNARY_FUNCTION(tensor, tensor, inv, inv)
|
||||||
UNARY_FUNCTION(vector, tensor, eigenValues, sign)
|
UNARY_FUNCTION(vector, tensor, eigenValues, transform)
|
||||||
UNARY_FUNCTION(tensor, tensor, eigenVectors, transform)
|
UNARY_FUNCTION(tensor, tensor, eigenVectors, sign)
|
||||||
|
|
||||||
UNARY_FUNCTION(vector, symmTensor, eigenValues, sign)
|
UNARY_FUNCTION(vector, symmTensor, eigenValues, transform)
|
||||||
UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, transform)
|
UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, sign)
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * global operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * global operators * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -26,8 +26,21 @@ License
|
|||||||
#include "Reaction.H"
|
#include "Reaction.H"
|
||||||
#include "DynamicList.H"
|
#include "DynamicList.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Static Data * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
Foam::label Foam::Reaction<ReactionThermo>::nUnNamedReactions = 0;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
Foam::label Foam::Reaction<ReactionThermo>::getNewReactionID()
|
||||||
|
{
|
||||||
|
return nUnNamedReactions++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
template<class ReactionThermo>
|
||||||
Foam::string Foam::Reaction<ReactionThermo>::reactionStr() const
|
Foam::string Foam::Reaction<ReactionThermo>::reactionStr() const
|
||||||
{
|
{
|
||||||
@ -114,6 +127,7 @@ Foam::Reaction<ReactionThermo>::Reaction
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
ReactionThermo(*thermoDatabase[species[0]]),
|
ReactionThermo(*thermoDatabase[species[0]]),
|
||||||
|
name_("un-named-reaction-" + Foam::name(getNewReactionID())),
|
||||||
species_(species),
|
species_(species),
|
||||||
lhs_(lhs),
|
lhs_(lhs),
|
||||||
rhs_(rhs)
|
rhs_(rhs)
|
||||||
@ -130,6 +144,7 @@ Foam::Reaction<ReactionThermo>::Reaction
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
ReactionThermo(r),
|
ReactionThermo(r),
|
||||||
|
name_(r.name() + "Copy"),
|
||||||
species_(species),
|
species_(species),
|
||||||
lhs_(r.lhs_),
|
lhs_(r.lhs_),
|
||||||
rhs_(r.rhs_)
|
rhs_(r.rhs_)
|
||||||
@ -236,6 +251,7 @@ Foam::Reaction<ReactionThermo>::Reaction
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
ReactionThermo(*thermoDatabase[species[0]]),
|
ReactionThermo(*thermoDatabase[species[0]]),
|
||||||
|
name_("un-named-reaction" + Foam::name(getNewReactionID())),
|
||||||
species_(species)
|
species_(species)
|
||||||
{
|
{
|
||||||
setLRhs(is);
|
setLRhs(is);
|
||||||
@ -252,6 +268,7 @@ Foam::Reaction<ReactionThermo>::Reaction
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
ReactionThermo(*thermoDatabase[species[0]]),
|
ReactionThermo(*thermoDatabase[species[0]]),
|
||||||
|
name_(dict.dictName()),
|
||||||
species_(species)
|
species_(species)
|
||||||
{
|
{
|
||||||
setLRhs(IStringStream(dict.lookup("reaction"))());
|
setLRhs(IStringStream(dict.lookup("reaction"))());
|
||||||
@ -318,7 +335,7 @@ Foam::Reaction<ReactionThermo>::New
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word& reactionTypeName = dict.dictName();
|
const word& reactionTypeName = dict.lookup("type");
|
||||||
|
|
||||||
typename dictionaryConstructorTable::iterator cstrIter
|
typename dictionaryConstructorTable::iterator cstrIter
|
||||||
= dictionaryConstructorTablePtr_->find(reactionTypeName);
|
= dictionaryConstructorTablePtr_->find(reactionTypeName);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -69,6 +69,12 @@ class Reaction
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Static data
|
||||||
|
|
||||||
|
//- Number of un-named reactions
|
||||||
|
static label nUnNamedReactions;
|
||||||
|
|
||||||
|
|
||||||
// Public data types
|
// Public data types
|
||||||
|
|
||||||
//- Class to hold the specie index and its coefficients in the
|
//- Class to hold the specie index and its coefficients in the
|
||||||
@ -112,6 +118,9 @@ private:
|
|||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
//- Name of reaction
|
||||||
|
const word name_;
|
||||||
|
|
||||||
//- List of specie names present in reaction system
|
//- List of specie names present in reaction system
|
||||||
const speciesTable& species_;
|
const speciesTable& species_;
|
||||||
|
|
||||||
@ -136,6 +145,9 @@ private:
|
|||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const Reaction<ReactionThermo>&);
|
void operator=(const Reaction<ReactionThermo>&);
|
||||||
|
|
||||||
|
//- Return new reaction ID for un-named reactions
|
||||||
|
label getNewReactionID();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -282,6 +294,9 @@ public:
|
|||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
|
inline word& name();
|
||||||
|
inline const word& name() const;
|
||||||
|
|
||||||
inline const List<specieCoeffs>& lhs() const;
|
inline const List<specieCoeffs>& lhs() const;
|
||||||
inline const List<specieCoeffs>& rhs() const;
|
inline const List<specieCoeffs>& rhs() const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,6 +32,20 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
inline word& Reaction<ReactionThermo>::name()
|
||||||
|
{
|
||||||
|
return name_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
inline const word& Reaction<ReactionThermo>::name() const
|
||||||
|
{
|
||||||
|
return name_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
template<class ReactionThermo>
|
||||||
inline const List<typename Reaction<ReactionThermo>::specieCoeffs>&
|
inline const List<typename Reaction<ReactionThermo>::specieCoeffs>&
|
||||||
Reaction<ReactionThermo>::lhs() const
|
Reaction<ReactionThermo>::lhs() const
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -105,13 +105,15 @@ bool Foam::ReactionList<ThermoType>::readReactionDict()
|
|||||||
|
|
||||||
forAllConstIter(dictionary, reactions, iter)
|
forAllConstIter(dictionary, reactions, iter)
|
||||||
{
|
{
|
||||||
|
const word reactionName = iter().keyword();
|
||||||
|
|
||||||
this->append
|
this->append
|
||||||
(
|
(
|
||||||
Reaction<ThermoType>::New
|
Reaction<ThermoType>::New
|
||||||
(
|
(
|
||||||
species_,
|
species_,
|
||||||
thermoDb_,
|
thermoDb_,
|
||||||
reactions.subDict(iter().keyword())
|
reactions.subDict(reactionName)
|
||||||
).ptr()
|
).ptr()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -129,8 +131,9 @@ void Foam::ReactionList<ThermoType>::write(Ostream& os) const
|
|||||||
forAllConstIter(typename SLPtrList<Reaction<ThermoType> >, *this, iter)
|
forAllConstIter(typename SLPtrList<Reaction<ThermoType> >, *this, iter)
|
||||||
{
|
{
|
||||||
const Reaction<ThermoType>& r = iter();
|
const Reaction<ThermoType>& r = iter();
|
||||||
os << indent << r.type() << nl
|
os << indent << r.name() << nl
|
||||||
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||||
|
os.writeKeyword("type") << r.type() << token::END_STATEMENT << nl;
|
||||||
r.write(os);
|
r.write(os);
|
||||||
os << decrIndent << indent << token::END_BLOCK << nl;
|
os << decrIndent << indent << token::END_BLOCK << nl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,8 +9,9 @@ species
|
|||||||
|
|
||||||
reactions
|
reactions
|
||||||
{
|
{
|
||||||
irreversibleArrheniusReaction
|
methaneReaction
|
||||||
{
|
{
|
||||||
|
type irreversibleArrheniusReaction;
|
||||||
reaction "CH4 + 2O2 = CO2 + 2H2O";
|
reaction "CH4 + 2O2 = CO2 + 2H2O";
|
||||||
A 5.2e16;
|
A 5.2e16;
|
||||||
beta 0;
|
beta 0;
|
||||||
|
|||||||
@ -10,15 +10,17 @@ species
|
|||||||
|
|
||||||
reactions
|
reactions
|
||||||
{
|
{
|
||||||
irreversibleArrheniusReaction
|
methaneReaction
|
||||||
{
|
{
|
||||||
|
type irreversibleArrheniusReaction;
|
||||||
reaction "CH4 + 2O2^1.0 = CO2 + 2H2O^1.0";
|
reaction "CH4 + 2O2^1.0 = CO2 + 2H2O^1.0";
|
||||||
A 7e+06;
|
A 7e+06;
|
||||||
beta 0;
|
beta 0;
|
||||||
Ta 10063.8;
|
Ta 10063.8;
|
||||||
}
|
}
|
||||||
irreversibleArrheniusReaction
|
hydrogenReaction
|
||||||
{
|
{
|
||||||
|
type irreversibleArrheniusReaction;
|
||||||
reaction "H2 + 0.5O2^1.0 = H2O";
|
reaction "H2 + 0.5O2^1.0 = H2O";
|
||||||
A 4.74342e+12;
|
A 4.74342e+12;
|
||||||
beta 0;
|
beta 0;
|
||||||
|
|||||||
@ -9,11 +9,12 @@ species
|
|||||||
|
|
||||||
reactions
|
reactions
|
||||||
{
|
{
|
||||||
irreversibleArrheniusReaction
|
methaneReaction
|
||||||
{
|
{
|
||||||
|
type irreversibleArrheniusReaction;
|
||||||
reaction "CH4 + 2O2 = CO2 + 2H2O";
|
reaction "CH4 + 2O2 = CO2 + 2H2O";
|
||||||
A 5.2e16;
|
A 5.2e16;
|
||||||
beta 0;
|
beta 0;
|
||||||
Ta 14906;
|
Ta 14906;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,8 @@ CGAL_INC = \
|
|||||||
-Wno-old-style-cast \
|
-Wno-old-style-cast \
|
||||||
-I$(CGAL_ARCH_PATH)/include \
|
-I$(CGAL_ARCH_PATH)/include \
|
||||||
-I$(MPFR_ARCH_PATH)/include \
|
-I$(MPFR_ARCH_PATH)/include \
|
||||||
-I$(BOOST_ARCH_PATH)/include/boost
|
-I$(GMP_ARCH_PATH)/include \
|
||||||
|
-I$(BOOST_ARCH_PATH)/include
|
||||||
|
|
||||||
CGAL_LIBS = \
|
CGAL_LIBS = \
|
||||||
-L$(MPFR_ARCH_PATH)/lib \
|
-L$(MPFR_ARCH_PATH)/lib \
|
||||||
|
|||||||
Reference in New Issue
Block a user