Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy 2012-09-17 10:48:23 +01:00
commit d5c65f5532
509 changed files with 13365 additions and 11192 deletions

View File

@ -23,7 +23,7 @@ EXE_LIBS = \
-lmeshTools \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,7 +50,7 @@ PDRkEpsilon::PDRkEpsilon
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel,
const fluidThermo& thermophysicalModel,
const word& turbulenceModelName,
const word& modelName
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -100,7 +100,7 @@ public:
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const basicThermo& thermophysicalModel,
const fluidThermo& thermophysicalModel,
const word& turbulenceModelName = turbulenceModel::typeName,
const word& modelName = typeName
);

View File

@ -60,7 +60,17 @@
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -70,4 +70,7 @@ U = HbyA - (invA & (betav*fvc::grad(p)));
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -13,7 +13,7 @@ EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels \

View File

@ -61,7 +61,17 @@
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -70,4 +70,7 @@ U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -14,7 +14,7 @@ EXE_LIBS = \
-lfiniteVolume \
-lcompressibleRASModels \
-lreactionThermophysicalModels \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lchemistryModel \
-lODE \
-lthermophysicalFunctions \

View File

@ -33,6 +33,14 @@ fvMesh mesh
List<polyPatch*> patches(1);
patches[0] = new emptyPolyPatch("boundary", 6, 0, 0, mesh.boundaryMesh());
patches[0] = new emptyPolyPatch
(
"boundary",
6,
0,
0,
mesh.boundaryMesh(),
emptyPolyPatch::typeName
);
mesh.addFvPatches(patches);

View File

@ -13,6 +13,6 @@ EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lfiniteVolume

View File

@ -55,7 +55,17 @@
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -13,7 +13,7 @@ EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels \

View File

@ -64,4 +64,7 @@ U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -6,7 +6,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solid/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
@ -33,7 +33,7 @@ EXE_LIBS = \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lspecie \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \

View File

@ -85,7 +85,17 @@
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -52,4 +52,7 @@ p = p_rgh + rho*gh;
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -14,7 +14,7 @@ EXE_LIBS = \
-lcompressibleLESModels \
-lreactionThermophysicalModels \
-lspecie \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lchemistryModel \
-lODE \
-lfiniteVolume \

View File

@ -62,7 +62,17 @@ reaction->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -70,4 +70,7 @@ U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -16,7 +16,7 @@ EXE_LIBS = \
-lcompressibleLESModels \
-lreactionThermophysicalModels \
-lspecie \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lchemistryModel \
-lODE \
-lfiniteVolume \

View File

@ -64,7 +64,17 @@ reaction->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -89,5 +89,8 @@
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
}

View File

@ -5,6 +5,6 @@ EXE_INC = \
LIB_LIBS = \
-lfiniteVolume \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie

View File

@ -9,7 +9,7 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lrhoCentralFoam \
-lcompressibleTurbulenceModel \

View File

@ -10,7 +10,7 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lrhoCentralFoam \
-lcompressibleTurbulenceModel \

View File

@ -5,7 +5,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \

View File

@ -55,7 +55,17 @@
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -94,4 +94,7 @@ U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -6,7 +6,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \

View File

@ -102,7 +102,10 @@ U = HbyA - rAtU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
// Recalculate density from the relaxed pressure
rho = thermo.rho();

View File

@ -8,7 +8,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \

View File

@ -7,7 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \

View File

@ -96,4 +96,7 @@ U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -6,7 +6,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \

View File

@ -9,7 +9,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lthermalPorousZone \
-lspecie \
-lcompressibleTurbulenceModel \

View File

@ -7,7 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lfiniteVolume \

View File

@ -4,7 +4,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \

View File

@ -6,3 +6,4 @@ fvVectorMatrix UEqn
);
solve(UEqn == -fvc::grad(p));
K = 0.5*magSqr(U);

View File

@ -49,3 +49,6 @@
thermo
)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -5,7 +5,7 @@
+ fvm::div(phi, e)
- fvm::laplacian(turbulence->alphaEff(), e)
==
- p*fvc::div(phi/fvc::interpolate(rho))
- (fvc::ddt(rho, K) + fvc::div(phi, volScalarField("Ekp", K + p/rho)))
);
thermo.correct();

View File

@ -39,3 +39,4 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);

View File

@ -7,7 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \

View File

@ -56,16 +56,12 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "rhoEqn.H"
#include "UEqn.H"
#include "eEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "eEqn.H"
#include "pEqn.H"
}

View File

@ -5,7 +5,7 @@ EXE_INC = \
EXE_LIBS = \
-lmeshTools \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \

View File

@ -75,7 +75,17 @@
p_rgh = p - rho*gh;
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -61,7 +61,10 @@
// Second part of thermodynamic density update
thermo.rho() += psi*p_rgh;
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"

View File

@ -7,7 +7,7 @@ EXE_INC = \
EXE_LIBS = \
-lmeshTools \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \

View File

@ -9,7 +9,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lradiationModels \
-lcompressibleTurbulenceModel \

View File

@ -10,7 +10,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
@ -20,8 +20,8 @@ EXE_INC = \
EXE_LIBS = \
-lbasicThermophysicalModels \
-lbasicSolidThermo \
-lfluidThermophysicalModels \
-lsolidThermo \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \

View File

@ -8,7 +8,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
@ -19,8 +19,8 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lbasicThermophysicalModels \
-lbasicSolidThermo \
-lfluidThermophysicalModels \
-lsolidThermo \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \

View File

@ -175,8 +175,19 @@
i,
new volScalarField
(
"dpdt",
fvc::ddt(thermoFluid[i].p())
IOobject
(
"dpdt",
runTime.timeName(),
fluidRegions[i]
),
fluidRegions[i],
dimensionedScalar
(
"dpdt",
thermoFluid[i].p().dimensions()/dimTime,
0
)
)
);
@ -194,5 +205,3 @@
new porousZones(fluidRegions[i])
);
}

View File

@ -74,8 +74,11 @@
p = p_rgh + rho*gh;
// Update pressure time derivative
dpdt = fvc::ddt(p);
// Update pressure time derivative if needed
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
// Solve continuity
#include "rhoEqn.H"

View File

@ -56,6 +56,8 @@ porousU -= rAUPorous*fvc::grad(porousP);
porousU.correctBoundaryConditions();
porousK = 0.5*magSqr(porousU);
// Update pressure time derivative
porousdpdt = fvc::ddt(porousP);
// Update pressure time derivative if needed
if (porousThermo.dpdt())
{
porousdpdt = fvc::ddt(porousP);
}

View File

@ -34,7 +34,7 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-lspecie \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \

View File

@ -37,7 +37,7 @@ EXE_LIBS = \
-llagrangianIntermediate \
-lcoalCombustion\
-lspecie \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \

View File

@ -37,7 +37,7 @@ Description
#include "fvCFD.H"
#include "turbulenceModel.H"
#include "basicThermoCloud.H"
#include "fluidThermoCloud.H"
#include "coalCloud.H"
#include "psiCombustionModel.H"
#include "IObasicSourceList.H"

View File

@ -9,7 +9,7 @@ coalCloud coalParcels
);
Info<< "\nConstructing limestone cloud" << endl;
basicThermoCloud limestoneParcels
fluidThermoCloud limestoneParcels
(
"limestoneCloud1",
rho,

View File

@ -111,7 +111,17 @@
combustion->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -82,4 +82,7 @@ sources.correct(U);
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -21,7 +21,7 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-lthermophysicalFunctions \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lradiationModels \
-lincompressibleRASModels \

View File

@ -72,7 +72,7 @@ int main(int argc, char *argv[])
laminarTransport.correct();
mu = nu*rhoInfValue;
mu = laminarTransport.nu()*rhoInfValue;
kinematicCloud.evolve();

View File

@ -17,7 +17,7 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-lthermophysicalFunctions \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lradiationModels \
-lincompressibleRASModels \

View File

@ -54,8 +54,6 @@
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
const volScalarField nu(laminarTransport.nu());
volScalarField mu
(
IOobject
@ -66,7 +64,7 @@
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
nu*rhoInfValue
laminarTransport.nu()*rhoInfValue
);
word kinematicCloudName("kinematicCloud");

View File

@ -66,7 +66,7 @@ int main(int argc, char *argv[])
laminarTransport.correct();
mu = nu*rhoInfValue;
mu = laminarTransport.nu()*rhoInfValue;
kinematicCloud.evolve();

View File

@ -35,7 +35,7 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-lspecie \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \

View File

@ -95,7 +95,17 @@
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -59,5 +59,8 @@
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
}

View File

@ -29,7 +29,7 @@ EXE_LIBS = \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lspecie \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \

View File

@ -65,7 +65,17 @@
combustion->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -49,4 +49,7 @@ p = p_rgh + rho*gh;
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -35,7 +35,7 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-lspecie \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \

View File

@ -72,7 +72,17 @@
combustion->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -77,4 +77,7 @@ U.correctBoundaryConditions();
sources.correct(U);
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -37,7 +37,7 @@ EXE_LIBS = \
-llagrangianIntermediate \
-llagrangianSpray \
-lspecie \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \

View File

@ -39,7 +39,7 @@ EXE_LIBS = \
-llagrangianIntermediate \
-llagrangianSpray \
-lspecie \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \

View File

@ -77,4 +77,7 @@ U.correctBoundaryConditions();
sources.correct(U);
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -15,7 +15,7 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-lthermophysicalFunctions \
-lbasicThermophysicalModels \
-lfluidThermophysicalModels \
-lspecie \
-lradiationModels \
-lcompressibleTurbulenceModel \

View File

@ -374,7 +374,17 @@
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K1("K1", 0.5*magSqr(U1));

View File

@ -180,5 +180,8 @@
K1 = 0.5*magSqr(U1);
K2 = 0.5*magSqr(U2);
dpdt = fvc::ddt(p);
//***HGW if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
}

View File

@ -403,11 +403,6 @@ Foam::multiphaseSystem::multiphaseSystem
calcAlphas();
alphas_.write();
forAllIter(PtrDictionary<phaseModel>, phases_, iter)
{
phaseModelTable_.add(iter());
}
interfaceDictTable dragModelsDict(lookup("drag"));
forAllConstIter(interfaceDictTable, dragModelsDict, iter)
@ -418,8 +413,8 @@ Foam::multiphaseSystem::multiphaseSystem
dragModel::New
(
iter(),
*phaseModelTable_.find(iter.key().first())(),
*phaseModelTable_.find(iter.key().second())()
*phases_.lookup(iter.key().first()),
*phases_.lookup(iter.key().second())
).ptr()
);
}

View File

@ -159,25 +159,6 @@ private:
//- Dictionary of phases
PtrDictionary<phaseModel> phases_;
//- phaseModelTable
class phaseModelTable
:
public HashTable<const phaseModel*>
{
public:
phaseModelTable()
{}
void add(const phaseModel& pm)
{
this->insert(pm.name(), &pm);
}
};
//- Phase model table for quick lookup
phaseModelTable phaseModelTable_;
const fvMesh& mesh_;
const surfaceScalarField& phi_;

View File

@ -51,7 +51,7 @@ boundaryField
inlet_4 { $inactive }
inlet_5 "a primitiveEntry is squashed by a directory entry";
inlet_5 { $inactive }
inlet_6 { $inactive }
inlet_6 { $.inactive } // Test scoping
inlet_7 { $inactive }
inlet_8 { $inactive }

View File

@ -24,7 +24,7 @@ keyY parentValue5;
"(.*)Dict"
{
foo subdictValue0;
bar $f.*; // should this really match 'foo'?
//bar $f.*; // should this really match 'foo'?
// result is dependent on insert order!
"a.*c" subdictValue3;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,7 +43,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createMesh.H"
pointMesh pMesh(mesh);
const pointMesh& pMesh = pointMesh::New(mesh);
pointVectorField U
(

View File

@ -208,7 +208,8 @@ label addPatch(polyMesh& mesh, const word& patchName)
0,
mesh.nInternalFaces(),
patchI,
patches
patches,
emptyPolyPatch::typeName
);
forAll(patches, i)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,8 +60,6 @@ int main(int argc, char *argv[])
# include "createMesh.H"
const word oldInstance = mesh.pointsInstance();
pointMesh pMesh(mesh);
word cellSetName(args.args()[1]);
const bool overwrite = args.optionFound("overwrite");
@ -114,11 +112,10 @@ int main(int argc, char *argv[])
// Read point fields
PtrList<pointScalarField> psFlds;
ReadFields(pMesh, objects, psFlds);
ReadFields(pointMesh::New(mesh), objects, psFlds);
PtrList<pointVectorField> pvFlds;
ReadFields(pMesh, objects, pvFlds);
ReadFields(pointMesh::New(mesh), objects, pvFlds);
// Construct refiner without unrefinement. Read existing point/cell level.
@ -164,7 +161,6 @@ int main(int argc, char *argv[])
// Update fields
mesh.updateMesh(map);
pMesh.updateMesh(map);
// Update numbering of cells/vertices.
meshCutter.updateMesh(map);
@ -173,7 +169,6 @@ int main(int argc, char *argv[])
if (map().hasMotionPoints())
{
mesh.movePoints(map().preMotionPoints());
pMesh.movePoints(map().preMotionPoints());
}
Pout<< "Refined from " << returnReduce(map().nOldCells(), sumOp<label>())

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -1113,7 +1113,8 @@ int main(int argc, char *argv[])
0,
0,
patchi,
mesh.boundaryMesh()
mesh.boundaryMesh(),
polyPatch::typeName
);
}
}

View File

@ -1,3 +1,4 @@
extrudedMesh/extrudedMesh.C
extrudeMesh.C
EXE = $(FOAM_APPBIN)/extrudeMesh

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,10 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "extrudedMesh.H"
#include "wallPolyPatch.H"
#include "meshTools.H"
#include "ListOps.H"
#include "OFstream.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -41,343 +37,4 @@ bool Foam::extrudedMesh::sameOrder(const face& f, const edge& e)
}
template
<
class Face,
template<class> class FaceList,
class PointField
>
Foam::Xfer<Foam::pointField> Foam::extrudedMesh::extrudedPoints
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
{
const pointField& surfacePoints = extrudePatch.localPoints();
const vectorField& surfaceNormals = extrudePatch.pointNormals();
const label nLayers = model.nLayers();
pointField ePoints((nLayers + 1)*surfacePoints.size());
for (label layer=0; layer<=nLayers; layer++)
{
label offset = layer*surfacePoints.size();
forAll(surfacePoints, i)
{
ePoints[offset + i] = model
(
surfacePoints[i],
surfaceNormals[i],
layer
);
}
}
// return points for transferring
return xferMove(ePoints);
}
template<class Face, template<class> class FaceList, class PointField>
Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
{
const pointField& surfacePoints = extrudePatch.localPoints();
const List<face>& surfaceFaces = extrudePatch.localFaces();
const edgeList& surfaceEdges = extrudePatch.edges();
const label nInternalEdges = extrudePatch.nInternalEdges();
const label nLayers = model.nLayers();
label nFaces =
(nLayers + 1)*surfaceFaces.size() + nLayers*surfaceEdges.size();
faceList eFaces(nFaces);
labelList quad(4);
label facei = 0;
// Internal faces
for (label layer=0; layer<nLayers; layer++)
{
label currentLayerOffset = layer*surfacePoints.size();
label nextLayerOffset = currentLayerOffset + surfacePoints.size();
// Vertical faces from layer to layer+1
for (label edgeI=0; edgeI<nInternalEdges; edgeI++)
{
const edge& e = surfaceEdges[edgeI];
const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
face& f = eFaces[facei++];
f.setSize(4);
if
(
(edgeFaces[0] < edgeFaces[1])
== sameOrder(surfaceFaces[edgeFaces[0]], e)
)
{
f[0] = e[0] + currentLayerOffset;
f[1] = e[1] + currentLayerOffset;
f[2] = e[1] + nextLayerOffset;
f[3] = e[0] + nextLayerOffset;
}
else
{
f[0] = e[1] + currentLayerOffset;
f[1] = e[0] + currentLayerOffset;
f[2] = e[0] + nextLayerOffset;
f[3] = e[1] + nextLayerOffset;
}
}
// Faces between layer and layer+1
if (layer < nLayers-1)
{
forAll(surfaceFaces, i)
{
eFaces[facei++] =
face
(
surfaceFaces[i] //.reverseFace()
+ nextLayerOffset
);
}
}
}
// External side faces
for (label layer=0; layer<nLayers; layer++)
{
label currentLayerOffset = layer*surfacePoints.size();
label nextLayerOffset = currentLayerOffset + surfacePoints.size();
// Side faces across layer
for (label edgeI=nInternalEdges; edgeI<surfaceEdges.size(); edgeI++)
{
const edge& e = surfaceEdges[edgeI];
const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
face& f = eFaces[facei++];
f.setSize(4);
if (sameOrder(surfaceFaces[edgeFaces[0]], e))
{
f[0] = e[0] + currentLayerOffset;
f[1] = e[1] + currentLayerOffset;
f[2] = e[1] + nextLayerOffset;
f[3] = e[0] + nextLayerOffset;
}
else
{
f[0] = e[1] + currentLayerOffset;
f[1] = e[0] + currentLayerOffset;
f[2] = e[0] + nextLayerOffset;
f[3] = e[1] + nextLayerOffset;
}
}
}
// Bottom faces
forAll(surfaceFaces, i)
{
eFaces[facei++] = face(surfaceFaces[i]).reverseFace();
}
// Top faces
forAll(surfaceFaces, i)
{
eFaces[facei++] =
face
(
surfaceFaces[i]
+ nLayers*surfacePoints.size()
);
}
// return points for transferring
return xferMove(eFaces);
}
template<class Face, template<class> class FaceList, class PointField>
Foam::Xfer<Foam::cellList> Foam::extrudedMesh::extrudedCells
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
{
const List<face>& surfaceFaces = extrudePatch.localFaces();
const edgeList& surfaceEdges = extrudePatch.edges();
const label nInternalEdges = extrudePatch.nInternalEdges();
const label nLayers = model.nLayers();
cellList eCells(nLayers*surfaceFaces.size());
// Size the cells
forAll(surfaceFaces, i)
{
const face& f = surfaceFaces[i];
for (label layer=0; layer<nLayers; layer++)
{
eCells[i + layer*surfaceFaces.size()].setSize(f.size() + 2);
}
}
// Current face count per cell.
labelList nCellFaces(eCells.size(), 0);
label facei = 0;
for (label layer=0; layer<nLayers; layer++)
{
// Side faces from layer to layer+1
for (label i=0; i<nInternalEdges; i++)
{
// Get patch faces using edge
const labelList& edgeFaces = extrudePatch.edgeFaces()[i];
// Get cells on this layer
label cell0 = layer*surfaceFaces.size() + edgeFaces[0];
label cell1 = layer*surfaceFaces.size() + edgeFaces[1];
eCells[cell0][nCellFaces[cell0]++] = facei;
eCells[cell1][nCellFaces[cell1]++] = facei;
facei++;
}
// Faces between layer and layer+1
if (layer < nLayers-1)
{
forAll(surfaceFaces, i)
{
label cell0 = layer*surfaceFaces.size() + i;
label cell1 = (layer+1)*surfaceFaces.size() + i;
eCells[cell0][nCellFaces[cell0]++] = facei;
eCells[cell1][nCellFaces[cell1]++] = facei;
facei++;
}
}
}
// External side faces
for (label layer=0; layer<nLayers; layer++)
{
// Side faces across layer
for (label i=nInternalEdges; i<surfaceEdges.size(); i++)
{
// Get patch faces using edge
const labelList& edgeFaces = extrudePatch.edgeFaces()[i];
// Get cells on this layer
label cell0 = layer*surfaceFaces.size() + edgeFaces[0];
eCells[cell0][nCellFaces[cell0]++] = facei;
facei++;
}
}
// Top faces
forAll(surfaceFaces, i)
{
eCells[i][nCellFaces[i]++] = facei;
facei++;
}
// Bottom faces
forAll(surfaceFaces, i)
{
label cell0 = (nLayers-1)*surfaceFaces.size() + i;
eCells[cell0][nCellFaces[cell0]++] = facei;
facei++;
}
// return points for transferring
return xferMove(eCells);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
<
class Face,
template<class> class FaceList,
class PointField
>
Foam::extrudedMesh::extrudedMesh
(
const IOobject& io,
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
:
polyMesh
(
io,
extrudedPoints(extrudePatch, model),
extrudedFaces(extrudePatch, model),
extrudedCells(extrudePatch, model)
),
model_(model)
{
List<polyPatch*> patches(3);
label facei = nInternalFaces();
label sz =
model_.nLayers()
*(extrudePatch.nEdges() - extrudePatch.nInternalEdges());
patches[0] = new wallPolyPatch
(
"sides",
sz,
facei,
0,
boundaryMesh()
);
facei += sz;
patches[1] = new polyPatch
(
"originalPatch",
extrudePatch.size(),
facei,
1,
boundaryMesh()
);
facei += extrudePatch.size();
patches[2] = new polyPatch
(
"otherSide",
extrudePatch.size(),
facei,
2,
boundaryMesh()
);
addPatches(patches);
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,6 +28,7 @@ Description
SourceFiles
extrudedMesh.C
extrudedMeshTemplates.C
\*---------------------------------------------------------------------------*/
@ -114,13 +115,11 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "extrudedMesh.C"
#else
# ifdef xlC
# pragma implementation("extrudedMesh.C")
# endif
# include "extrudedMeshTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,373 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "extrudedMesh.H"
#include "wallPolyPatch.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template
<
class Face,
template<class> class FaceList,
class PointField
>
Foam::Xfer<Foam::pointField> Foam::extrudedMesh::extrudedPoints
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
{
const pointField& surfacePoints = extrudePatch.localPoints();
const vectorField& surfaceNormals = extrudePatch.pointNormals();
const label nLayers = model.nLayers();
pointField ePoints((nLayers + 1)*surfacePoints.size());
for (label layer=0; layer<=nLayers; layer++)
{
label offset = layer*surfacePoints.size();
forAll(surfacePoints, i)
{
ePoints[offset + i] = model
(
surfacePoints[i],
surfaceNormals[i],
layer
);
}
}
// return points for transferring
return xferMove(ePoints);
}
template<class Face, template<class> class FaceList, class PointField>
Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
{
const pointField& surfacePoints = extrudePatch.localPoints();
const List<face>& surfaceFaces = extrudePatch.localFaces();
const edgeList& surfaceEdges = extrudePatch.edges();
const label nInternalEdges = extrudePatch.nInternalEdges();
const label nLayers = model.nLayers();
label nFaces =
(nLayers + 1)*surfaceFaces.size() + nLayers*surfaceEdges.size();
faceList eFaces(nFaces);
labelList quad(4);
label facei = 0;
// Internal faces
for (label layer=0; layer<nLayers; layer++)
{
label currentLayerOffset = layer*surfacePoints.size();
label nextLayerOffset = currentLayerOffset + surfacePoints.size();
// Vertical faces from layer to layer+1
for (label edgeI=0; edgeI<nInternalEdges; edgeI++)
{
const edge& e = surfaceEdges[edgeI];
const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
face& f = eFaces[facei++];
f.setSize(4);
if
(
(edgeFaces[0] < edgeFaces[1])
== sameOrder(surfaceFaces[edgeFaces[0]], e)
)
{
f[0] = e[0] + currentLayerOffset;
f[1] = e[1] + currentLayerOffset;
f[2] = e[1] + nextLayerOffset;
f[3] = e[0] + nextLayerOffset;
}
else
{
f[0] = e[1] + currentLayerOffset;
f[1] = e[0] + currentLayerOffset;
f[2] = e[0] + nextLayerOffset;
f[3] = e[1] + nextLayerOffset;
}
}
// Faces between layer and layer+1
if (layer < nLayers-1)
{
forAll(surfaceFaces, i)
{
eFaces[facei++] =
face
(
surfaceFaces[i] //.reverseFace()
+ nextLayerOffset
);
}
}
}
// External side faces
for (label layer=0; layer<nLayers; layer++)
{
label currentLayerOffset = layer*surfacePoints.size();
label nextLayerOffset = currentLayerOffset + surfacePoints.size();
// Side faces across layer
for (label edgeI=nInternalEdges; edgeI<surfaceEdges.size(); edgeI++)
{
const edge& e = surfaceEdges[edgeI];
const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
face& f = eFaces[facei++];
f.setSize(4);
if (sameOrder(surfaceFaces[edgeFaces[0]], e))
{
f[0] = e[0] + currentLayerOffset;
f[1] = e[1] + currentLayerOffset;
f[2] = e[1] + nextLayerOffset;
f[3] = e[0] + nextLayerOffset;
}
else
{
f[0] = e[1] + currentLayerOffset;
f[1] = e[0] + currentLayerOffset;
f[2] = e[0] + nextLayerOffset;
f[3] = e[1] + nextLayerOffset;
}
}
}
// Bottom faces
forAll(surfaceFaces, i)
{
eFaces[facei++] = face(surfaceFaces[i]).reverseFace();
}
// Top faces
forAll(surfaceFaces, i)
{
eFaces[facei++] =
face
(
surfaceFaces[i]
+ nLayers*surfacePoints.size()
);
}
// return points for transferring
return xferMove(eFaces);
}
template<class Face, template<class> class FaceList, class PointField>
Foam::Xfer<Foam::cellList> Foam::extrudedMesh::extrudedCells
(
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
{
const List<face>& surfaceFaces = extrudePatch.localFaces();
const edgeList& surfaceEdges = extrudePatch.edges();
const label nInternalEdges = extrudePatch.nInternalEdges();
const label nLayers = model.nLayers();
cellList eCells(nLayers*surfaceFaces.size());
// Size the cells
forAll(surfaceFaces, i)
{
const face& f = surfaceFaces[i];
for (label layer=0; layer<nLayers; layer++)
{
eCells[i + layer*surfaceFaces.size()].setSize(f.size() + 2);
}
}
// Current face count per cell.
labelList nCellFaces(eCells.size(), 0);
label facei = 0;
for (label layer=0; layer<nLayers; layer++)
{
// Side faces from layer to layer+1
for (label i=0; i<nInternalEdges; i++)
{
// Get patch faces using edge
const labelList& edgeFaces = extrudePatch.edgeFaces()[i];
// Get cells on this layer
label cell0 = layer*surfaceFaces.size() + edgeFaces[0];
label cell1 = layer*surfaceFaces.size() + edgeFaces[1];
eCells[cell0][nCellFaces[cell0]++] = facei;
eCells[cell1][nCellFaces[cell1]++] = facei;
facei++;
}
// Faces between layer and layer+1
if (layer < nLayers-1)
{
forAll(surfaceFaces, i)
{
label cell0 = layer*surfaceFaces.size() + i;
label cell1 = (layer+1)*surfaceFaces.size() + i;
eCells[cell0][nCellFaces[cell0]++] = facei;
eCells[cell1][nCellFaces[cell1]++] = facei;
facei++;
}
}
}
// External side faces
for (label layer=0; layer<nLayers; layer++)
{
// Side faces across layer
for (label i=nInternalEdges; i<surfaceEdges.size(); i++)
{
// Get patch faces using edge
const labelList& edgeFaces = extrudePatch.edgeFaces()[i];
// Get cells on this layer
label cell0 = layer*surfaceFaces.size() + edgeFaces[0];
eCells[cell0][nCellFaces[cell0]++] = facei;
facei++;
}
}
// Top faces
forAll(surfaceFaces, i)
{
eCells[i][nCellFaces[i]++] = facei;
facei++;
}
// Bottom faces
forAll(surfaceFaces, i)
{
label cell0 = (nLayers-1)*surfaceFaces.size() + i;
eCells[cell0][nCellFaces[cell0]++] = facei;
facei++;
}
// return points for transferring
return xferMove(eCells);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
<
class Face,
template<class> class FaceList,
class PointField
>
Foam::extrudedMesh::extrudedMesh
(
const IOobject& io,
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
const extrudeModel& model
)
:
polyMesh
(
io,
extrudedPoints(extrudePatch, model),
extrudedFaces(extrudePatch, model),
extrudedCells(extrudePatch, model)
),
model_(model)
{
List<polyPatch*> patches(3);
label facei = nInternalFaces();
label sz =
model_.nLayers()
*(extrudePatch.nEdges() - extrudePatch.nInternalEdges());
patches[0] = new wallPolyPatch
(
"sides",
sz,
facei,
0,
boundaryMesh(),
wallPolyPatch::typeName
);
facei += sz;
patches[1] = new polyPatch
(
"originalPatch",
extrudePatch.size(),
facei,
1,
boundaryMesh(),
polyPatch::typeName
);
facei += extrudePatch.size();
patches[2] = new polyPatch
(
"otherSide",
extrudePatch.size(),
facei,
2,
boundaryMesh(),
polyPatch::typeName
);
addPatches(patches);
}
// ************************************************************************* //

View File

@ -213,7 +213,8 @@ int main(int argc, char *argv[])
poly2DMesh.patchSizes()[patchI],
poly2DMesh.patchStarts()[patchI],
patchI,
mesh().boundaryMesh()
mesh().boundaryMesh(),
polyPatch::typeName
);
}

View File

@ -47,8 +47,6 @@ Description
#include "snapParameters.H"
#include "layerParameters.H"
#include "faceSet.H"
#include "motionSmoother.H"
using namespace Foam;
@ -430,7 +428,7 @@ int main(int argc, char *argv[])
// Refinement parameters
refinementParameters refineParams(refineDict);
if (!overwrite)
if (!overwrite && !debug)
{
const_cast<Time&>(mesh.time())++;
}
@ -467,7 +465,7 @@ int main(int argc, char *argv[])
curvature = refineParams.curvature();
}
if (!overwrite)
if (!overwrite && !debug)
{
const_cast<Time&>(mesh.time())++;
}
@ -507,7 +505,7 @@ int main(int argc, char *argv[])
}
if (!overwrite)
if (!overwrite && !debug)
{
const_cast<Time&>(mesh.time())++;
}

View File

@ -233,9 +233,17 @@ snapControls
// before upon reaching a correct mesh.
nRelaxIter 5;
//- Highly experimental and wip: number of feature edge snapping
// iterations. Leave out altogether to disable.
//nFeatureSnapIter 20;
// Feature snapping
//- Number of feature edge snapping iterations.
// Leave out altogether to disable.
nFeatureSnapIter 10;
//- Detect (geometric) features by sampling the surface (default=false)
implicitFeatureSnap false;
//- Use castellatedMeshControls::features (default = true)
explicitFeatureSnap true;
}
// Settings for the layer addition.

View File

@ -1,8 +1,8 @@
EXE_LIBS = \
-lautoMesh \
-lbarotropicCompressibilityModel \
-lbasicSolidThermo \
-lbasicThermophysicalModels \
-lsolidThermo \
-lfluidThermophysicalModels \
-lblockMesh \
-lchemistryModel \
-lcoalCombustion \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,41 +94,59 @@ int main(int argc, char *argv[])
if (args.optionFound("entry"))
{
wordList entryNames
(
fileName(args.option("entry")).components(':')
);
fileName entryName(args.option("entry"));
if (dict.found(entryNames[0]))
const entry* entPtr = NULL;
if (entryName.find('.') != string::npos)
{
const entry* entPtr = &dict.lookupEntry
// New syntax
entPtr = dict.lookupScopedEntryPtr
(
entryNames[0],
entryName,
false,
true // wildcards
);
for (int i=1; i<entryNames.size(); ++i)
}
else
{
// Old syntax
wordList entryNames(entryName.components(':'));
if (dict.found(entryNames[0]))
{
if (entPtr->dict().found(entryNames[i]))
entPtr = &dict.lookupEntry
(
entryNames[0],
false,
true // wildcards
);
for (int i=1; i<entryNames.size(); ++i)
{
entPtr = &entPtr->dict().lookupEntry
(
entryNames[i],
false,
true // wildcards
);
}
else
{
FatalErrorIn(args.executable())
<< "Cannot find sub-entry " << entryNames[i]
<< " in entry " << args["entry"]
<< " in dictionary " << dictFileName;
FatalError.exit(3);
if (entPtr->dict().found(entryNames[i]))
{
entPtr = &entPtr->dict().lookupEntry
(
entryNames[i],
false,
true // wildcards
);
}
else
{
FatalErrorIn(args.executable())
<< "Cannot find sub-entry " << entryNames[i]
<< " in entry " << args["entry"]
<< " in dictionary " << dictFileName;
FatalError.exit(3);
}
}
}
}
if (entPtr)
{
if (args.optionFound("keywords"))
{
/*
@ -158,7 +176,7 @@ int main(int argc, char *argv[])
{
FatalErrorIn(args.executable())
<< "Cannot find entry "
<< entryNames[0]
<< entryName
<< " in dictionary " << dictFileName;
FatalError.exit(2);
}

View File

@ -395,7 +395,7 @@ int main(int argc, char *argv[])
// Construct the point fields
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
pointMesh pMesh(mesh);
const pointMesh& pMesh = pointMesh::New(mesh);
PtrList<pointScalarField> pointScalarFields;
readFields(pMesh, objects, pointScalarFields);

View File

@ -341,7 +341,7 @@ int main(int argc, char *argv[])
{
Info<< "Reconstructing point fields" << nl << endl;
pointMesh pMesh(mesh);
const pointMesh& pMesh = pointMesh::New(mesh);
PtrList<pointMesh> pMeshes(procMeshes.meshes().size());
forAll(pMeshes, procI)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -195,7 +195,7 @@ void Foam::vtkPV3Foam::convertPointFields
}
// Construct interpolation on the raw mesh
pointMesh pMesh(mesh);
const pointMesh& pMesh = pointMesh::New(mesh);
convertPointFields<scalar>

Some files were not shown because too many files have changed in this diff Show More