Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 257 additions and 21 deletions
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
\page pageSolvers Solvers
\section secSolvers Overview
The available solvers are grouped into the following categories:
- \ref grpBasicSolvers
- \ref grpCombustionSolvers
- \ref grpCompressibleSolvers
- \ref grpDiscreteMethodsSolvers
- \ref grpDNSSolvers
- \ref grpElectroMagneticsSolvers
- \ref grpFinancialSolvers
- \ref grpHeatTransferSolvers
- \ref grpIncompressibleSolvers
- \ref grpLagrangianSolvers
- \ref grpMultiphaseSolvers
- \ref grpStressAnalysisSolvers
\*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
\defgroup grpSolvers Solvers
@{
This group contains solvers
@}
\defgroup grpMovingMeshSolvers Moving mesh solvers
@{
\ingroup grpSolvers
This group contains moving mesh solvers solvers
@}
\*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\defgroup grpElectroMagneticsSolvers Electro-magnetics solvers
@{
\ingroup grpSolvers
This group contains electro-magnetics solvers.
@}
\*---------------------------------------------------------------------------*/
......@@ -24,6 +24,9 @@ License
Application
electrostaticFoam
Group
grpElectroMagneticsSolvers
Description
Solver for electrostatics.
......
......@@ -58,7 +58,7 @@
if (magnetZonei == -1)
{
FatalIOErrorIn(args.executable().c_str(), transportProperties)
FatalIOErrorInFunction(transportProperties)
<< "Cannot find faceZone for magnet " << magnets[i].name()
<< exit(FatalIOError);
}
......
......@@ -24,6 +24,9 @@ License
Application
magneticFoam
Group
grpElectroMagneticsSolvers
Description
Solver for the magnetic field generated by permanent magnets.
......
......@@ -24,6 +24,9 @@ License
Application
mhdFoam
Group
grpElectroMagneticsSolvers
Description
Solver for magnetohydrodynamics (MHD): incompressible, laminar flow of a
conducting fluid under the influence of a magnetic field.
......
......@@ -24,6 +24,9 @@ License
Application
financialFoam
Group
grpFinancialSolvers
Description
Solves the Black-Scholes equation to price commodities.
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\defgroup grpFinancialSolvers Financial solvers
@{
\ingroup grpSolvers
This group contains financial solvers.
@}
\*---------------------------------------------------------------------------*/
......@@ -7,7 +7,6 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
......
......@@ -24,6 +24,9 @@ License
Application
buoyantBoussinesqPimpleFoam
Group
grpHeatTransferSolvers
Description
Transient solver for buoyant, turbulent flow of incompressible fluids
......@@ -49,7 +52,7 @@ Description
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "radiationModel.H"
#include "fvIOoptionList.H"
#include "fvOptions.H"
#include "pimpleControl.H"
#include "fixedFluxPressureFvPatchScalarField.H"
......@@ -72,6 +75,8 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setInitialDeltaT.H"
turbulence->validate();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......
......@@ -49,7 +49,7 @@ volVectorField U
Info<< "Creating turbulence model\n" << endl;
autoPtr<incompressible::RASModel> turbulence
(
incompressible::RASModel::New(U, phi, laminarTransport)
incompressible::New<incompressible::RASModel>(U, phi, laminarTransport)
);
// Kinematic density for buoyancy force
......
......@@ -3,15 +3,16 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude
EXE_LIBS = \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lradiationModels \
-lfiniteVolume \
-lsampling \
-lmeshTools \
......
......@@ -9,7 +9,8 @@
fvm::div(phi, T)
- fvm::laplacian(alphaEff, T)
==
fvOptions(T)
radiation->ST(rhoCpRef, T)
+ fvOptions(T)
);
TEqn.relax();
......@@ -18,6 +19,8 @@
TEqn.solve();
radiation->correct();
fvOptions.correct(T);
rhok = 1.0 - beta*(T - TRef);
......
......@@ -24,6 +24,9 @@ License
Application
buoyantBoussinesqSimpleFoam
Group
grpHeatTransferSolvers
Description
Steady-state solver for buoyant, turbulent flow of incompressible fluids
......@@ -48,7 +51,8 @@ Description
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "fvIOoptionList.H"
#include "radiationModel.H"
#include "fvOptions.H"
#include "simpleControl.H"
#include "fixedFluxPressureFvPatchScalarField.H"
......@@ -63,10 +67,13 @@ int main(int argc, char *argv[])
simpleControl simple(mesh);
#include "createFields.H"
#include "createIncompressibleRadiationModel.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
turbulence->validate();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......
......@@ -49,7 +49,7 @@ volVectorField U
Info<< "Creating turbulence model\n" << endl;
autoPtr<incompressible::RASModel> turbulence
(
incompressible::RASModel::New(U, phi, laminarTransport)
incompressible::New<incompressible::RASModel>(U, phi, laminarTransport)
);
// Kinematic density for buoyancy force
......
......@@ -2,7 +2,6 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
......
......@@ -24,6 +24,9 @@ License
Application
buoyantPimpleFoam
Group
grpHeatTransferSolvers
Description
Transient solver for buoyant, turbulent flow of compressible fluids for
ventilation and heat-transfer.
......@@ -37,7 +40,7 @@ Description
#include "rhoThermo.H"
#include "turbulentFluidThermoModel.H"
#include "radiationModel.H"
#include "fvIOoptionList.H"
#include "fvOptions.H"
#include "pimpleControl.H"
#include "fixedFluxPressureFvPatchScalarField.H"
......@@ -51,7 +54,6 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
......@@ -61,6 +63,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
turbulence->validate();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......
......@@ -50,9 +50,11 @@ autoPtr<compressible::turbulenceModel> turbulence
)
);
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
#include "gh.H"
Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh
......@@ -88,3 +90,27 @@ volScalarField dpdt
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
label pRefCell = 0;
scalar pRefValue = 0.0;
if (p_rgh.needReference())
{
setRefCell
(
p,
p_rgh,
pimple.dict(),
pRefCell,
pRefValue
);
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
dimensionedScalar initialMass("initialMass", fvc::domainIntegrate(rho));
{
bool closedVolume = p_rgh.needReference();
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
bool compressible = (compressibility.value() > SMALL);
rho = thermo.rho();
// Thermodynamic density needs to be updated by psi*d(p) after the
......@@ -36,19 +41,27 @@
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
);
fvScalarMatrix p_rghDDtEqn
tmp<fvScalarMatrix> p_rghDDtEqn
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
+ fvc::div(phiHbyA)
==
fvOptions(psi, p_rgh, rho.name())
new fvScalarMatrix(p_rgh, dimMass/dimTime)
);
if (compressible)
{
p_rghDDtEqn =
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
==
fvOptions(psi, p_rgh, rho.name())
);
}
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix p_rghEqn
(
p_rghDDtEqn
p_rghDDtEqn()
+ fvc::div(phiHbyA)
- fvm::laplacian(rAUf, p_rgh)
);
......@@ -81,6 +94,32 @@
dpdt = fvc::ddt(p);
}
#include "rhoEqn.H"
if (compressible)
{
#include "rhoEqn.H"
}
#include "compressibleContinuityErrs.H"
if (closedVolume)
{
if (!compressible)
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
else
{
p += (initialMass - fvc::domainIntegrate(thermo.rho()))
/compressibility;
rho = thermo.rho();
}
p_rgh = p - rho*gh;
}
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
<< endl;
}