Merge branch 'master' into particleInteractions

This commit is contained in:
graham
2010-05-27 16:12:53 +01:00
264 changed files with 4498 additions and 1499 deletions

View File

@ -7,22 +7,6 @@ fvVectorMatrix UEqn
UEqn.relax();
if (oCorr == nOuterCorr - 1)
{
solve
(
UEqn
==
fvc::reconstruct
(
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
),
mesh.solver("UFinal")
);
}
else
{
solve
(
UEqn
@ -33,4 +17,3 @@ else
- fvc::snGrad(p)*mesh.magSf()
)
);
}

View File

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

View File

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

View File

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

View File

@ -69,8 +69,14 @@ int main(int argc, char *argv[])
#include "chemistry.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 "YEqn.H"
#include "hsEqn.H"
@ -80,6 +86,11 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
turbulence->correct();

View File

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

View File

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

View File

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

View File

@ -1,6 +1,5 @@
rho = thermo.rho();
volScalarField rUA = 1.0/UEqn().A();
U = rUA*UEqn().H();
if (nCorr <= 1)
@ -29,19 +28,20 @@ if (transonic)
- fvm::laplacian(rho*rUA, p)
);
if
pEqn.solve
(
oCorr == nOuterCorr-1
mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
}
else
{
pEqn.solve();
}
)
)
);
if (nonOrth == nNonOrthCorr)
{
@ -55,7 +55,7 @@ else
fvc::interpolate(rho)*
(
(fvc::interpolate(U) & mesh.Sf())
//+ fvc::ddtPhiCorr(rUA, rho, U, phi)
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
@ -68,19 +68,20 @@ else
- fvm::laplacian(rho*rUA, p)
);
if
pEqn.solve
(
oCorr == nOuterCorr-1
mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
}
else
{
pEqn.solve();
}
)
)
);
if (nonOrth == nNonOrthCorr)
{
@ -92,30 +93,15 @@ else
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
//if (oCorr != nOuterCorr-1)
{
// Explicitly relax pressure for momentum corrector
p.relax();
// Recalculate density from the relaxed pressure
rho = thermo.rho();
rho.relax();
Info<< "rho max/min : " << max(rho).value()
<< " " << min(rho).value() << endl;
}
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
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;
if (nOuterCorr != 1)
{
p.storePrevIter();
rho.storePrevIter();
}
#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)
{
p.storePrevIter();
}
#include "UEqn.H"
#include "hEqn.H"
@ -80,6 +87,11 @@ int main(int argc, char *argv[])
}
turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
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)
);
if (oCorr == nOuterCorr-1)
{
UEqn().relax(1);
}
else
{
UEqn().relax();
}
mrfZones.addCoriolis(rho, UEqn());
pZones.addResistance(UEqn());
@ -22,16 +15,9 @@ pZones.addResistance(UEqn());
volScalarField rUA = 1.0/UEqn().A();
if (momentumPredictor)
{
if (oCorr == nOuterCorr-1)
{
solve(UEqn() == -fvc::grad(p), mesh.solver("UFinal"));
}
else
{
solve(UEqn() == -fvc::grad(p));
}
}
else
{
U = rUA*(UEqn().H() - fvc::grad(p));

View File

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

View File

@ -65,17 +65,23 @@ int main(int argc, char *argv[])
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)
{
p.storePrevIter();
rho.storePrevIter();
}
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
#include "UEqn.H"
#include "hEqn.H"
@ -86,6 +92,11 @@ int main(int argc, char *argv[])
}
turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
runTime.write();

View File

@ -45,9 +45,14 @@
scalar pRefValue = 0.0;
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;

View File

@ -5,8 +5,8 @@
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p, "div(U,p)"))
- p*fvc::div(phi/fvc::interpolate(rho))
fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)")
- (rho/psi)*fvc::div(phi/fvc::interpolate(rho))
);
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)
{
U = trTU()&UEqn().H();
@ -58,8 +63,6 @@ else
U.correctBoundaryConditions();
bound(p, pMin);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if (closedVolume)
@ -69,5 +72,7 @@ if (closedVolume)
}
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;

View File

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

View File

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

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
buoyantBoussinesqPisoFoam
buoyantBoussinesqPimpleFoam
Description
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;
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "readPIMPLEControls.H"
#include "CourantNo.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 "TEqn.H"
@ -87,6 +101,12 @@ int main(int argc, char *argv[])
turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

@ -57,7 +57,7 @@
setRefCell
(
p,
mesh.solutionDict().subDict("PISO"),
mesh.solutionDict().subDict("PIMPLE"),
pRefCell,
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/>.
Application
buoyantPisoFoam
buoyantPimpleFoam
Description
Transient solver for buoyant, turbulent flow of compressible fluids for
@ -59,7 +59,7 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
@ -69,12 +69,24 @@ int main(int argc, char *argv[])
#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"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "pEqn.H"
@ -84,6 +96,12 @@ int main(int argc, char *argv[])
rho = thermo.rho();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View File

@ -12,16 +12,15 @@
U = rUA*UEqn.H();
surfaceScalarField phiU
phi = fvc::interpolate(rho)*
(
fvc::interpolate(rho)
*(
(fvc::interpolate(U) & mesh.Sf())
+ 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++)
{
@ -32,27 +31,39 @@
- fvm::laplacian(rhorUAf, p)
);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
}
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())/rhorUAf);
U.correctBoundaryConditions();
}
}
// Second part of thermodynamic density update
thermo.rho() += psi*p;
U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf);
U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
#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);
// retain the residual from the first iteration
if (nonOrth == 0)
{
pEqn.solve();
}
else
{
pEqn.solve();
}
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,28 +7,14 @@ tmp<fvVectorMatrix> UEqn
+ turbulence->divDevReff(U)
);
if (oCorr == nOuterCorr-1)
{
UEqn().relax(1);
}
else
{
UEqn().relax();
}
volScalarField rUA = 1.0/UEqn().A();
if (momentumPredictor)
{
if (oCorr == nOuterCorr-1)
{
solve(UEqn() == -fvc::grad(p), mesh.solver("UFinal"));
}
else
{
solve(UEqn() == -fvc::grad(p));
}
}
else
{
U = rUA*(UEqn().H() - fvc::grad(p));

View File

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

View File

@ -1,4 +1,5 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/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
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();
@ -96,62 +102,15 @@ int main(int argc, char *argv[])
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
rAU = 1.0/UEqn.A();
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();
#include "pEqn.H"
}
turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
runTime.write();

View File

@ -62,6 +62,12 @@ int main(int argc, char *argv[])
// --- 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();
@ -76,6 +82,11 @@ int main(int argc, char *argv[])
}
turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
runTime.write();

View File

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

View File

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

View File

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

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 = \
-InonuniformTransformCyclic/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)/dynamicMesh/lnInclude
EXE_LIBS = \
-lnonuniformTransformCyclic \
-lfiniteVolume \
/* -lsurfMesh */ \
/* -llagrangian */ \
-lmeshTools \
-ldynamicMesh

View File

@ -31,7 +31,8 @@ Description
- if extruding boundary faces:
- convert boundary faces to directMappedWall patches
- 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
if flipMap is false)
- not parallel
@ -129,8 +130,9 @@ Usage
#include "createShellMesh.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "cyclicPolyPatch.H"
#include "syncTools.H"
#include "cyclicPolyPatch.H"
#include "nonuniformTransformCyclicPolyPatch.H"
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
(
const fvMesh& mesh,
@ -611,20 +613,19 @@ label findUncoveredPatchFace
extrudeFaceSet.insert(extrudeMeshFaces[i]);
}
label patchI = -1;
const labelList& eFaces = mesh.edgeFaces()[meshEdgeI];
forAll(eFaces, i)
{
label faceI = eFaces[i];
if (!mesh.isInternalFace(faceI) && !extrudeFaceSet.found(faceI))
{
patchI = mesh.boundaryMesh().whichPatch(faceI);
break;
return faceI;
}
}
return patchI;
return -1;
}
// Count the number of faces in patches that need to be created
void countExtrudePatches
(
@ -662,14 +663,14 @@ void countExtrudePatches
// so choose any uncovered one. If none found put face in
// undetermined zone 'side' patch
label patchI = findUncoveredPatchFace
label faceI = findUncoveredPatchFace
(
mesh,
UIndirectList<label>(extrudeMeshFaces, eFaces),
extrudeMeshEdges[edgeI]
);
if (patchI == -1)
if (faceI == -1)
{
// Determine the min zone of all connected zones.
label minZone = zoneID[eFaces[0]];
@ -686,6 +687,9 @@ void countExtrudePatches
Pstream::listCombineGather(zoneZonePatch, plusEqOp<label>());
Pstream::listCombineScatter(zoneZonePatch);
}
// Lexical ordering for vectors.
bool lessThan(const point& x, const point& y)
{
for (direction dir = 0; dir < point::nComponents; dir++)
@ -696,86 +700,137 @@ bool lessThan(const point& x, const point& y)
return false;
}
class minEqVectorListOp
// Combine vectors
class minEqVectorOp
{
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)
{
if (lessThan(y[i], x[i]))
{
x[i] = y[i];
x = y;
}
}
}
else
else if (lessThan(y, x))
{
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
(
const fvMesh& mesh,
const primitiveFacePatch& extrudePatch,
const labelList& regionToPoint,
const labelList& meshEdges,
const faceList& pointRegions, // per face, per index the region
vectorField& regionNormals
)
{
// Invert regionToPoint to create pointToRegions.
labelListList pointToRegions
const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Mark edges that are on boundary of extrusion.
Map<label> meshToExtrudEdge
(
invertOneToMany
(
extrudePatch.nPoints(),
regionToPoint
)
2*(extrudePatch.nEdges()-extrudePatch.nInternalEdges())
);
// Sort acc. to region so (hopefully) coupled points will do the same.
forAll(pointToRegions, pointI)
for
(
label extrudeEdgeI = extrudePatch.nInternalEdges();
extrudeEdgeI < extrudePatch.nEdges();
extrudeEdgeI++
)
{
sort(pointToRegions[pointI]);
meshToExtrudEdge.insert(meshEdges[extrudeEdgeI], extrudeEdgeI);
}
const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Constrain displacement on cyclic patches
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Note: bit contentious to always do this on cyclic - should user use
// different patch type, e.g. 'cyclicSlip' instead?
// For owner: normal at first point of edge when walking through faces
// in order.
vectorField edgeNormals0(mesh.nEdges(), vector::zero);
vectorField edgeNormals1(mesh.nEdges(), vector::zero);
// Loop through all edges of patch. If they are to be extruded mark the
// point normals in order.
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (isA<cyclicPolyPatch>(pp))
{
forAll(pp.meshPoints(), pointI)
bool isOwner = refCast<const cyclicPolyPatch>(pp).owner();
forAll(pp.faceEdges(), faceI)
{
Map<label>::const_iterator fnd =
extrudePatch.meshPointMap().find
const labelList& fEdges = pp.faceEdges()[faceI];
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())
{
// fnd() is a point on this cyclic.
const vector& cycNormal = pp.pointNormals()[pointI];
const labelList& pRegions = pointToRegions[fnd()];
forAll(pRegions, i)
{
// Remove cyclic normal component.
vector& regionNormal = regionNormals[pRegions[i]];
regionNormal -= (regionNormal&cycNormal)*cycNormal;
nA = regionN0;
const vector& cyc0 = pp.pointNormals()[f[fp0]];
nA -= (nA&cyc0)*cyc0;
vector& nB =
(
isOwner
? edgeNormals1[meshEdgeI]
: edgeNormals0[meshEdgeI]
);
nB = regionN1;
const vector& cyc1 = pp.pointNormals()[f[fp1]];
nB -= (nB&cyc1)*cyc1;
}
}
}
@ -786,45 +841,82 @@ void constrainCoupledNormals
// 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
syncTools::syncPointList
syncTools::syncEdgeList
(
mesh,
pointNormals,
minEqVectorListOp(),
List<vector>(), // nullValue
false // applySeparation
edgeNormals0,
minEqVectorOp(),
vector::zero // nullValue
);
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];
const List<vector>& pNormals = pointNormals[meshPointI];
forAll(pRegions, i)
// Re-work back into regionNormals
forAll(patches, patchI)
{
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
@ -1106,7 +1198,10 @@ int main(int argc, char *argv[])
// - zoneXXX_sides
// - zoneXXX_zoneYYY
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
(
@ -1117,8 +1212,8 @@ int main(int argc, char *argv[])
extrudeMeshFaces,
extrudeMeshEdges,
zoneSidePatch,
zoneZonePatch
zoneSidePatch, // reuse for counting
zoneZonePatch_min // reuse for counting
);
// Now check which patches to add.
@ -1162,31 +1257,48 @@ int main(int argc, char *argv[])
);
label nInter = 0;
forAll(zoneZonePatch, minZone)
forAll(zoneZonePatch_min, minZone)
{
for (label maxZone = minZone; maxZone < 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()
+ "_"
+ "_to_"
+ faceZones[maxZone].name();
zoneZonePatch[index] = addPatch<cyclicPolyPatch>
word maxToMin =
faceZones[maxZone].name()
+ "_to_"
+ faceZones[minZone].name();
{
transformDict.set("neighbourPatch", maxToMin);
zoneZonePatch_min[index] =
addPatch<nonuniformTransformCyclicPolyPatch>
(
mesh,
patchName,
minToMax,
transformDict
);
Info<< zoneZonePatch[index]
<< '\t' << patchName << nl;
Info<< zoneZonePatch_min[index] << '\t' << minToMax << nl;
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
@ -1220,24 +1332,36 @@ int main(int argc, char *argv[])
{
label minZone = min(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 = 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;
}
}
else
{
label patchI = findUncoveredPatchFace
label faceI = findUncoveredPatchFace
(
mesh,
UIndirectList<label>(extrudeMeshFaces, eFaces),
extrudeMeshEdges[edgeI]
);
if (patchI != -1)
if (faceI != -1)
{
label patchI = mesh.boundaryMesh().whichPatch(faceI);
ePatches.setSize(eFaces.size(), patchI);
}
else
@ -1294,12 +1418,12 @@ int main(int argc, char *argv[])
(
mesh,
extrudePatch,
regionPoints,
extrudeMeshEdges,
pointRegions,
regionNormals
);
// For debugging: dump hedgehog plot of normals
{
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
// ************************************************************************* //

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 nonuniformTransformCyclicPointPatchFields_H
#define nonuniformTransformCyclicPointPatchFields_H
#include "nonuniformTransformCyclicPointPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePointPatchFieldTypedefs(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,74 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "nonuniformTransformCyclicPointPatch.H"
#include "pointConstraint.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(nonuniformTransformCyclicPointPatch, 0);
// Add the patch constructor functions to the hash tables
addToRunTimeSelectionTable
(
facePointPatch,
nonuniformTransformCyclicPointPatch,
polyPatch
);
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const vectorField& nonuniformTransformCyclicPointPatch::pointNormals() const
{
// Use underlying patch normals
return refCast<const facePointPatch>
(
*this
).facePointPatch::pointNormals();
}
void nonuniformTransformCyclicPointPatch::applyConstraint
(
const label pointi,
pointConstraint& pc
) const
{
pc.applyConstraint(pointNormals()[pointi]);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,102 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::nonuniformTransformCyclicPointPatch
Description
Cyclic patch with slip constraint
SourceFiles
nonuniformTransformCyclicPointPatch.C
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicPointPatch_H
#define nonuniformTransformCyclicPointPatch_H
#include "cyclicPointPatch.H"
#include "nonuniformTransformCyclicPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicPointPatch Declaration
\*---------------------------------------------------------------------------*/
class nonuniformTransformCyclicPointPatch
:
public cyclicPointPatch
{
public:
//- Runtime type information
TypeName(nonuniformTransformCyclicPolyPatch::typeName_());
// Constructors
//- Construct from components
nonuniformTransformCyclicPointPatch
(
const polyPatch& patch,
const pointBoundaryMesh& bm
)
:
cyclicPointPatch(patch, bm)
{}
// Destructor
virtual ~nonuniformTransformCyclicPointPatch()
{}
// Member Functions
//- Return point unit normals.
virtual const vectorField& pointNormals() const;
//- Accumulate the effect of constraint direction of this patch
virtual void applyConstraint
(
const label pointi,
pointConstraint&
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "nonuniformTransformCyclicPolyPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(nonuniformTransformCyclicPolyPatch, 0);
addToRunTimeSelectionTable(polyPatch, nonuniformTransformCyclicPolyPatch, word);
addToRunTimeSelectionTable(polyPatch, nonuniformTransformCyclicPolyPatch, dictionary);
}
// ************************************************************************* //

View File

@ -0,0 +1,177 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::nonuniformTransformCyclicPolyPatch
Description
Transform boundary used in extruded regions. Allows non-uniform transforms.
Wip.
SourceFiles
nonuniformTransformCyclicPolyPatch.C
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicPolyPatch_H
#define nonuniformTransformCyclicPolyPatch_H
#include "cyclicPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicPolyPatch Declaration
\*---------------------------------------------------------------------------*/
class nonuniformTransformCyclicPolyPatch
:
public cyclicPolyPatch
{
public:
//- Runtime type information
TypeName("nonuniformTransformCyclic");
// Constructors
//- Construct from components
nonuniformTransformCyclicPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm
)
:
cyclicPolyPatch(name, size, start, index, bm)
{}
//- Construct from dictionary
nonuniformTransformCyclicPolyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm
)
:
cyclicPolyPatch(name, dict, index, bm)
{}
//- Construct as copy, resetting the boundary mesh
nonuniformTransformCyclicPolyPatch
(
const nonuniformTransformCyclicPolyPatch& pp,
const polyBoundaryMesh& bm
)
:
cyclicPolyPatch(pp, bm)
{}
//- Construct given the original patch and resetting the
// face list and boundary mesh information
nonuniformTransformCyclicPolyPatch
(
const nonuniformTransformCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart,
const word& neighbPatchName
)
:
cyclicPolyPatch(pp, bm, index, newSize, newStart, neighbPatchName)
{}
//- Construct given the original patch and a map
nonuniformTransformCyclicPolyPatch
(
const nonuniformTransformCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
cyclicPolyPatch(pp, bm, index, mapAddressing, newStart)
{}
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
return autoPtr<polyPatch>
(
new nonuniformTransformCyclicPolyPatch(*this, bm)
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new nonuniformTransformCyclicPolyPatch
(
*this,
bm,
index,
newSize,
newStart,
neighbPatchName()
)
);
}
// Destructor
virtual ~nonuniformTransformCyclicPolyPatch()
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,16 +2,16 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / 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 2 of the License, or (at your
option) any later version.
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
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
foamUpgradeCyclics

View File

@ -74,9 +74,13 @@ containers/LinkedLists/linkTypes/DLListBase/DLListBase.C
primitiveLists = primitives/Lists
$(primitiveLists)/boolList.C
$(primitiveLists)/labelIOList.C
$(primitiveLists)/labelListIOList.C
$(primitiveLists)/scalarList.C
$(primitiveLists)/scalarIOList.C
$(primitiveLists)/scalarListIOList.C
$(primitiveLists)/vectorList.C
$(primitiveLists)/vectorIOList.C
$(primitiveLists)/vectorListIOList.C
$(primitiveLists)/sphericalTensorList.C
$(primitiveLists)/symmTensorList.C
$(primitiveLists)/tensorList.C
@ -486,9 +490,12 @@ $(Fields)/symmTensorField/symmTensorField.C
$(Fields)/tensorField/tensorField.C
$(Fields)/complexFields/complexFields.C
$(Fields)/labelField/labelIOField.C
$(Fields)/labelField/labelIOField.
$(Fields)/labelField/labelFieldIOField.C
$(Fields)/scalarField/scalarIOField.C
$(Fields)/scalarField/scalarFieldIOField.C
$(Fields)/vectorField/vectorIOField.C
$(Fields)/vectorField/vectorFieldIOField.C
$(Fields)/vector2DField/vector2DIOField.C
$(Fields)/sphericalTensorField/sphericalTensorIOField.C
$(Fields)/diagTensorField/diagTensorIOField.C
@ -545,4 +552,6 @@ $(writers)/gnuplotGraph/gnuplotGraph.C
$(writers)/xmgrGraph/xmgrGraph.C
$(writers)/jplotGraph/jplotGraph.C
meshes/data/data.C
LIB = $(FOAM_LIBBIN)/libOpenFOAM

View File

@ -0,0 +1,289 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "IOFieldField.H"
#include "labelList.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class T, class BaseType>
void Foam::IOFieldField<T, BaseType>::readFromStream()
{
Istream& is = readStream(word::null);
if (headerClassName() == IOField<T>::typeName)
{
is >> static_cast<Field<T>&>(*this);
close();
}
else if (headerClassName() == typeName)
{
is >> *this;
close();
}
else
{
FatalIOErrorIn
(
"IOFieldField<T, BaseType>::readFromStream()",
is
) << "unexpected class name " << headerClassName()
<< " expected " << typeName << " or " << IOField<T>::typeName
<< endl
<< " while reading object " << name()
<< exit(FatalIOError);
}
}
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
template<class T, class BaseType>
Foam::IOFieldField<T, BaseType>::IOFieldField(const IOobject& io)
:
regIOobject(io)
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readFromStream();
}
}
template<class T, class BaseType>
Foam::IOFieldField<T, BaseType>::IOFieldField
(
const IOobject& io,
const label size
)
:
regIOobject(io)
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readFromStream();
}
else
{
Field<T>::setSize(size);
}
}
template<class T, class BaseType>
Foam::IOFieldField<T, BaseType>::IOFieldField
(
const IOobject& io,
const Field<T>& list
)
:
regIOobject(io)
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readFromStream();
}
else
{
Field<T>::operator=(list);
}
}
template<class T, class BaseType>
Foam::IOFieldField<T, BaseType>::IOFieldField
(
const IOobject& io,
const Xfer<Field<T> >& list
)
:
regIOobject(io)
{
Field<T>::transfer(list());
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readFromStream();
}
}
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
template<class T, class BaseType>
Foam::IOFieldField<T, BaseType>::~IOFieldField()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T, class BaseType>
bool Foam::IOFieldField<T, BaseType>::writeObject
(
IOstream::streamFormat fmt,
IOstream::versionNumber ver,
IOstream::compressionType cmp
) const
{
if (fmt == IOstream::ASCII)
{
// Change type to be non-compact format type
const word oldTypeName = typeName;
const_cast<word&>(typeName) = IOField<T>::typeName;
bool good = regIOobject::writeObject(fmt, ver, cmp);
// Change type back
const_cast<word&>(typeName) = oldTypeName;
return good;
}
else
{
return regIOobject::writeObject(fmt, ver, cmp);
}
}
template<class T, class BaseType>
bool Foam::IOFieldField<T, BaseType>::writeData(Ostream& os) const
{
return (os << *this).good();
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T, class BaseType>
void Foam::IOFieldField<T, BaseType>::operator=
(
const IOFieldField<T, BaseType>& rhs
)
{
Field<T>::operator=(rhs);
}
template<class T, class BaseType>
void Foam::IOFieldField<T, BaseType>::operator=(const Field<T>& rhs)
{
Field<T>::operator=(rhs);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class T, class BaseType>
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::IOFieldField<T, BaseType>& L
)
{
// Read compact
const labelList start(is);
const Field<BaseType> elems(is);
// Convert
L.setSize(start.size()-1);
forAll(L, i)
{
T& subField = L[i];
label index = start[i];
subField.setSize(start[i+1] - index);
forAll(subField, j)
{
subField[j] = elems[index++];
}
}
return is;
}
template<class T, class BaseType>
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::IOFieldField<T, BaseType>& L
)
{
// Keep ascii writing same.
if (os.format() == IOstream::ASCII)
{
os << static_cast<const Field<T>&>(L);
}
else
{
// Convert to compact format
labelList start(L.size()+1);
start[0] = 0;
for (label i = 1; i < start.size(); i++)
{
start[i] = start[i-1]+L[i-1].size();
}
Field<BaseType> elems(start[start.size()-1]);
label elemI = 0;
forAll(L, i)
{
const T& subField = L[i];
forAll(subField, j)
{
elems[elemI++] = subField[j];
}
}
os << start << elems;
}
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,155 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::IOFieldField
Description
A Field of objects of type \<T\> with automated input and output.
SourceFiles
IOFieldField.C
\*---------------------------------------------------------------------------*/
#ifndef IOFieldField_H
#define IOFieldField_H
#include "IOField.H"
#include "regIOobject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class Istream;
class Ostream;
// Forward declaration of friend functions and operators
template<class T, class BaseType> class IOFieldField;
template<class T, class BaseType> Istream& operator>>
(
Istream&,
IOFieldField<T, BaseType>&
);
template<class T, class BaseType> Ostream& operator<<
(
Ostream&,
const IOFieldField<T, BaseType>&
);
/*---------------------------------------------------------------------------*\
Class IOFieldField Declaration
\*---------------------------------------------------------------------------*/
template<class T, class BaseType>
class IOFieldField
:
public regIOobject,
public Field<T>
{
// Private Member Functions
//- Read according to header type
void readFromStream();
public:
//- Runtime type information
TypeName("FieldField");
// Constructors
//- Construct from IOobject
IOFieldField(const IOobject&);
//- Construct from IOobject and size of IOFieldField
IOFieldField(const IOobject&, const label);
//- Construct from IOobject and a Field
IOFieldField(const IOobject&, const Field<T>&);
//- Construct by transferring the Field contents
IOFieldField(const IOobject&, const Xfer<Field<T> >&);
// Destructor
virtual ~IOFieldField();
// Member functions
virtual bool writeObject
(
IOstream::streamFormat,
IOstream::versionNumber,
IOstream::compressionType
) const;
virtual bool writeData(Ostream&) const;
// Member operators
void operator=(const IOFieldField<T, BaseType>&);
void operator=(const Field<T>&);
// IOstream operators
//- Read Field from Istream, discarding contents of existing Field.
friend Istream& operator>> <T, BaseType>
(
Istream&,
IOFieldField<T, BaseType>&
);
// Write Field to Ostream.
friend Ostream& operator<< <T, BaseType>
(
Ostream&,
const IOFieldField<T, BaseType>&
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "IOFieldField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,285 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "IOListList.H"
#include "labelList.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class T, class BaseType>
void Foam::IOListList<T, BaseType>::readFromStream()
{
Istream& is = readStream(word::null);
if (headerClassName() == IOList<T>::typeName)
{
is >> static_cast<List<T>&>(*this);
close();
}
else if (headerClassName() == typeName)
{
is >> *this;
close();
}
else
{
FatalIOErrorIn
(
"IOListList<T, BaseType>::readFromStream()",
is
) << "unexpected class name " << headerClassName()
<< " expected " << typeName << " or " << IOList<T>::typeName
<< endl
<< " while reading object " << name()
<< exit(FatalIOError);
}
}
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
template<class T, class BaseType>
Foam::IOListList<T, BaseType>::IOListList(const IOobject& io)
:
regIOobject(io)
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readFromStream();
}
}
template<class T, class BaseType>
Foam::IOListList<T, BaseType>::IOListList(const IOobject& io, const label size)
:
regIOobject(io)
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readFromStream();
}
else
{
List<T>::setSize(size);
}
}
template<class T, class BaseType>
Foam::IOListList<T, BaseType>::IOListList
(
const IOobject& io,
const List<T>& list
)
:
regIOobject(io)
{
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readFromStream();
}
else
{
List<T>::operator=(list);
}
}
template<class T, class BaseType>
Foam::IOListList<T, BaseType>::IOListList
(
const IOobject& io,
const Xfer<List<T> >& list
)
:
regIOobject(io)
{
List<T>::transfer(list());
if
(
io.readOpt() == IOobject::MUST_READ
|| (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{
readFromStream();
}
}
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
template<class T, class BaseType>
Foam::IOListList<T, BaseType>::~IOListList()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T, class BaseType>
bool Foam::IOListList<T, BaseType>::writeObject
(
IOstream::streamFormat fmt,
IOstream::versionNumber ver,
IOstream::compressionType cmp
) const
{
if (fmt == IOstream::ASCII)
{
// Change type to be non-compact format type
const word oldTypeName = typeName;
const_cast<word&>(typeName) = IOList<T>::typeName;
bool good = regIOobject::writeObject(fmt, ver, cmp);
// Change type back
const_cast<word&>(typeName) = oldTypeName;
return good;
}
else
{
return regIOobject::writeObject(fmt, ver, cmp);
}
}
template<class T, class BaseType>
bool Foam::IOListList<T, BaseType>::writeData(Ostream& os) const
{
return (os << *this).good();
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T, class BaseType>
void Foam::IOListList<T, BaseType>::operator=
(
const IOListList<T, BaseType>& rhs
)
{
List<T>::operator=(rhs);
}
template<class T, class BaseType>
void Foam::IOListList<T, BaseType>::operator=(const List<T>& rhs)
{
List<T>::operator=(rhs);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class T, class BaseType>
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::IOListList<T, BaseType>& L
)
{
// Read compact
const labelList start(is);
const List<BaseType> elems(is);
// Convert
L.setSize(start.size()-1);
forAll(L, i)
{
T& subList = L[i];
label index = start[i];
subList.setSize(start[i+1] - index);
forAll(subList, j)
{
subList[j] = elems[index++];
}
}
return is;
}
template<class T, class BaseType>
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::IOListList<T, BaseType>& L
)
{
// Keep ascii writing same.
if (os.format() == IOstream::ASCII)
{
os << static_cast<const List<T>&>(L);
}
else
{
// Convert to compact format
labelList start(L.size()+1);
start[0] = 0;
for (label i = 1; i < start.size(); i++)
{
start[i] = start[i-1]+L[i-1].size();
}
List<BaseType> elems(start[start.size()-1]);
label elemI = 0;
forAll(L, i)
{
const T& subList = L[i];
forAll(subList, j)
{
elems[elemI++] = subList[j];
}
}
os << start << elems;
}
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,155 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::IOListList
Description
A List of objects of type \<T\> with automated input and output.
SourceFiles
IOListList.C
\*---------------------------------------------------------------------------*/
#ifndef IOListList_H
#define IOListList_H
#include "IOList.H"
#include "regIOobject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class Istream;
class Ostream;
// Forward declaration of friend functions and operators
template<class T, class BaseType> class IOListList;
template<class T, class BaseType> Istream& operator>>
(
Istream&,
IOListList<T, BaseType>&
);
template<class T, class BaseType> Ostream& operator<<
(
Ostream&,
const IOListList<T, BaseType>&
);
/*---------------------------------------------------------------------------*\
Class IOListList Declaration
\*---------------------------------------------------------------------------*/
template<class T, class BaseType>
class IOListList
:
public regIOobject,
public List<T>
{
// Private Member Functions
//- Read according to header type
void readFromStream();
public:
//- Runtime type information
TypeName("ListList");
// Constructors
//- Construct from IOobject
IOListList(const IOobject&);
//- Construct from IOobject and size of IOListList
IOListList(const IOobject&, const label);
//- Construct from IOobject and a List
IOListList(const IOobject&, const List<T>&);
//- Construct by transferring the List contents
IOListList(const IOobject&, const Xfer<List<T> >&);
// Destructor
virtual ~IOListList();
// Member functions
virtual bool writeObject
(
IOstream::streamFormat,
IOstream::versionNumber,
IOstream::compressionType
) const;
virtual bool writeData(Ostream&) const;
// Member operators
void operator=(const IOListList<T, BaseType>&);
void operator=(const List<T>&);
// IOstream operators
//- Read List from Istream, discarding contents of existing List.
friend Istream& operator>> <T, BaseType>
(
Istream&,
IOListList<T, BaseType>&
);
// Write List to Ostream.
friend Ostream& operator<< <T, BaseType>
(
Ostream&,
const IOListList<T, BaseType>&
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "IOListList.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Description
labelField with IO.
\*---------------------------------------------------------------------------*/
#include "labelFieldIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebugWithName
(
labelFieldIOField,
"labelFieldField",
0
);
defineTemplateTypeNameAndDebugWithName
(
labelIOFieldField,
"labelCompactFieldField",
0
);
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Typedef
Foam::labelFieldIOField
Description
labelFieldField with IO.
\*---------------------------------------------------------------------------*/
#ifndef labelFieldIOField_H
#define labelFieldIOField_H
#include "labelField.H"
#include "IOField.H"
#include "IOFieldField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<labelField> labelFieldIOField;
typedef IOFieldField<labelField, label> labelIOFieldField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Description
scalarField with IO.
\*---------------------------------------------------------------------------*/
#include "scalarFieldIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebugWithName
(
scalarFieldIOField,
"scalarFieldField",
0
);
defineTemplateTypeNameAndDebugWithName
(
scalarIOFieldField,
"scalarCompactFieldField",
0
);
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Typedef
Foam::scalarFieldIOField
Description
scalarFieldField with IO.
\*---------------------------------------------------------------------------*/
#ifndef scalarFieldIOField_H
#define scalarFieldIOField_H
#include "scalarField.H"
#include "IOField.H"
#include "IOFieldField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<scalarField> scalarFieldIOField;
typedef IOFieldField<scalarField, scalar> scalarIOFieldField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Description
vectorField with IO.
\*---------------------------------------------------------------------------*/
#include "vectorFieldIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebugWithName
(
vectorFieldIOField,
"vectorFieldField",
0
);
defineTemplateTypeNameAndDebugWithName
(
vectorIOFieldField,
"vectorCompactFieldField",
0
);
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Typedef
Foam::vectorFieldIOField
Description
vectorFieldField with IO.
\*---------------------------------------------------------------------------*/
#ifndef vectorFieldIOField_H
#define vectorFieldIOField_H
#include "vectorField.H"
#include "IOField.H"
#include "IOFieldField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<vectorField> vectorFieldIOField;
typedef IOFieldField<vectorField, vector> vectorIOFieldField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -27,6 +27,7 @@ License
#include "Time.H"
#include "demandDrivenData.H"
#include "dictionary.H"
#include "data.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -918,6 +919,15 @@ bool Foam::GeometricField<Type, PatchField, GeoMesh>::needReference() const
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::relax(const scalar alpha)
{
if (debug)
{
InfoIn
(
"GeometricField<Type, PatchField, GeoMesh>::relax"
"(const scalar alpha)"
) << "Relaxing" << endl << this->info() << " by " << alpha << endl;
}
operator==(prevIter() + alpha*(*this - prevIter()));
}
@ -925,16 +935,33 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::relax(const scalar alpha)
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::relax()
{
scalar alpha = 0;
word name = this->name();
if (this->mesh().relax(this->name()))
if (this->mesh().data::lookupOrDefault<bool>("finalIteration", false))
{
alpha = this->mesh().relaxationFactor(this->name());
name += "Final";
}
if (alpha > 0)
if (this->mesh().relax(name))
{
relax(alpha);
relax(this->mesh().relaxationFactor(name));
}
}
template<class Type, template<class> class PatchField, class GeoMesh>
Foam::word Foam::GeometricField<Type, PatchField, GeoMesh>::select
(
bool final
) const
{
if (final)
{
return this->name() + "Final";
}
else
{
return this->name();
}
}

View File

@ -476,6 +476,11 @@ public:
// alpha is read from controlDict
void relax();
//- Select the final iteration parameters if `final' is true
// by returning the field name + "Final"
// otherwise the standard parameters by returning the field name
word select(bool final) const;
// Member function *this operators

View File

@ -2,16 +2,16 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / 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 2 of the License, or (at your
option) any later version.
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
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/

View File

@ -2,16 +2,16 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / 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 2 of the License, or (at your
option) any later version.
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
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::cyclicSlipPointPatchField

View File

@ -2,16 +2,16 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / 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 2 of the License, or (at your
option) any later version.
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
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/

View File

@ -2,16 +2,16 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / 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 2 of the License, or (at your
option) any later version.
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
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/

View File

@ -2,16 +2,16 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / 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 2 of the License, or (at your
option) any later version.
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
@ -19,8 +19,7 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/

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