Merge remote branch 'OpenCFD/master' into olesenm

Conflicts:
	src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C
This commit is contained in:
Mark Olesen
2010-05-31 11:50:56 +02:00
1421 changed files with 21173 additions and 9427 deletions

View File

@ -7,24 +7,8 @@ fvVectorMatrix UEqn
UEqn.relax(); UEqn.relax();
if (oCorr == nOuterCorr - 1) solve
{ (
solve
(
UEqn
==
fvc::reconstruct
(
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
),
mesh.solver("UFinal")
);
}
else
{
solve
(
UEqn UEqn
== ==
fvc::reconstruct fvc::reconstruct
@ -32,5 +16,4 @@ else
fvc::interpolate(rho)*(g & mesh.Sf()) fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf() - fvc::snGrad(p)*mesh.magSf()
) )
); );
}

View File

@ -70,6 +70,12 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++) for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{ {
bool finalIter = oCorr == nOuterCorr-1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
#include "UEqn.H" #include "UEqn.H"
#include "ftEqn.H" #include "ftEqn.H"
@ -80,6 +86,11 @@ int main(int argc, char *argv[])
{ {
#include "pEqn.H" #include "pEqn.H"
} }
if (finalIter)
{
mesh.data::remove("finalIteration");
}
} }
turbulence->correct(); turbulence->correct();

View File

@ -30,14 +30,20 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
closedVolume = p.needReference(); closedVolume = p.needReference();
if (corr == nCorr-1 && nonOrth == nNonOrthCorr) pEqn.solve
{ (
pEqn.solve(mesh.solver(p.name() + "Final")); mesh.solver
} (
else p.select
{ (
pEqn.solve(mesh.solver(p.name())); (
} finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
);
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {

View File

@ -31,14 +31,20 @@
- fvm::laplacian(rho*rUA, p) - fvm::laplacian(rho*rUA, p)
); );
if (ocorr == nOuterCorr && corr == nCorr && nonOrth == nNonOrthCorr) pEqn.solve
{ (
pEqn.solve(mesh.solver(p.name() + "Final")); mesh.solver
} (
else p.select
{ (
pEqn.solve(); (
} finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
);
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {
@ -64,14 +70,20 @@
- fvm::laplacian(rho*rUA, p) - fvm::laplacian(rho*rUA, p)
); );
if (ocorr == nOuterCorr && corr == nCorr && nonOrth == nNonOrthCorr) pEqn.solve
{ (
pEqn.solve(mesh.solver(p.name() + "Final")); mesh.solver
} (
else p.select
{ (
pEqn.solve(); (
} finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
);
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {

View File

@ -69,8 +69,14 @@ int main(int argc, char *argv[])
#include "chemistry.H" #include "chemistry.H"
#include "rhoEqn.H" #include "rhoEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) for (label oCorr=1; oCorr <= nOuterCorr; oCorr++)
{ {
bool finalIter = oCorr == nOuterCorr-1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
#include "UEqn.H" #include "UEqn.H"
#include "YEqn.H" #include "YEqn.H"
#include "hsEqn.H" #include "hsEqn.H"
@ -80,6 +86,11 @@ int main(int argc, char *argv[])
{ {
#include "pEqn.H" #include "pEqn.H"
} }
if (finalIter)
{
mesh.data::remove("finalIteration");
}
} }
turbulence->correct(); turbulence->correct();

View File

@ -7,27 +7,13 @@ tmp<fvVectorMatrix> UEqn
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
); );
if (oCorr == nOuterCorr-1) UEqn().relax();
{
UEqn().relax(1);
}
else
{
UEqn().relax();
}
volScalarField rUA = 1.0/UEqn().A(); volScalarField rUA = 1.0/UEqn().A();
if (momentumPredictor) if (momentumPredictor)
{ {
if (oCorr == nOuterCorr-1)
{
solve(UEqn() == -fvc::grad(p), mesh.solver("UFinal"));
}
else
{
solve(UEqn() == -fvc::grad(p)); solve(UEqn() == -fvc::grad(p));
}
} }
else else
{ {

View File

@ -37,12 +37,7 @@
mesh mesh
); );
# include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
dimensionedScalar pMin
(
mesh.solutionDict().subDict("PIMPLE").lookup("pMin")
);
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
@ -56,9 +51,6 @@
) )
); );
//dimensionedScalar initialMass = fvc::domainIntegrate(rho);
Info<< "Creating field DpDt\n" << endl; Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt = volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);

View File

@ -8,16 +8,8 @@
DpDt DpDt
); );
if (oCorr == nOuterCorr-1)
{
hEqn.relax();
hEqn.solve(mesh.solver("hFinal"));
}
else
{
hEqn.relax(); hEqn.relax();
hEqn.solve(); hEqn.solve();
}
thermo.correct(); thermo.correct();
} }

View File

@ -1,6 +1,5 @@
rho = thermo.rho(); rho = thermo.rho();
volScalarField rUA = 1.0/UEqn().A();
U = rUA*UEqn().H(); U = rUA*UEqn().H();
if (nCorr <= 1) if (nCorr <= 1)
@ -29,19 +28,20 @@ if (transonic)
- fvm::laplacian(rho*rUA, p) - fvm::laplacian(rho*rUA, p)
); );
if pEqn.solve
( (
oCorr == nOuterCorr-1 mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1 && corr == nCorr-1
&& nonOrth == nNonOrthCorr && nonOrth == nNonOrthCorr
) )
{ )
pEqn.solve(mesh.solver("pFinal")); )
} );
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {
@ -55,7 +55,7 @@ else
fvc::interpolate(rho)* fvc::interpolate(rho)*
( (
(fvc::interpolate(U) & mesh.Sf()) (fvc::interpolate(U) & mesh.Sf())
//+ fvc::ddtPhiCorr(rUA, rho, U, phi) + fvc::ddtPhiCorr(rUA, rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
@ -68,19 +68,20 @@ else
- fvm::laplacian(rho*rUA, p) - fvm::laplacian(rho*rUA, p)
); );
if pEqn.solve
( (
oCorr == nOuterCorr-1 mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1 && corr == nCorr-1
&& nonOrth == nNonOrthCorr && nonOrth == nNonOrthCorr
) )
{ )
pEqn.solve(mesh.solver("pFinal")); )
} );
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {
@ -92,30 +93,15 @@ else
#include "rhoEqn.H" #include "rhoEqn.H"
#include "compressibleContinuityErrs.H" #include "compressibleContinuityErrs.H"
//if (oCorr != nOuterCorr-1) // Explicitly relax pressure for momentum corrector
{ p.relax();
// Explicitly relax pressure for momentum corrector
p.relax();
rho = thermo.rho(); // Recalculate density from the relaxed pressure
rho.relax(); rho = thermo.rho();
Info<< "rho max/min : " << max(rho).value() Info<< "rho max/min : " << max(rho).value()
<< " " << min(rho).value() << endl; << " " << min(rho).value() << endl;
}
U -= rUA*fvc::grad(p); U -= rUA*fvc::grad(p);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
bound(p, pMin);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
/*
if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
}
*/

View File

@ -61,15 +61,22 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
if (nOuterCorr != 1) #include "rhoEqn.H"
{
p.storePrevIter();
rho.storePrevIter();
}
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++) for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{ {
bool finalIter = oCorr == nOuterCorr-1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
if (nOuterCorr != 1)
{
p.storePrevIter();
}
#include "UEqn.H" #include "UEqn.H"
#include "hEqn.H" #include "hEqn.H"
@ -80,6 +87,11 @@ int main(int argc, char *argv[])
} }
turbulence->correct(); turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
} }
runTime.write(); runTime.write();

View File

@ -1,3 +0,0 @@
rhoPisoFoam.C
EXE = $(FOAM_APPBIN)/rhoPisoFoam

View File

@ -1,13 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lcompressibleLESModels

View File

@ -1,11 +0,0 @@
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
);
if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}

View File

@ -1,58 +0,0 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& psi = thermo.psi();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
);
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
# include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);

View File

@ -1,12 +0,0 @@
{
solve
(
fvm::ddt(rho, h)
+ fvm::div(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
);
thermo.correct();
}

View File

@ -1,68 +0,0 @@
rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();
if (transonic)
{
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(rho*rUA, p)
);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi == pEqn.flux();
}
}
}
else
{
phi =
fvc::interpolate(rho)*
(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvc::div(phi)
- fvm::laplacian(rho*rUA, p)
);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi += pEqn.flux();
}
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);

View File

@ -1,93 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 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
rhoPisoFoam
Description
Transient PISO solver for compressible, laminar or turbulent flow.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
#include "hEqn.H"
#include "pEqn.H"
}
turbulence->correct();
rho = thermo.rho();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -7,14 +7,7 @@ tmp<fvVectorMatrix> UEqn
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
); );
if (oCorr == nOuterCorr-1) UEqn().relax();
{
UEqn().relax(1);
}
else
{
UEqn().relax();
}
mrfZones.addCoriolis(rho, UEqn()); mrfZones.addCoriolis(rho, UEqn());
pZones.addResistance(UEqn()); pZones.addResistance(UEqn());
@ -23,14 +16,7 @@ volScalarField rUA = 1.0/UEqn().A();
if (momentumPredictor) if (momentumPredictor)
{ {
if (oCorr == nOuterCorr-1)
{
solve(UEqn() == -fvc::grad(p), mesh.solver("UFinal"));
}
else
{
solve(UEqn() == -fvc::grad(p)); solve(UEqn() == -fvc::grad(p));
}
} }
else else
{ {

View File

@ -30,19 +30,20 @@ if (transonic)
- fvm::laplacian(rho*rUA, p) - fvm::laplacian(rho*rUA, p)
); );
if pEqn.solve
( (
oCorr == nOuterCorr-1 mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1 && corr == nCorr-1
&& nonOrth == nNonOrthCorr && nonOrth == nNonOrthCorr
) )
{ )
pEqn.solve(mesh.solver("pFinal")); )
} );
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {
@ -70,19 +71,20 @@ else
- fvm::laplacian(rho*rUA, p) - fvm::laplacian(rho*rUA, p)
); );
if pEqn.solve
( (
oCorr == nOuterCorr-1 mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1 && corr == nCorr-1
&& nonOrth == nNonOrthCorr && nonOrth == nNonOrthCorr
) )
{ )
pEqn.solve(mesh.solver("pFinal")); )
} );
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {

View File

@ -65,17 +65,23 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
bool finalIter = oCorr == nOuterCorr-1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
if (nOuterCorr != 1) if (nOuterCorr != 1)
{ {
p.storePrevIter(); p.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();
} }
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
#include "UEqn.H" #include "UEqn.H"
#include "hEqn.H" #include "hEqn.H"
@ -86,6 +92,11 @@ int main(int argc, char *argv[])
} }
turbulence->correct(); turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
} }
runTime.write(); runTime.write();

View File

@ -45,9 +45,14 @@
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
dimensionedScalar pMin dimensionedScalar rhoMax
( (
mesh.solutionDict().subDict("SIMPLE").lookup("pMin") mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax")
);
dimensionedScalar rhoMin
(
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin")
); );
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;

View File

@ -5,8 +5,8 @@
- fvm::Sp(fvc::div(phi), h) - fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h) - fvm::laplacian(turbulence->alphaEff(), h)
== ==
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p, "div(U,p)")) fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)")
- p*fvc::div(phi/fvc::interpolate(rho)) - (rho/psi)*fvc::div(phi/fvc::interpolate(rho))
); );
pZones.addEnthalpySource(thermo, rho, hEqn); pZones.addEnthalpySource(thermo, rho, hEqn);

View File

@ -1,3 +1,8 @@
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
if (pressureImplicitPorosity) if (pressureImplicitPorosity)
{ {
U = trTU()&UEqn().H(); U = trTU()&UEqn().H();
@ -58,8 +63,6 @@ else
U.correctBoundaryConditions(); U.correctBoundaryConditions();
bound(p, pMin);
// For closed-volume cases adjust the pressure and density levels // For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity // to obey overall mass continuity
if (closedVolume) if (closedVolume)
@ -69,5 +72,7 @@ if (closedVolume)
} }
rho = thermo.rho(); rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax(); rho.relax();
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;

View File

@ -37,7 +37,7 @@
mesh mesh
); );
# include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
label pRefCell = 0; label pRefCell = 0;

View File

@ -0,0 +1,3 @@
buoyantBoussinesqPimpleFoam.C
EXE = $(FOAM_APPBIN)/buoyantBoussinesqPimpleFoam

View File

@ -13,7 +13,6 @@
); );
TEqn.relax(); TEqn.relax();
TEqn.solve(); TEqn.solve();
rhok = 1.0 - beta*(T - TRef); rhok = 1.0 - beta*(T - TRef);

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application Application
buoyantBoussinesqPisoFoam buoyantBoussinesqPimpleFoam
Description Description
Transient solver for buoyant, turbulent flow of incompressible fluids Transient solver for buoyant, turbulent flow of incompressible fluids
@ -72,10 +72,24 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPISOControls.H" #include "readPIMPLEControls.H"
#include "CourantNo.H" #include "CourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
bool finalIter = oCorr == nOuterCorr-1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
if (nOuterCorr != 1)
{
p.storePrevIter();
}
#include "UEqn.H" #include "UEqn.H"
#include "TEqn.H" #include "TEqn.H"
@ -87,6 +101,12 @@ int main(int argc, char *argv[])
turbulence->correct(); turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
runTime.write(); runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

@ -42,9 +42,9 @@
mesh mesh
); );
# include "createPhi.H" #include "createPhi.H"
# include "readTransportProperties.H" #include "readTransportProperties.H"
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<incompressible::RASModel> turbulence autoPtr<incompressible::RASModel> turbulence
@ -57,7 +57,7 @@
setRefCell setRefCell
( (
p, p,
mesh.solutionDict().subDict("PISO"), mesh.solutionDict().subDict("PIMPLE"),
pRefCell, pRefCell,
pRefValue pRefValue
); );

View File

@ -0,0 +1,52 @@
{
volScalarField rUA("rUA", 1.0/UEqn.A());
surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA));
U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);
surfaceScalarField buoyancyPhi =
rUAf*fvc::interpolate(rhok)*(g & mesh.Sf());
phi += buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rUAf, p) == fvc::div(phi)
);
pEqn.solve
(
mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
);
if (nonOrth == nNonOrthCorr)
{
// Calculate the conservative fluxes
phi -= pEqn.flux();
// Explicitly relax pressure for momentum corrector
p.relax();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rUAf);
U.correctBoundaryConditions();
}
}
#include "continuityErrs.H"
}

View File

@ -1,3 +0,0 @@
buoyantBoussinesqPisoFoam.C
EXE = $(FOAM_APPBIN)/buoyantBoussinesqPisoFoam

View File

@ -1,41 +0,0 @@
{
volScalarField rUA("rUA", 1.0/UEqn.A());
surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA));
U = rUA*UEqn.H();
surfaceScalarField phiU
(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi)
);
phi = phiU + rUAf*fvc::interpolate(rhok)*(g & mesh.Sf());
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rUAf, p) == fvc::div(phi)
);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
}
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}
U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
U.correctBoundaryConditions();
#include "continuityErrs.H"
}

View File

@ -0,0 +1,3 @@
buoyantPimpleFoam.C
EXE = $(FOAM_APPBIN)/buoyantPimpleFoam

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application Application
buoyantPisoFoam buoyantPimpleFoam
Description Description
Transient solver for buoyant, turbulent flow of compressible fluids for Transient solver for buoyant, turbulent flow of compressible fluids for
@ -59,7 +59,7 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPISOControls.H" #include "readPIMPLEControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -69,12 +69,24 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
#include "UEqn.H" // --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
bool finalIter = oCorr == nOuterCorr-1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
if (nOuterCorr != 1)
{
p.storePrevIter();
}
#include "UEqn.H"
#include "hEqn.H" #include "hEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=0; corr<nCorr; corr++) for (int corr=0; corr<nCorr; corr++)
{ {
#include "pEqn.H" #include "pEqn.H"
@ -84,6 +96,12 @@ int main(int argc, char *argv[])
rho = thermo.rho(); rho = thermo.rho();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
runTime.write(); runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

@ -12,16 +12,15 @@
U = rUA*UEqn.H(); U = rUA*UEqn.H();
surfaceScalarField phiU phi = fvc::interpolate(rho)*
( (
fvc::interpolate(rho)
*(
(fvc::interpolate(U) & mesh.Sf()) (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi) + fvc::ddtPhiCorr(rUA, rho, U, phi)
)
); );
phi = phiU + rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf()); surfaceScalarField buoyancyPhi =
rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
phi += buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
@ -32,27 +31,39 @@
- fvm::laplacian(rhorUAf, p) - fvm::laplacian(rhorUAf, p)
); );
if (corr == nCorr-1 && nonOrth == nNonOrthCorr) pEqn.solve
{ (
pEqn.solve(mesh.solver(p.name() + "Final")); mesh.solver
} (
else p.select
{ (
pEqn.solve(mesh.solver(p.name())); (
} finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
);
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {
// Calculate the conservative fluxes
phi += pEqn.flux(); phi += pEqn.flux();
// Explicitly relax pressure for momentum corrector
p.relax();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U += rUA*fvc::reconstruct((buoyancyPhi + pEqn.flux())/rhorUAf);
U.correctBoundaryConditions();
} }
} }
// Second part of thermodynamic density update // Second part of thermodynamic density update
thermo.rho() += psi*p; thermo.rho() += psi*p;
U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf);
U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
#include "rhoEqn.H" #include "rhoEqn.H"

View File

@ -1,3 +0,0 @@
buoyantPisoFoam.C
EXE = $(FOAM_APPBIN)/buoyantPisoFoam

View File

@ -22,16 +22,7 @@
); );
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
// retain the residual from the first iteration
if (nonOrth == 0)
{
pEqn.solve(); pEqn.solve();
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {

View File

@ -1,16 +0,0 @@
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
);
if (ocorr != nOuterCorr-1)
{
UEqn.relax();
}
if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake
wmake pimpleDyMFoam
# ----------------------------------------------------------------- end-of-file

View File

@ -7,27 +7,13 @@ tmp<fvVectorMatrix> UEqn
+ turbulence->divDevReff(U) + turbulence->divDevReff(U)
); );
if (oCorr == nOuterCorr-1) UEqn().relax();
{
UEqn().relax(1);
}
else
{
UEqn().relax();
}
volScalarField rUA = 1.0/UEqn().A(); volScalarField rUA = 1.0/UEqn().A();
if (momentumPredictor) if (momentumPredictor)
{ {
if (oCorr == nOuterCorr-1)
{
solve(UEqn() == -fvc::grad(p), mesh.solver("UFinal"));
}
else
{
solve(UEqn() == -fvc::grad(p)); solve(UEqn() == -fvc::grad(p));
}
} }
else else
{ {

View File

@ -21,19 +21,20 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
if pEqn.solve
( (
oCorr == nOuterCorr-1 mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1 && corr == nCorr-1
&& nonOrth == nNonOrthCorr && nonOrth == nNonOrthCorr
) )
{ )
pEqn.solve(mesh.solver("pFinal")); )
} );
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {
@ -43,11 +44,8 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
#include "continuityErrs.H" #include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector except for last corrector // Explicitly relax pressure for momentum corrector
if (oCorr != nOuterCorr-1) p.relax();
{
p.relax();
}
U -= rUA*fvc::grad(p); U -= rUA*fvc::grad(p);
U.correctBoundaryConditions(); U.correctBoundaryConditions();

View File

@ -1,4 +1,5 @@
EXE_INC = \ EXE_INC = \
-I.. \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \

View File

@ -0,0 +1,55 @@
U = rAU*UEqn().H();
if (nCorr <= 1)
{
UEqn.clear();
}
phi = (fvc::interpolate(U) & mesh.Sf());
if (p.needReference())
{
fvc::makeRelative(phi, U);
adjustPhi(phi, U, p);
fvc::makeAbsolute(phi, U);
}
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve
(
mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
);
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}
#include "continuityErrs.H"
p.relax();
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();

View File

@ -84,8 +84,14 @@ int main(int argc, char *argv[])
} }
// --- PIMPLE loop // --- PIMPLE loop
for (int ocorr=0; ocorr<nOuterCorr; ocorr++) for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{ {
bool finalIter = oCorr == nOuterCorr-1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
if (nOuterCorr != 1) if (nOuterCorr != 1)
{ {
p.storePrevIter(); p.storePrevIter();
@ -96,62 +102,15 @@ int main(int argc, char *argv[])
// --- PISO loop // --- PISO loop
for (int corr=0; corr<nCorr; corr++) for (int corr=0; corr<nCorr; corr++)
{ {
rAU = 1.0/UEqn.A(); #include "pEqn.H"
U = rAU*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf());
if (p.needReference())
{
fvc::makeRelative(phi, U);
adjustPhi(phi, U, p);
fvc::makeAbsolute(phi, U);
}
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
if
(
ocorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
}
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}
#include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector
if (ocorr != nOuterCorr-1)
{
p.relax();
}
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
} }
turbulence->correct(); turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
} }
runTime.write(); runTime.write();

View File

@ -62,6 +62,12 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++) for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{ {
bool finalIter = oCorr == nOuterCorr-1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
if (nOuterCorr != 1) if (nOuterCorr != 1)
{ {
p.storePrevIter(); p.storePrevIter();
@ -76,6 +82,11 @@ int main(int argc, char *argv[])
} }
turbulence->correct(); turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
} }
runTime.write(); runTime.write();

View File

@ -1,4 +1,4 @@
Info<< "Reading transportProperties\n" << endl; Info<< "\nReading transportProperties\n" << endl;
IOdictionary transportProperties IOdictionary transportProperties
( (
@ -31,7 +31,7 @@
rhoInfValue rhoInfValue
); );
Info<< "\nReading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
@ -127,7 +127,7 @@
if (HdotGradHheader.headerOk()) if (HdotGradHheader.headerOk())
{ {
Info<< "\nReading field HdotGradH\n" << endl; Info<< "Reading field HdotGradH" << endl;
HdotGradHPtr_.reset HdotGradHPtr_.reset
( (

View File

@ -34,7 +34,8 @@
), ),
mesh, mesh,
dimless, dimless,
allLambda allLambda,
false // Use slices for the couples
); );

View File

@ -15,14 +15,7 @@
//- fvc::div(rho*turbulence->nuEff()*dev(fvc::grad(U)().T())) //- fvc::div(rho*turbulence->nuEff()*dev(fvc::grad(U)().T()))
); );
if (oCorr == nOuterCorr-1)
{
UEqn.relax(1);
}
else
{
UEqn.relax(); UEqn.relax();
}
if (momentumPredictor) if (momentumPredictor)
{ {
@ -34,7 +27,6 @@
( (
fvc::interpolate(rho)*(g & mesh.Sf()) fvc::interpolate(rho)*(g & mesh.Sf())
- mesh.magSf()*fvc::snGrad(p) - mesh.magSf()*fvc::snGrad(p)
), )
mesh.solver(oCorr == nOuterCorr-1 ? "UFinal" : "U")
); );
} }

View File

@ -22,18 +22,20 @@
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
if pEqn.solve
( (
corr == nCorr-1 mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr && nonOrth == nNonOrthCorr
) )
{ )
pEqn.solve(mesh.solver(p.name() + "Final")); )
} );
else
{
pEqn.solve(mesh.solver(p.name()));
}
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {

View File

@ -68,6 +68,12 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++) for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{ {
bool finalIter = oCorr == nOuterCorr-1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
twoPhaseProperties.correct(); twoPhaseProperties.correct();
#include "alphaEqn.H" #include "alphaEqn.H"
@ -83,6 +89,11 @@ int main(int argc, char *argv[])
#include "continuityErrs.H" #include "continuityErrs.H"
turbulence->correct(); turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
} }
runTime.write(); runTime.write();

View File

@ -1,10 +1,10 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*-------------------------------*- C++ -*---------------------------------*\
| ========= | | | ========= |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / OpenFOAM |
| \\ / O peration | Version: 1.6 | | \\ / |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / The Open Source CFD Toolbox |
| \\/ M anipulation | | | \\/ http://www.OpenFOAM.org |
\*---------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,10 +1,10 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*-------------------------------*- C++ -*---------------------------------*\
| ========= | | | ========= |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / OpenFOAM |
| \\ / O peration | Version: 1.6 | | \\ / |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / The Open Source CFD Toolbox |
| \\/ M anipulation | | | \\/ http://www.OpenFOAM.org |
\*---------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
FoamFile FoamFile
{ {
version 2.0; version 2.0;

View File

@ -1,10 +1,10 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*-------------------------------*- C++ -*---------------------------------*\
| ========= | | | ========= |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / OpenFOAM |
| \\ / O peration | Version: 1.6 | | \\ / |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / The Open Source CFD Toolbox |
| \\/ M anipulation | | | \\/ http://www.OpenFOAM.org |
\*---------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
( (

View File

@ -1,10 +1,10 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*-------------------------------*- C++ -*---------------------------------*\
| ========= | | | ========= |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / OpenFOAM |
| \\ / O peration | Version: 1.6 | | \\ / |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / The Open Source CFD Toolbox |
| \\/ M anipulation | | | \\/ http://www.OpenFOAM.org |
\*---------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -295,8 +295,7 @@ label mergePatchFaces
const faceZone& fZone = mesh.faceZones()[zoneID]; const faceZone& fZone = mesh.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(newMasterI)]; zoneFlip = fZone.flipMap()[fZone.whichFace(newMasterI)];
} }
label patchI = mesh.boundaryMesh().whichPatch(newMasterI); label patchID = mesh.boundaryMesh().whichPatch(newMasterI);
Pout<< "Restoring new master face " << newMasterI Pout<< "Restoring new master face " << newMasterI
<< " to vertices " << setFaceVerts[0] << endl; << " to vertices " << setFaceVerts[0] << endl;
@ -311,7 +310,7 @@ label mergePatchFaces
own, // owner own, // owner
-1, // neighbour -1, // neighbour
false, // face flip false, // face flip
patchI, // patch for face patchID, // patch for face
false, // remove from zone false, // remove from zone
zoneID, // zone for face zoneID, // zone for face
zoneFlip // face flip in zone zoneFlip // face flip in zone
@ -336,7 +335,7 @@ label mergePatchFaces
-1, // masterEdgeID, -1, // masterEdgeID,
newMasterI, // masterFaceID, newMasterI, // masterFaceID,
false, // flipFaceFlux, false, // flipFaceFlux,
patchI, // patchID, patchID, // patchID,
zoneID, // zoneID, zoneID, // zoneID,
zoneFlip // zoneFlip zoneFlip // zoneFlip
) )

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -579,17 +579,12 @@ void ReadCells
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"read CCM files as written by proSTAR/ccm\n"
" - does not handle 'interfaces' (couples), cyclics or data\n"
" - does not handle mesh regions (porosity, solids, ...)\n"
);
argList::noParallel(); argList::noParallel();
argList::validArgs.append("ccmFile"); argList::validArgs.append("ccm26 file");
# include "setRootCase.H"
# include "createTime.H"
#include "setRootCase.H"
#include "createTime.H"
// Foam mesh data // Foam mesh data
// ~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~
@ -620,7 +615,6 @@ int main(int argc, char *argv[])
{ {
const fileName ccmFile = args[1]; const fileName ccmFile = args[1];
const word ccmExt = ccmFile.ext();
if (!isFile(ccmFile)) if (!isFile(ccmFile))
{ {
@ -629,6 +623,8 @@ int main(int argc, char *argv[])
<< exit(FatalError); << exit(FatalError);
} }
word ccmExt = ccmFile.ext();
if (ccmExt != "ccm" && ccmExt != "ccmg") if (ccmExt != "ccm" && ccmExt != "ccmg")
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())

View File

@ -62,10 +62,6 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"read OpenFOAM mesh and write a pro-STAR (v4) bnd/cel/vrt format"
);
argList::noParallel(); argList::noParallel();
timeSelector::addOptions(); timeSelector::addOptions();
@ -78,7 +74,7 @@ int main(int argc, char *argv[])
argList::addBoolOption argList::addBoolOption
( (
"noBnd", "noBnd",
"suppress writing a boundary (.bnd) file" "suppress writing the .bnd file"
); );
# include "setRootCase.H" # include "setRootCase.H"

View File

@ -881,6 +881,9 @@ Foam::meshDualiser::meshDualiser(const polyMesh& mesh)
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::meshDualiser::setRefinement void Foam::meshDualiser::setRefinement
@ -1466,4 +1469,14 @@ void Foam::meshDualiser::setRefinement
} }
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// ************************************************************************* // // ************************************************************************* //

View File

@ -38,13 +38,8 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"convert pro-STAR (v3) mesh to OpenFOAM"
);
argList::noParallel(); argList::noParallel();
argList::validArgs.append("pro-STAR prefix"); argList::validArgs.append("STAR mesh file prefix");
argList::addOption argList::addOption
( (
"scale", "scale",
@ -61,7 +56,7 @@ int main(int argc, char *argv[])
const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0); const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
#include "createTime.H" # include "createTime.H"
starMesh makeMesh(args[1], runTime, scaleFactor); starMesh makeMesh(args[1], runTime, scaleFactor);

View File

@ -59,11 +59,6 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote
(
"convert pro-STAR (v4) mesh to OpenFOAM"
);
argList::noParallel(); argList::noParallel();
argList::validArgs.append("pro-STAR prefix"); argList::validArgs.append("pro-STAR prefix");
argList::addBoolOption argList::addBoolOption

View File

@ -206,25 +206,8 @@ int main(int argc, char *argv[])
Info<< nl << "Creating polyMesh from blockMesh" << endl; Info<< nl << "Creating polyMesh from blockMesh" << endl;
wordList patchNames = blocks.patchNames();
wordList patchTypes = blocks.patchTypes();
word defaultFacesName = "defaultFaces"; word defaultFacesName = "defaultFaces";
word defaultFacesType = emptyPolyPatch::typeName; word defaultFacesType = emptyPolyPatch::typeName;
wordList patchPhysicalTypes = blocks.patchPhysicalTypes();
preservePatchTypes
(
runTime,
runTime.constant(),
polyMeshDir,
patchNames,
patchTypes,
defaultFacesName,
defaultFacesType,
patchPhysicalTypes
);
polyMesh mesh polyMesh mesh
( (
IOobject IOobject
@ -236,11 +219,9 @@ int main(int argc, char *argv[])
xferCopy(blocks.points()), // could we re-use space? xferCopy(blocks.points()), // could we re-use space?
blocks.cells(), blocks.cells(),
blocks.patches(), blocks.patches(),
patchNames, blocks.patchDicts(),
patchTypes,
defaultFacesName, defaultFacesName,
defaultFacesType, defaultFacesType
patchPhysicalTypes
); );

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -0,0 +1,9 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso nonuniformTransformCyclic
wmake
# ----------------------------------------------------------------- end-of-file

View File

@ -1,14 +1,12 @@
EXE_INC = \ EXE_INC = \
-InonuniformTransformCyclic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
/* -I$(LIB_SRC)/surfMesh/lnInclude */ \
/* -I$(LIB_SRC)/lagrangian/basic/lnInclude */ \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lnonuniformTransformCyclic \
-lfiniteVolume \ -lfiniteVolume \
/* -lsurfMesh */ \
/* -llagrangian */ \
-lmeshTools \ -lmeshTools \
-ldynamicMesh -ldynamicMesh

View File

@ -31,7 +31,8 @@ Description
- if extruding boundary faces: - if extruding boundary faces:
- convert boundary faces to directMappedWall patches - convert boundary faces to directMappedWall patches
- extrude edges of faceZone as a <zone>_sidePatch - extrude edges of faceZone as a <zone>_sidePatch
- extrude edges inbetween different faceZones as a cyclic <zoneA>_<zoneB> - extrude edges inbetween different faceZones as a
(nonuniformTransform)cyclic <zoneA>_<zoneB>
- extrudes into master direction (i.e. away from the owner cell - extrudes into master direction (i.e. away from the owner cell
if flipMap is false) if flipMap is false)
- not parallel - not parallel
@ -129,8 +130,9 @@ Usage
#include "createShellMesh.H" #include "createShellMesh.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "cyclicPolyPatch.H"
#include "syncTools.H" #include "syncTools.H"
#include "cyclicPolyPatch.H"
#include "nonuniformTransformCyclicPolyPatch.H"
using namespace Foam; using namespace Foam;
@ -596,7 +598,7 @@ void createDummyFvMeshFiles(const polyMesh& mesh, const word& regionName)
} }
//XXXXXXXXX // Find a patch face that is not extruded. Return -1 if not found.
label findUncoveredPatchFace label findUncoveredPatchFace
( (
const fvMesh& mesh, const fvMesh& mesh,
@ -611,20 +613,19 @@ label findUncoveredPatchFace
extrudeFaceSet.insert(extrudeMeshFaces[i]); extrudeFaceSet.insert(extrudeMeshFaces[i]);
} }
label patchI = -1;
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI]; const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
forAll(eFaces, i) forAll(eFaces, i)
{ {
label faceI = eFaces[i]; label faceI = eFaces[i];
if (!mesh.isInternalFace(faceI) && !extrudeFaceSet.found(faceI)) if (!mesh.isInternalFace(faceI) && !extrudeFaceSet.found(faceI))
{ {
patchI = mesh.boundaryMesh().whichPatch(faceI); return faceI;
break;
} }
} }
return patchI; return -1;
} }
// Count the number of faces in patches that need to be created // Count the number of faces in patches that need to be created
void countExtrudePatches void countExtrudePatches
( (
@ -662,14 +663,14 @@ void countExtrudePatches
// so choose any uncovered one. If none found put face in // so choose any uncovered one. If none found put face in
// undetermined zone 'side' patch // undetermined zone 'side' patch
label patchI = findUncoveredPatchFace label faceI = findUncoveredPatchFace
( (
mesh, mesh,
UIndirectList<label>(extrudeMeshFaces, eFaces), UIndirectList<label>(extrudeMeshFaces, eFaces),
extrudeMeshEdges[edgeI] extrudeMeshEdges[edgeI]
); );
if (patchI == -1) if (faceI == -1)
{ {
// Determine the min zone of all connected zones. // Determine the min zone of all connected zones.
label minZone = zoneID[eFaces[0]]; label minZone = zoneID[eFaces[0]];
@ -686,6 +687,9 @@ void countExtrudePatches
Pstream::listCombineGather(zoneZonePatch, plusEqOp<label>()); Pstream::listCombineGather(zoneZonePatch, plusEqOp<label>());
Pstream::listCombineScatter(zoneZonePatch); Pstream::listCombineScatter(zoneZonePatch);
} }
// Lexical ordering for vectors.
bool lessThan(const point& x, const point& y) bool lessThan(const point& x, const point& y)
{ {
for (direction dir = 0; dir < point::nComponents; dir++) for (direction dir = 0; dir < point::nComponents; dir++)
@ -696,86 +700,137 @@ bool lessThan(const point& x, const point& y)
return false; return false;
} }
class minEqVectorListOp
// Combine vectors
class minEqVectorOp
{ {
public: public:
void operator()(List<vector>& x, const List<vector>& y) const void operator()(vector& x, const vector& y) const
{ {
if (y.size()) if (y != vector::zero)
{ {
if (x.size()) if (x == vector::zero)
{ {
forAll(x, i) x = y;
{
if (lessThan(y[i], x[i]))
{
x[i] = y[i];
} }
} else if (lessThan(y, x))
}
else
{ {
x = y; x = y;
} }
} }
} }
}; };
// Constrain&sync normals on points that are on coupled patches.
// Constrain&sync normals on points that are on coupled patches to make sure
// the face extruded from the edge has a valid normal with its coupled
// equivalent.
// Note that only points on cyclic edges need to be constrained and not
// all points touching cyclics since only edges become faces.
void constrainCoupledNormals void constrainCoupledNormals
( (
const fvMesh& mesh, const fvMesh& mesh,
const primitiveFacePatch& extrudePatch, const primitiveFacePatch& extrudePatch,
const labelList& regionToPoint, const labelList& meshEdges,
const faceList& pointRegions, // per face, per index the region
vectorField& regionNormals vectorField& regionNormals
) )
{ {
// Invert regionToPoint to create pointToRegions. const polyBoundaryMesh& patches = mesh.boundaryMesh();
labelListList pointToRegions
// Mark edges that are on boundary of extrusion.
Map<label> meshToExtrudEdge
( (
invertOneToMany 2*(extrudePatch.nEdges()-extrudePatch.nInternalEdges())
(
extrudePatch.nPoints(),
regionToPoint
)
); );
// Sort acc. to region so (hopefully) coupled points will do the same. for
forAll(pointToRegions, pointI) (
label extrudeEdgeI = extrudePatch.nInternalEdges();
extrudeEdgeI < extrudePatch.nEdges();
extrudeEdgeI++
)
{ {
sort(pointToRegions[pointI]); meshToExtrudEdge.insert(meshEdges[extrudeEdgeI], extrudeEdgeI);
} }
const polyBoundaryMesh& patches = mesh.boundaryMesh(); // For owner: normal at first point of edge when walking through faces
// in order.
// Constrain displacement on cyclic patches vectorField edgeNormals0(mesh.nEdges(), vector::zero);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vectorField edgeNormals1(mesh.nEdges(), vector::zero);
// Note: bit contentious to always do this on cyclic - should user use
// different patch type, e.g. 'cyclicSlip' instead?
// Loop through all edges of patch. If they are to be extruded mark the
// point normals in order.
forAll(patches, patchI) forAll(patches, patchI)
{ {
const polyPatch& pp = patches[patchI]; const polyPatch& pp = patches[patchI];
if (isA<cyclicPolyPatch>(pp)) if (isA<cyclicPolyPatch>(pp))
{ {
forAll(pp.meshPoints(), pointI) bool isOwner = refCast<const cyclicPolyPatch>(pp).owner();
forAll(pp.faceEdges(), faceI)
{ {
Map<label>::const_iterator fnd = const labelList& fEdges = pp.faceEdges()[faceI];
extrudePatch.meshPointMap().find forAll(fEdges, fp)
{
label meshEdgeI = pp.meshEdges()[fEdges[fp]];
if (meshToExtrudEdge.found(meshEdgeI))
{
// Edge corresponds to a extrusion edge. Store extrusion
// normals on edge so we can syncTools it.
//const edge& ppE = pp.edges()[fEdges[fp]];
//Pout<< "ppedge:" << pp.localPoints()[ppE[0]]
// << pp.localPoints()[ppE[1]]
// << endl;
const face& f = pp.localFaces()[faceI];
label fp0 = fp;
label fp1 = f.fcIndex(fp0);
label mp0 = pp[faceI][fp0];
label mp1 = pp[faceI][fp1];
// Find corresponding face and indices.
vector regionN0;
vector regionN1;
{
label exEdgeI = meshToExtrudEdge[meshEdgeI];
const labelList& eFaces =
extrudePatch.edgeFaces()[exEdgeI];
// Use 0th face.
label exFaceI = eFaces[0];
const face& exF = extrudePatch[exFaceI];
const face& exRegions = pointRegions[exFaceI];
// Find points
label r0 = exRegions[findIndex(exF, mp0)];
regionN0 = regionNormals[r0];
label r1 = exRegions[findIndex(exF, mp1)];
regionN1 = regionNormals[r1];
}
vector& nA =
( (
pp.meshPoints()[pointI] isOwner
? edgeNormals0[meshEdgeI]
: edgeNormals1[meshEdgeI]
); );
if (fnd != extrudePatch.meshPointMap().end())
{ nA = regionN0;
// fnd() is a point on this cyclic. const vector& cyc0 = pp.pointNormals()[f[fp0]];
const vector& cycNormal = pp.pointNormals()[pointI]; nA -= (nA&cyc0)*cyc0;
const labelList& pRegions = pointToRegions[fnd()];
forAll(pRegions, i) vector& nB =
{ (
// Remove cyclic normal component. isOwner
vector& regionNormal = regionNormals[pRegions[i]]; ? edgeNormals1[meshEdgeI]
regionNormal -= (regionNormal&cycNormal)*cycNormal; : edgeNormals0[meshEdgeI]
);
nB = regionN1;
const vector& cyc1 = pp.pointNormals()[f[fp1]];
nB -= (nB&cyc1)*cyc1;
} }
} }
} }
@ -786,45 +841,82 @@ void constrainCoupledNormals
// Synchronise regionNormals // Synchronise regionNormals
// ~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~
// Re-work regionNormals into multiple normals per point
List<List<vector> > pointNormals(mesh.nPoints());
forAll(pointToRegions, pointI)
{
const labelList& pRegions = pointToRegions[pointI];
label meshPointI = extrudePatch.meshPoints()[pointI];
List<vector>& pNormals = pointNormals[meshPointI];
pNormals.setSize(pRegions.size());
forAll(pRegions, i)
{
pNormals[i] = regionNormals[pRegions[i]];
}
}
// Synchronise // Synchronise
syncTools::syncPointList syncTools::syncEdgeList
( (
mesh, mesh,
pointNormals, edgeNormals0,
minEqVectorListOp(), minEqVectorOp(),
List<vector>(), // nullValue vector::zero // nullValue
false // applySeparation );
syncTools::syncEdgeList
(
mesh,
edgeNormals1,
minEqVectorOp(),
vector::zero // nullValue
); );
// Re-work back into regionNormals
forAll(pointToRegions, pointI)
{
const labelList& pRegions = pointToRegions[pointI];
label meshPointI = extrudePatch.meshPoints()[pointI]; // Re-work back into regionNormals
const List<vector>& pNormals = pointNormals[meshPointI]; forAll(patches, patchI)
forAll(pRegions, i)
{ {
regionNormals[pRegions[i]] = pNormals[i]; const polyPatch& pp = patches[patchI];
if (isA<cyclicPolyPatch>(pp))
{
bool isOwner = refCast<const cyclicPolyPatch>(pp).owner();
forAll(pp.faceEdges(), faceI)
{
const labelList& fEdges = pp.faceEdges()[faceI];
forAll(fEdges, fp)
{
label meshEdgeI = pp.meshEdges()[fEdges[fp]];
if (meshToExtrudEdge.found(meshEdgeI))
{
const face& f = pp.localFaces()[faceI];
label fp0 = fp;
label fp1 = f.fcIndex(fp0);
label mp0 = pp[faceI][fp0];
label mp1 = pp[faceI][fp1];
const vector& nA =
(
isOwner
? edgeNormals0[meshEdgeI]
: edgeNormals1[meshEdgeI]
);
const vector& nB =
(
isOwner
? edgeNormals1[meshEdgeI]
: edgeNormals0[meshEdgeI]
);
// Find corresponding face and indices.
{
label exEdgeI = meshToExtrudEdge[meshEdgeI];
const labelList& eFaces =
extrudePatch.edgeFaces()[exEdgeI];
// Use 0th face.
label exFaceI = eFaces[0];
const face& exF = extrudePatch[exFaceI];
const face& exRegions = pointRegions[exFaceI];
// Find points
label r0 = exRegions[findIndex(exF, mp0)];
regionNormals[r0] = nA;
label r1 = exRegions[findIndex(exF, mp1)];
regionNormals[r1] = nB;
}
}
}
}
} }
} }
} }
//XXXXXXXXX
tmp<pointField> calcOffset tmp<pointField> calcOffset
@ -1106,7 +1198,10 @@ int main(int argc, char *argv[])
// - zoneXXX_sides // - zoneXXX_sides
// - zoneXXX_zoneYYY // - zoneXXX_zoneYYY
labelList zoneSidePatch(faceZones.size(), 0); labelList zoneSidePatch(faceZones.size(), 0);
labelList zoneZonePatch(faceZones.size()*faceZones.size(), 0); // Patch to use for minZone
labelList zoneZonePatch_min(faceZones.size()*faceZones.size(), 0);
// Patch to use for maxZone
labelList zoneZonePatch_max(faceZones.size()*faceZones.size(), 0);
countExtrudePatches countExtrudePatches
( (
@ -1117,8 +1212,8 @@ int main(int argc, char *argv[])
extrudeMeshFaces, extrudeMeshFaces,
extrudeMeshEdges, extrudeMeshEdges,
zoneSidePatch, zoneSidePatch, // reuse for counting
zoneZonePatch zoneZonePatch_min // reuse for counting
); );
// Now check which patches to add. // Now check which patches to add.
@ -1162,31 +1257,48 @@ int main(int argc, char *argv[])
); );
label nInter = 0; label nInter = 0;
forAll(zoneZonePatch, minZone) forAll(zoneZonePatch_min, minZone)
{ {
for (label maxZone = minZone; maxZone < faceZones.size(); maxZone++) for (label maxZone = minZone; maxZone < faceZones.size(); maxZone++)
{ {
label index = minZone*faceZones.size()+maxZone; label index = minZone*faceZones.size()+maxZone;
if (zoneZonePatch[index] > 0) if (zoneZonePatch_min[index] > 0)
{ {
word patchName = word minToMax =
faceZones[minZone].name() faceZones[minZone].name()
+ "_" + "_to_"
+ faceZones[maxZone].name(); + faceZones[maxZone].name();
word maxToMin =
zoneZonePatch[index] = addPatch<cyclicPolyPatch> faceZones[maxZone].name()
+ "_to_"
+ faceZones[minZone].name();
{
transformDict.set("neighbourPatch", maxToMin);
zoneZonePatch_min[index] =
addPatch<nonuniformTransformCyclicPolyPatch>
( (
mesh, mesh,
patchName, minToMax,
transformDict transformDict
); );
Info<< zoneZonePatch_min[index] << '\t' << minToMax << nl;
Info<< zoneZonePatch[index]
<< '\t' << patchName << nl;
nInter++; nInter++;
} }
{
transformDict.set("neighbourPatch", minToMax);
zoneZonePatch_max[index] =
addPatch<nonuniformTransformCyclicPolyPatch>
(
mesh,
maxToMin,
transformDict
);
Info<< zoneZonePatch_max[index] << '\t' << maxToMin << nl;
nInter++;
}
}
} }
} }
Info<< "Added " << nInter << " inter-zone patches." << nl Info<< "Added " << nInter << " inter-zone patches." << nl
@ -1220,24 +1332,36 @@ int main(int argc, char *argv[])
{ {
label minZone = min(zone0,zone1); label minZone = min(zone0,zone1);
label maxZone = max(zone0,zone1); label maxZone = max(zone0,zone1);
label patchI = zoneZonePatch[minZone*faceZones.size()+maxZone]; label index = minZone*faceZones.size()+maxZone;
ePatches.setSize(eFaces.size()); ePatches.setSize(eFaces.size());
ePatches = patchI;
if (zone0 == minZone)
{
ePatches[0] = zoneZonePatch_min[index];
ePatches[1] = zoneZonePatch_max[index];
}
else
{
ePatches[0] = zoneZonePatch_max[index];
ePatches[1] = zoneZonePatch_min[index];
}
nonManifoldEdge[edgeI] = 1; nonManifoldEdge[edgeI] = 1;
} }
} }
else else
{ {
label patchI = findUncoveredPatchFace label faceI = findUncoveredPatchFace
( (
mesh, mesh,
UIndirectList<label>(extrudeMeshFaces, eFaces), UIndirectList<label>(extrudeMeshFaces, eFaces),
extrudeMeshEdges[edgeI] extrudeMeshEdges[edgeI]
); );
if (patchI != -1) if (faceI != -1)
{ {
label patchI = mesh.boundaryMesh().whichPatch(faceI);
ePatches.setSize(eFaces.size(), patchI); ePatches.setSize(eFaces.size(), patchI);
} }
else else
@ -1294,12 +1418,12 @@ int main(int argc, char *argv[])
( (
mesh, mesh,
extrudePatch, extrudePatch,
regionPoints, extrudeMeshEdges,
pointRegions,
regionNormals regionNormals
); );
// For debugging: dump hedgehog plot of normals // For debugging: dump hedgehog plot of normals
{ {
OFstream str(runTime.path()/"regionNormals.obj"); OFstream str(runTime.path()/"regionNormals.obj");

View File

@ -0,0 +1,8 @@
fvPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.C
pointPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatch.C
polyPatches/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C
pointPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchFields.C
fvsPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFields.C
fvPatchFields/constraint/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.C
LIB = $(FOAM_LIBBIN)/libnonuniformTransformCyclic

View File

@ -0,0 +1,5 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-lfiniteVolume

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
\*---------------------------------------------------------------------------*/
#include "nonuniformTransformCyclicFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
nonuniformTransformCyclicFvPatchField<Type>::nonuniformTransformCyclicFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
cyclicFvPatchField<Type>(p, iF)
{}
template<class Type>
nonuniformTransformCyclicFvPatchField<Type>::nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
cyclicFvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
nonuniformTransformCyclicFvPatchField<Type>::nonuniformTransformCyclicFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
cyclicFvPatchField<Type>(p, iF, dict)
{}
template<class Type>
nonuniformTransformCyclicFvPatchField<Type>::nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>& ptf
)
:
cyclicFvPatchField<Type>(ptf)
{}
template<class Type>
nonuniformTransformCyclicFvPatchField<Type>::nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
cyclicFvPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,140 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
Class
Foam::nonuniformTransformCyclicFvPatchField
Description
Foam::nonuniformTransformCyclicFvPatchField
SourceFiles
nonuniformTransformCyclicFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvPatchField_H
#define nonuniformTransformCyclicFvPatchField_H
#include "cyclicFvPatchField.H"
#include "nonuniformTransformCyclicFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicFvPatch Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class nonuniformTransformCyclicFvPatchField
:
public cyclicFvPatchField<Type>
{
// Private data
public:
//- Runtime type information
TypeName(nonuniformTransformCyclicFvPatch::typeName_());
// Constructors
//- Construct from patch and internal field
nonuniformTransformCyclicFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
nonuniformTransformCyclicFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given nonuniformTransformCyclicFvPatchField onto a new patch
nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new nonuniformTransformCyclicFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new nonuniformTransformCyclicFvPatchField<Type>(*this, iF)
);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "nonuniformTransformCyclicFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
\*---------------------------------------------------------------------------*/
#include "nonuniformTransformCyclicFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvPatchFields_H
#define nonuniformTransformCyclicFvPatchFields_H
#include "nonuniformTransformCyclicFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(nonuniformTransformCyclic)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvPatchFieldsFwd_H
#define nonuniformTransformCyclicFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class nonuniformTransformCyclicFvPatchField;
makePatchTypeFieldTypedefs(nonuniformTransformCyclic)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
\*---------------------------------------------------------------------------*/
#include "nonuniformTransformCyclicFvPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(nonuniformTransformCyclicFvPatch, 0);
addToRunTimeSelectionTable(fvPatch, nonuniformTransformCyclicFvPatch, polyPatch);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,79 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
Class
Foam::nonuniformTransformCyclicFvPatch
Description
Cyclic-plane patch.
SourceFiles
nonuniformTransformCyclicFvPatch.C
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvPatch_H
#define nonuniformTransformCyclicFvPatch_H
#include "cyclicFvPatch.H"
#include "nonuniformTransformCyclicPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicFvPatch Declaration
\*---------------------------------------------------------------------------*/
class nonuniformTransformCyclicFvPatch
:
public cyclicFvPatch
{
public:
//- Runtime type information
TypeName(nonuniformTransformCyclicPolyPatch::typeName_());
// Constructors
//- Construct from polyPatch
nonuniformTransformCyclicFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
:
cyclicFvPatch(patch, bm)
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
\*---------------------------------------------------------------------------*/
#include "nonuniformTransformCyclicFvsPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
nonuniformTransformCyclicFvsPatchField<Type>::nonuniformTransformCyclicFvsPatchField
(
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF
)
:
cyclicFvsPatchField<Type>(p, iF)
{}
template<class Type>
nonuniformTransformCyclicFvsPatchField<Type>::nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
cyclicFvsPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
nonuniformTransformCyclicFvsPatchField<Type>::nonuniformTransformCyclicFvsPatchField
(
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF,
const dictionary& dict
)
:
cyclicFvsPatchField<Type>(p, iF, dict)
{}
template<class Type>
nonuniformTransformCyclicFvsPatchField<Type>::nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>& ptf
)
:
cyclicFvsPatchField<Type>(ptf)
{}
template<class Type>
nonuniformTransformCyclicFvsPatchField<Type>::nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>& ptf,
const DimensionedField<Type, surfaceMesh>& iF
)
:
cyclicFvsPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,138 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
Class
Foam::nonuniformTransformCyclicFvsPatchField
Description
Foam::nonuniformTransformCyclicFvsPatchField
SourceFiles
nonuniformTransformCyclicFvsPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvsPatchField_H
#define nonuniformTransformCyclicFvsPatchField_H
#include "cyclicFvsPatchField.H"
#include "nonuniformTransformCyclicFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicFvsPatch Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class nonuniformTransformCyclicFvsPatchField
:
public cyclicFvsPatchField<Type>
{
public:
//- Runtime type information
TypeName(nonuniformTransformCyclicFvPatch::typeName_());
// Constructors
//- Construct from patch and internal field
nonuniformTransformCyclicFvsPatchField
(
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&
);
//- Construct from patch, internal field and dictionary
nonuniformTransformCyclicFvsPatchField
(
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&,
const dictionary&
);
//- Construct by mapping given nonuniformTransformCyclicFvsPatchField onto a new patch
nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvsPatchField<Type> > clone() const
{
return tmp<fvsPatchField<Type> >
(
new nonuniformTransformCyclicFvsPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>&,
const DimensionedField<Type, surfaceMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvsPatchField<Type> > clone
(
const DimensionedField<Type, surfaceMesh>& iF
) const
{
return tmp<fvsPatchField<Type> >
(
new nonuniformTransformCyclicFvsPatchField<Type>(*this, iF)
);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "nonuniformTransformCyclicFvsPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
\*---------------------------------------------------------------------------*/
#include "nonuniformTransformCyclicFvsPatchFields.H"
#include "fvsPatchFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeFvsPatchFields(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvsPatchFields_H
#define nonuniformTransformCyclicFvsPatchFields_H
#include "nonuniformTransformCyclicFvsPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeFvsPatchTypeFieldTypedefs(nonuniformTransformCyclic)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvsPatchFieldsFwd_H
#define nonuniformTransformCyclicFvsPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class nonuniformTransformCyclicFvsPatchField;
makeFvsPatchTypeFieldTypedefs(nonuniformTransformCyclic)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,110 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
\*---------------------------------------------------------------------------*/
#include "nonuniformTransformCyclicPointPatchField.H"
#include "transformField.H"
#include "symmTransformField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
nonuniformTransformCyclicPointPatchField<Type>::nonuniformTransformCyclicPointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF
)
:
cyclicPointPatchField<Type>(p, iF)
{}
template<class Type>
nonuniformTransformCyclicPointPatchField<Type>::nonuniformTransformCyclicPointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict
)
:
cyclicPointPatchField<Type>(p, iF, dict)
{}
template<class Type>
nonuniformTransformCyclicPointPatchField<Type>::nonuniformTransformCyclicPointPatchField
(
const nonuniformTransformCyclicPointPatchField<Type>& ptf,
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const pointPatchFieldMapper& mapper
)
:
cyclicPointPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
nonuniformTransformCyclicPointPatchField<Type>::nonuniformTransformCyclicPointPatchField
(
const nonuniformTransformCyclicPointPatchField<Type>& ptf,
const DimensionedField<Type, pointMesh>& iF
)
:
cyclicPointPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void nonuniformTransformCyclicPointPatchField<Type>::evaluate(const Pstream::commsTypes)
{
const vectorField& nHat = this->patch().pointNormals();
tmp<Field<Type> > tvalues =
(
(
this->patchInternalField()
+ transform(I - 2.0*sqr(nHat), this->patchInternalField())
)/2.0
);
// Get internal field to insert values into
Field<Type>& iF = const_cast<Field<Type>&>(this->internalField());
setInInternalField(iF, tvalues());
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,150 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
Class
Foam::nonuniformTransformCyclicPointPatchField
Description
Cyclic + slip constraints
SourceFiles
nonuniformTransformCyclicPointPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicPointPatchField_H
#define nonuniformTransformCyclicPointPatchField_H
#include "cyclicPointPatchField.H"
#include "nonuniformTransformCyclicPointPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicPointPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class nonuniformTransformCyclicPointPatchField
:
public cyclicPointPatchField<Type>
{
public:
//- Runtime type information
TypeName(nonuniformTransformCyclicPointPatch::typeName_());
// Constructors
//- Construct from patch and internal field
nonuniformTransformCyclicPointPatchField
(
const pointPatch&,
const DimensionedField<Type, pointMesh>&
);
//- Construct from patch, internal field and dictionary
nonuniformTransformCyclicPointPatchField
(
const pointPatch&,
const DimensionedField<Type, pointMesh>&,
const dictionary&
);
//- Construct by mapping given patchField<Type> onto a new patch
nonuniformTransformCyclicPointPatchField
(
const nonuniformTransformCyclicPointPatchField<Type>&,
const pointPatch&,
const DimensionedField<Type, pointMesh>&,
const pointPatchFieldMapper&
);
//- Construct and return a clone
virtual autoPtr<pointPatchField<Type> > clone() const
{
return autoPtr<pointPatchField<Type> >
(
new nonuniformTransformCyclicPointPatchField<Type>
(
*this
)
);
}
//- Construct as copy setting internal field reference
nonuniformTransformCyclicPointPatchField
(
const nonuniformTransformCyclicPointPatchField<Type>&,
const DimensionedField<Type, pointMesh>&
);
//- Construct and return a clone setting internal field reference
virtual autoPtr<pointPatchField<Type> > clone
(
const DimensionedField<Type, pointMesh>& iF
) const
{
return autoPtr<pointPatchField<Type> >
(
new nonuniformTransformCyclicPointPatchField<Type>
(
*this, iF
)
);
}
// Member functions
// Evaluation functions
//- Evaluate the patch field
virtual void evaluate
(
const Pstream::commsTypes commsType=Pstream::blocking
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "nonuniformTransformCyclicPointPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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/>.
\*---------------------------------------------------------------------------*/
#include "nonuniformTransformCyclicPointPatchFields.H"
#include "pointPatchFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePointPatchFields(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

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