Update of overRhoPimpleDyMFoam and overInterDyMFoam solvers.
Adding corresponding tutorials with best possible settings
The main effort was put on reducing pressure spikes as the
stencil change with hole cells on the background mesh.
This commit is contained in:
sergio
2018-10-17 10:10:06 -07:00
parent d2b32fcc84
commit 5daa38d5b4
68 changed files with 2967 additions and 287 deletions

View File

@ -0,0 +1,53 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
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/>.
Global
continuityErrs
Description
Calculates and prints the continuity errors.
\*---------------------------------------------------------------------------*/
{
dimensionedScalar totalMass = fvc::domainIntegrate(cellMask*rho);
scalar sumLocalContErr =
(
fvc::domainIntegrate(mag(cellMask*(rho - thermo.rho())))/totalMass
).value();
scalar globalContErr =
(
fvc::domainIntegrate(cellMask*(rho - thermo.rho()))/totalMass
).value();
cumulativeContErr += globalContErr;
Info<< "time step continuity errors : sum local = " << sumLocalContErr
<< ", global = " << globalContErr
<< ", cumulative = " << cumulativeContErr
<< endl;
}
// ************************************************************************* //

View File

@ -1,11 +1,84 @@
CorrectPhi if (mesh.changing())
( {
U, volVectorField::Boundary& bfld = U.boundaryFieldRef();
phi, forAll(bfld, patchi)
p, {
rho, if (bfld[patchi].fixesValue())
psi, {
dimensionedScalar("rAUf", dimTime, 1), bfld[patchi].initEvaluate();
divrhoU, }
pimple }
);
surfaceScalarField::Boundary& phiBfld = phi.boundaryFieldRef();
forAll(bfld, patchi)
{
if (bfld[patchi].fixesValue())
{
bfld[patchi].evaluate();
phiBfld[patchi] =
rho.boundaryField()[patchi]
* (
bfld[patchi]
& mesh.Sf().boundaryField()[patchi]
);
}
}
}
// Initialize BCs list for pcorr to zero-gradient
wordList pcorrTypes
(
p.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
);
// Set BCs of pcorr to fixed-value for patches at which p is fixed
forAll(p.boundaryField(), patchi)
{
if (p.boundaryField()[patchi].fixesValue())
{
pcorrTypes[patchi] = fixedValueFvPatchScalarField::typeName;
}
}
volScalarField pcorr
(
IOobject
(
"pcorr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar(p.dimensions(), Zero),
pcorrTypes
);
mesh.setFluxRequired(pcorr.name());
{
dimensionedScalar rAUf("rAUf", dimTime, 1.0);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pcorrEqn
(
fvm::ddt(psi, pcorr)
+ fvc::div(phi)
- fvm::laplacian(rAUf, pcorr)
==
divrhoU()
);
pcorrEqn.solve(mesh.solver(pcorr.select(pimple.finalInnerIter())));
//Bypass virtual layer
//mesh.fvMesh::solve(pcorrEqn, d);
if (pimple.finalNonOrthogonalIter())
{
phi += pcorrEqn.flux();
}
}
}

View File

@ -1,11 +1,4 @@
#include "createTimeControls.H" bool ddtCorr
bool correctPhi
( (
pimple.dict().lookupOrDefault("correctPhi", true) pimple.dict().lookupOrDefault("ddtCorr", true)
);
bool checkMeshCourantNo
(
pimple.dict().lookupOrDefault("checkMeshCourantNo", false)
); );

View File

@ -1,10 +1,10 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
autoPtr<psiThermo> pThermo autoPtr<fluidThermo> pThermo
( (
psiThermo::New(mesh) fluidThermo::New(mesh)
); );
psiThermo& thermo = pThermo(); fluidThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
@ -39,6 +39,8 @@ volVectorField U
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
pressureControl pressureControl(p, rho, pimple.dict(), false);
dimensionedScalar rhoMax dimensionedScalar rhoMax
( (
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
@ -63,42 +65,25 @@ dimensionedScalar rhoMin
mesh.setFluxRequired(p.name()); mesh.setFluxRequired(p.name());
Info<< "Creating field dpdt\n" << endl; #include "createDpdt.H"
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(p.dimensions()/dimTime, Zero)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
#include "createK.H"
//- Overset specific //- Overset specific
// Add solver-specific interpolations // Add solver-specific interpolations
{ {
dictionary oversetDict; wordHashSet& nonInt =
oversetDict.add("U", true); const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields());
oversetDict.add("p", true);
oversetDict.add("HbyA", true);
oversetDict.add("grad(p)", true);
const_cast<dictionary&> nonInt.insert("HbyA");
( nonInt.insert("grad(p)");
mesh.schemesDict() nonInt.insert("surfaceIntegrate(phi)");
).add nonInt.insert("surfaceIntegrate(phiHbyA)");
( nonInt.insert("cellMask");
"oversetInterpolationRequired", nonInt.insert("cellDisplacement");
oversetDict, nonInt.insert("interpolatedCells");
true nonInt.insert("cellInterpolationWeight");
);
} }
// Mask field for zeroing out contributions on hole cells // Mask field for zeroing out contributions on hole cells

View File

@ -38,10 +38,11 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "dynamicFvMesh.H" #include "dynamicFvMesh.H"
#include "psiThermo.H" #include "fluidThermo.H"
#include "turbulentFluidThermoModel.H" #include "turbulentFluidThermoModel.H"
#include "bound.H" #include "bound.H"
#include "pimpleControl.H" #include "pimpleControl.H"
#include "pressureControl.H"
#include "CorrectPhi.H" #include "CorrectPhi.H"
#include "fvOptions.H" #include "fvOptions.H"
#include "localEulerDdtScheme.H" #include "localEulerDdtScheme.H"
@ -56,13 +57,13 @@ int main(int argc, char *argv[])
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createDynamicFvMesh.H" #include "createDynamicFvMesh.H"
#include "createControl.H" #include "createDyMControls.H"
#include "createRDeltaT.H" #include "createRDeltaT.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "createFields.H" #include "createFields.H"
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvOptions.H"
#include "createRhoUf.H" #include "createRhoUfIfPresent.H"
#include "createControls.H" #include "createControls.H"
turbulence->validate(); turbulence->validate();
@ -80,16 +81,24 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readControls.H" #include "readControls.H"
#include "readDyMControls.H"
{
// Store divrhoU from the previous mesh so that it can be mapped // Store divrhoU from the previous mesh so that it can be mapped
// and used in correctPhi to ensure the corrected phi has the // and used in correctPhi to ensure the corrected phi has the
// same divergence // same divergence
volScalarField divrhoU autoPtr<volScalarField> divrhoU;
if (correctPhi)
{
divrhoU.reset
(
new volScalarField
( (
"divrhoU", "divrhoU",
fvc::div(fvc::absolute(phi, rho, U)) fvc::div(fvc::absolute(phi, rho, U))
)
); );
}
if (LTS) if (LTS)
{ {
@ -105,41 +114,74 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
// Store momentum to set rhoUf for introduced faces. // --- Pressure-velocity PIMPLE corrector loop
volVectorField rhoU("rhoU", rho*U); while (pimple.loop())
{
if (pimple.firstIter() || moveMeshOuterCorrectors)
{
// Do any mesh changes // Do any mesh changes
mesh.update(); mesh.update();
if (mesh.changing()) if (mesh.changing())
{ {
MRF.update();
#include "setCellMask.H" #include "setCellMask.H"
const surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
// Zero Uf on old faceMask (H-I)
rhoUf() *= faceMaskOld;
surfaceVectorField rhoUfint(fvc::interpolate(rho*U));
// Update Uf and phi on new C-I faces
rhoUf() += (1-faceMaskOld)*rhoUfint;
// Update Uf boundary
forAll(rhoUf().boundaryField(), patchI)
{
rhoUf().boundaryFieldRef()[patchI] =
rhoUfint.boundaryField()[patchI];
} }
if (mesh.changing() && correctPhi)
{
// Calculate absolute flux from the mapped surface velocity // Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & rhoUf; phi = mesh.Sf() & rhoUf();
if (correctPhi)
{
#include "correctPhi.H" #include "correctPhi.H"
}
// Zero phi on current H-I
const surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;
U *= cellMask;
// Make the fluxes relative to the mesh-motion // Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U); fvc::makeRelative(phi, rho, U);
}
} }
if (mesh.changing() && checkMeshCourantNo) if (checkMeshCourantNo)
{ {
#include "meshCourantNo.H" #include "meshCourantNo.H"
} }
}
#include "rhoEqn.H" if (pimple.firstIter() && !pimple.SIMPLErho())
Info<< "rhoEqn max/min : " << max(rho).value()
<< " " << min(rho).value() << endl;
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{ {
#include "rhoEqn.H"
}
#include "UEqn.H" #include "UEqn.H"
#include "EEqn.H" #include "EEqn.H"
@ -155,6 +197,8 @@ int main(int argc, char *argv[])
} }
} }
rho = thermo.rho();
runTime.write(); runTime.write();
runTime.printExecutionTime(Info); runTime.printExecutionTime(Info);

View File

@ -1,81 +1,94 @@
rho = thermo.rho(); if (!pimple.SIMPLErho())
rho = max(rho, rhoMin); {
rho = min(rho, rhoMax); rho = thermo.rho();
rho.relax(); }
// Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution
const volScalarField psip0(psi*p);
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask)); volScalarField rAU("rAU", 1.0/UEqn.A());
mesh.interpolate(rAU);
volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
surfaceScalarField rhorAUf("rhorAUf", faceMask*fvc::interpolate(rho*rAU));
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
HbyA = constrainHbyA(rAU*UEqn.H(), U, p);
if (pimple.nCorrPISO() <= 1) if (pimple.nCorrPISO() <= 1)
{ {
tUEqn.clear(); tUEqn.clear();
} }
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)*fvc::flux(HbyA)
);
if (ddtCorr)
{
surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
phiHbyA +=
faceMaskOld*MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf));
}
fvc::makeRelative(phiHbyA, rho, U);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
if (pimple.transonic()) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
"phid", "phid",
fvc::interpolate(psi) (fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
*(
fvc::flux(HbyA)
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho)
)
); );
fvc::makeRelative(phid, psi, U); phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
MRF.makeRelative(fvc::interpolate(psi), phid);
while (pimple.correctNonOrthogonal()) fvScalarMatrix pDDtEqn
{
fvScalarMatrix pEqn
( (
fvm::ddt(psi, p) fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+ fvm::div(phid, p) + fvc::div(phiHbyA) + fvm::div(phid, p)
- fvm::laplacian(rhorAUf, p)
== ==
fvOptions(psi, p, rho.name()) fvOptions(psi, p, rho.name())
); );
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter()) if (pimple.finalNonOrthogonalIter())
{ {
phi == pEqn.flux(); phi = phiHbyA + pEqn.flux();
} }
} }
} }
else else
{ {
surfaceScalarField phiHbyA fvScalarMatrix pDDtEqn
( (
"phiHbyA", fvc::ddt(rho) + psi*correction(fvm::ddt(p))
fvc::flux(rho*HbyA)
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)
);
fvc::makeRelative(phiHbyA, rho, U);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
while (pimple.correctNonOrthogonal())
{
// Pressure corrector
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvc::div(phiHbyA) + fvc::div(phiHbyA)
- fvm::laplacian(rhorAUf, p)
== ==
fvOptions(psi, p, rho.name()) fvOptions(psi, p, rho.name())
); );
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter()) if (pimple.finalNonOrthogonalIter())
@ -91,25 +104,24 @@ else
// Explicitly relax pressure for momentum corrector // Explicitly relax pressure for momentum corrector
p.relax(); p.relax();
// Recalculate density from the relaxed pressure
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
Info<< "rho max/min : " << max(rho).value()
<< " " << min(rho).value() << endl;
volVectorField gradP(fvc::grad(p)); volVectorField gradP(fvc::grad(p));
//mesh.interpolate(gradP); //mesh.interpolate(gradP);
U = HbyA - rAU*cellMask*gradP; U = cellMask*(HbyA - rAU*gradP);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.correct(U); fvOptions.correct(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
if (pressureControl.limit(p))
{ {
rhoUf = fvc::interpolate(rho*U); p.correctBoundaryConditions();
surfaceVectorField n(mesh.Sf()/mesh.magSf()); }
rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ;
rho = thermo.rho();
{
// Correct rhoUf if the mesh is moving
fvc::correctRhoUf(rhoUf, rho, U, phi);
} }
if (thermo.dpdt()) if (thermo.dpdt())
@ -121,3 +133,9 @@ if (thermo.dpdt())
dpdt -= fvc::div(fvc::meshPhi(rho, U), p); dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
} }
} }
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;

View File

@ -1,6 +1,9 @@
#include "readTimeControls.H" #include "readTimeControls.H"
correctPhi = pimple.dict().lookupOrDefault("correctPhi", true); correctPhi = pimple.dict().lookupOrDefault("correctPhi", false);
checkMeshCourantNo = checkMeshCourantNo =
pimple.dict().lookupOrDefault("checkMeshCourantNo", false); pimple.dict().lookupOrDefault("checkMeshCourantNo", false);
ddtCorr = pimple.dict().lookupOrDefault("ddtCorr", true);

View File

@ -107,7 +107,6 @@ fvOptions.correct(U);
Uf += n*(phi/mesh.magSf() - (n & Uf)); Uf += n*(phi/mesh.magSf() - (n & Uf));
} }
// Make the fluxes relative to the mesh motion // Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U); fvc::makeRelative(phi, U);

View File

@ -0,0 +1,9 @@
zeroField Su;
zeroField Sp;
volScalarField::Internal divU
(
mesh.moving()
? fvc::div(phiCN() + mesh.phi())
: fvc::div(phiCN())
);

View File

@ -132,10 +132,4 @@
phi -= pcorrEqn.flux(); phi -= pcorrEqn.flux();
} }
} }
//if (runTime.writeTime())
//{
// volScalarField("contPhiPcorr", fvc::div(phi)).write();
// pcorr.write();
//}
} }

View File

@ -30,37 +30,31 @@ volVectorField U
#include "createPhi.H" #include "createPhi.H"
//- Overset specific
// Add solver-specific interpolations
{
wordHashSet& nonInt =
const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields());
nonInt.insert("HbyA");
nonInt.insert("grad(p_rgh)");
nonInt.insert("nHat");
nonInt.insert("surfaceIntegrate(phi)");
nonInt.insert("surfaceIntegrate(phiHbyA)");
nonInt.insert("cellMask");
nonInt.insert("cellDisplacement");
nonInt.insert("interpolatedCells");
nonInt.insert("cellInterpolationWeight");
nonInt.insert("pcorr");
}
//- Overset specific // Mask field for zeroing out contributions on hole cells
#include "createCellMask.H"
// Add solver-specific interpolations
{
dictionary oversetDict;
oversetDict.add("U", true);
oversetDict.add("p", true);
oversetDict.add("HbyA", true);
oversetDict.add("p_rgh", true);
oversetDict.add("alpha1", true);
oversetDict.add("minGradP", true);
const_cast<dictionary&>
(
mesh.schemesDict()
).add
(
"oversetInterpolationRequired",
oversetDict,
true
);
}
// Mask field for zeroing out contributions on hole cells
#include "createCellMask.H"
// Create bool field with interpolated cells
#include "createInterpolatedCells.H"
// Create bool field with interpolated cells
#include "createInterpolatedCells.H"
Info<< "Reading transportProperties\n" << endl; Info<< "Reading transportProperties\n" << endl;

View File

@ -150,23 +150,47 @@ int main(int argc, char *argv[])
// Update cellMask field for blocking out hole cells // Update cellMask field for blocking out hole cells
#include "setCellMask.H" #include "setCellMask.H"
#include "setInterpolatedCells.H" #include "setInterpolatedCells.H"
const surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
// Zero Uf on old faceMask (H-I)
Uf *= faceMaskOld;
const surfaceVectorField Uint(fvc::interpolate(U));
// Update Uf and phi on new C-I faces
Uf += (1-faceMaskOld)*Uint;
// Update Uf boundary
forAll(Uf.boundaryField(), patchI)
{
Uf.boundaryFieldRef()[patchI] =
Uint.boundaryField()[patchI];
} }
if ((mesh.changing() && correctPhi) || mesh.topoChanging())
{
// Calculate absolute flux from the mapped surface velocity
// Note: temporary fix until mapped Uf is assessed
Uf = fvc::interpolate(U);
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & Uf; phi = mesh.Sf() & Uf;
// Correct phi on individual regions
if (correctPhi)
{
#include "correctPhi.H" #include "correctPhi.H"
}
mixture.correct();
// Zero phi on current H-I
const surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;
U *= cellMask;
// Make the flux relative to the mesh motion // Make the flux relative to the mesh motion
fvc::makeRelative(phi, U); fvc::makeRelative(phi, U);
mixture.correct();
} }
if (mesh.changing() && checkMeshCourantNo) if (mesh.changing() && checkMeshCourantNo)
@ -175,9 +199,16 @@ int main(int argc, char *argv[])
} }
} }
#include "alphaControls.H" #include "alphaControls.H"
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
const surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
rhoPhi *= faceMask;
mixture.correct(); mixture.correct();
#include "UEqn.H" #include "UEqn.H"

View File

@ -1,23 +1,39 @@
{ {
rAU = 1.0/UEqn.A(); rAU = 1.0/UEqn.A();
//mesh.interpolate(rAU);
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask)); surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
volVectorField H("H", UEqn.H());
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
//HbyA = rAU*UEqn.H(); //HbyA = rAU*UEqn.H();
HbyA = constrainHbyA(rAU*UEqn.H(), U, p_rgh); HbyA = constrainHbyA(rAU*H, U, p_rgh);
if (massFluxInterpolation) if (massFluxInterpolation)
{ {
#include "interpolatedFaces.H" #include "interpolatedFaces.H"
} }
if (runTime.outputTime())
{
H.write();
rAU.write();
HbyA.write();
}
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA)); surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
if (ddtCorr) if (ddtCorr)
{ {
phiHbyA += fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf); surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
phiHbyA +=
fvc::interpolate(rho*rAU)*faceMaskOld*fvc::ddtCorr(U, Uf);
} }
MRF.makeRelative(phiHbyA); MRF.makeRelative(phiHbyA);
@ -35,7 +51,6 @@
fvc::makeAbsolute(phiHbyA, U); fvc::makeAbsolute(phiHbyA, U);
} }
surfaceScalarField phig surfaceScalarField phig
( (
( (
@ -60,7 +75,7 @@
{ {
fvScalarMatrix p_rghEqn fvScalarMatrix p_rghEqn
( (
fvm::laplacian(faceMask*rAUf, p_rgh) == fvc::div(phiHbyA) fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
); );
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
@ -73,14 +88,12 @@
p_rgh.relax(); p_rgh.relax();
// Reconstruct body forces (-grad(p) and gh etc) U =
volVectorField minGradP cellMask*
( (
"minGradP", HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf)
fvc::reconstruct((phig - p_rghEqn.flux())/rAUf)
); );
//U = HbyA + rAU*cellMask*minGradP;
U = fvc::reconstruct(phi);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.correct(U); fvOptions.correct(U);
} }
@ -97,16 +110,19 @@
// Make the fluxes relative to the mesh motion // Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U); fvc::makeRelative(phi, U);
// Zero faces H-I for transport Eq after pEq
phi *= faceMask;
p == p_rgh + rho*gh; p == p_rgh + rho*gh;
if (p_rgh.needReference()) if (p_rgh.needReference())
{ {
p += dimensionedScalar p_rgh += dimensionedScalar
( (
"p", "p_rgh",
p.dimensions(), p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell) pRefValue - getRefCellValue(p_rgh, pRefCell)
); );
p_rgh = p - rho*gh; p == p_rgh + rho*gh;
} }
} }

View File

@ -977,6 +977,40 @@ bool Foam::cellCellStencils::cellVolumeWeight::update()
walkFront(layerRelax, allCellTypes, allWeight); walkFront(layerRelax, allCellTypes, allWeight);
// Check previous iteration cellTypes_ for any hole->calculated changes
{
label nCalculated = 0;
forAll(cellTypes_, celli)
{
if (allCellTypes[celli] == CALCULATED && cellTypes_[celli] == HOLE)
{
if (allStencil[celli].size() == 0)
{
FatalErrorInFunction
<< "Cell:" << celli
<< " at:" << mesh_.cellCentres()[celli]
<< " zone:" << zoneID[celli]
<< " changed from hole to calculated"
<< " but there is no donor"
<< exit(FatalError);
}
else
{
allCellTypes[celli] = INTERPOLATED;
nCalculated++;
}
}
}
if (debug)
{
Pout<< "Detected " << nCalculated << " cells changing from hole"
<< " to calculated. Changed these to interpolated"
<< endl;
}
}
// Normalise weights, Clear storage // Normalise weights, Clear storage
forAll(allCellTypes, cellI) forAll(allCellTypes, cellI)
{ {
@ -1060,39 +1094,39 @@ bool Foam::cellCellStencils::cellVolumeWeight::update()
} }
// Check previous iteration cellTypes_ for any hole->calculated changes // // Check previous iteration cellTypes_ for any hole->calculated changes
{ // {
label nCalculated = 0; // label nCalculated = 0;
//
forAll(cellTypes_, celli) // forAll(cellTypes_, celli)
{ // {
if (allCellTypes[celli] == CALCULATED && cellTypes_[celli] == HOLE) // if (allCellTypes[celli] == CALCULATED && cellTypes_[celli] == HOLE)
{ // {
if (allStencil[celli].size() == 0) // if (allStencil[celli].size() == 0)
{ // {
FatalErrorInFunction // FatalErrorInFunction
<< "Cell:" << celli // << "Cell:" << celli
<< " at:" << mesh_.cellCentres()[celli] // << " at:" << mesh_.cellCentres()[celli]
<< " zone:" << zoneID[celli] // << " zone:" << zoneID[celli]
<< " changed from hole to calculated" // << " changed from hole to calculated"
<< " but there is no donor" // << " but there is no donor"
<< exit(FatalError); // << exit(FatalError);
} // }
else // else
{ // {
allCellTypes[celli] = INTERPOLATED; // allCellTypes[celli] = INTERPOLATED;
nCalculated++; // nCalculated++;
} // }
} // }
} // }
//
if (debug) // if (debug)
{ // {
Pout<< "Detected " << nCalculated << " cells changing from hole" // Pout<< "Detected " << nCalculated << " cells changing from hole"
<< " to calculated. Changed these to interpolated" // << " to calculated. Changed these to interpolated"
<< endl; // << endl;
} // }
} // }
cellTypes_.transfer(allCellTypes); cellTypes_.transfer(allCellTypes);

View File

@ -335,10 +335,9 @@ void Foam::dynamicOversetFvMesh::addInterpolation(fvMatrix<Type>& m) const
lower[facei] = 0.0; lower[facei] = 0.0;
} }
// For safety we make zero the HOLES
const scalar normalisation = V()[celli]; const scalar normalisation = V()[celli];
diag[celli] = normalisation; diag[celli] = normalisation;
source[celli] = pTraits<Type>::zero;//normalisation*m.psi()[celli]; source[celli] = normalisation*m.psi()[celli];
} }
} }

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
"(walls|outlet|inlet)"
{
type zeroGradient;
}
hole
{
type fixedValue;
value uniform 400;
}
overset
{
type overset;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
walls
{
type uniformFixedValue;
uniformValue (0 0 0);
}
hole
{
type movingWallVelocity;
value uniform (0 0 0);
}
outlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}
inlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}
overset
{
type overset;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
overset
{
type overset;
}
"(walls|hole|inlet|outlet)"
{
type compressible::alphatWallFunction;;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -3 0 0 0 0 ];
internalField uniform 0.1;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
overset
{
type overset;
}
"(walls|hole|inlet|outlet)"
{
type epsilonWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -2 0 0 0 0 ];
internalField uniform 0.01;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
overset
{
type overset;
}
"(walls|hole|inlet|outlet)"
{
type kqRWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -1 0 0 0 0 ];
internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
overset
{
type overset;
}
"(walls|hole|inlet|outlet)"
{
type nutkWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
"(walls|hole|outlet|inlet)"
{
type zeroGradient;
}
overset
{
type overset;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
".*"
{
type uniformFixedValue;
uniformValue (0 0 0);
}
hole
{
type zeroGradient;
}
overset
{
patchType overset;
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus.master.develop |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object zoneID;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
overset
{
type overset;
}
".*"
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,11 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase0
rm -f constant/polyMesh/boundary
rm -f constant/polyMesh/zoneID
rm -f constant/cellInterpolationWeight
#------------------------------------------------------------------------------

View File

@ -0,0 +1,14 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
./Allrun.pre
# Serial
runApplication $(getApplication)
# Parallel
#runApplication decomposePar -cellDist
#runParallel $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,20 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
runApplication blockMesh
# Select cellSets
runApplication -s 1 topoSet
runApplication subsetMesh box -patch hole -overwrite
# Select cellSets
runApplication -s 2 topoSet
restore0Dir
# Use cellSets to write zoneID
runApplication setFields
#------------------------------------------------------------------------------

View File

@ -0,0 +1,3 @@
Transient, moving mesh
----------------------
Two turning rotors

View File

@ -0,0 +1,46 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicOversetFvMesh;
solver multiSolidBodyMotionSolver;
multiSolidBodyMotionSolverCoeffs
{
movingZone1
{
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0.005 0.005 0.005);
axis (0 0 1);
omega 100.0;
}
}
movingZone2
{
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0.013 0.005 0.005);
axis (0 0 1);
omega -100.0;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport sutherland;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
specie
{
molWeight 28.9;
}
thermodynamics
{
Cp 1007;
Hf 0;
}
transport
{
As 1.4792e-06;
Ts 116;
}
}
dpdt true;
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //

View File

@ -0,0 +1,165 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 0.01;
vertices
(
( 0.00 0.0 0)
( 2.00 0.0 0)
( 2.00 1.0 0)
( 0.00 1.0 0)
( 0.00 0.0 1)
( 2.00 0.0 1)
( 2.00 1.0 1)
( 0.00 1.0 1)
// movingZone1
( 0.15 0.35 0)
( 0.85 0.35 0)
( 0.85 0.65 0)
( 0.15 0.65 0)
( 0.15 0.35 1)
( 0.85 0.35 1)
( 0.85 0.65 1)
( 0.15 0.65 1)
// // movingZone2
( 1.15 0.15 0)
( 1.45 0.15 0)
( 1.45 0.85 0)
( 1.15 0.85 0)
( 1.15 0.15 1)
( 1.45 0.15 1)
( 1.45 0.85 1)
( 1.15 0.85 1)
// ( 0.75 0.15 0)
// ( 1.05 0.15 0)
// ( 1.05 0.85 0)
// ( 0.75 0.85 0)
// ( 0.75 0.15 1)
// ( 1.05 0.15 1)
// ( 1.05 0.85 1)
// ( 0.75 0.85 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (140 70 1) simpleGrading (1 1 1)
hex (8 9 10 11 12 13 14 15) movingZone1 (60 24 1) simpleGrading (1 1 1)
hex (16 17 18 19 20 21 22 23) movingZone2 (24 60 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
overset1
{
type overset;
faces
(
( 8 12 15 11)
(10 14 13 9)
(11 15 14 10)
( 9 13 12 8)
);
}
overset2
{
type overset;
faces
(
(16 20 23 19)
(18 22 21 17)
(19 23 22 18)
(17 21 20 16)
);
}
walls
{
type wall;
faces
(
(3 7 6 2)
(1 5 4 0)
);
}
inlet
{
type wall;
faces
(
(0 4 7 3)
);
}
outlet
{
type wall;
faces
(
(2 6 5 1)
);
}
// Populated by subsetMesh
hole
{
type wall;
faces ();
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(4 5 6 7)
);
}
frontAndBack1
{
type empty;
faces
(
( 8 11 10 9)
(12 13 14 15)
);
}
frontAndBack2
{
type empty;
faces
(
(16 19 18 17)
(20 21 22 23)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,127 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
libs ("liboverset.so");
DebugSwitches
{
overset 0;
dynamicOversetFvMesh 0;
cellVolumeWeight 0;
}
application overRhoPimpleDyMFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 1.0;
deltaT 2e-5;
writeControl adjustableRunTime;
writeInterval 0.01;
purgeWrite 0;
writeFormat ascii;
writePrecision 10;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
adjustTimeStep true;
maxCo 0.2;
functions
{
// #include "catalyst"
probes
{
type probes;
libs ("libsampling.so");
// Name of the directory for probe data
name probes;
// Write at same frequency as fields
writeControl timeStep;
writeInterval 1;
// Fields to be probed
fields (p U);
// Optional: interpolation scheme to use (default is cell)
interpolationScheme cell;
probeLocations
(
(0.015 0.005 0.005)
);
}
mass
{
type volFieldValue;
libs ("libfieldFunctionObjects.so");
writeControl timeStep;
writeInterval 1;
writeFields false;
log true;
operation volIntegrate;
fields
(
rho
);
}
rhoVol
{
libs ("libutilityFunctionObjects.so");
type coded;
name rhoVolume;
writeControl timeStep;
writeInterval 10;
codeWrite
#{
const volScalarField& rho =
mesh().lookupObject<volScalarField>("rho");
Info<< "rho volume = " << rho.weightedAverage(mesh().Vsc()) << endl;
#};
}
}
// ************************************************************************* //

View File

@ -0,0 +1,77 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss upwind;
div(phi,epsilon) Gauss limitedLinear 1;
div(phi,k) Gauss limitedLinear 1;
div(phi,h) Gauss limitedLinear 1;
div(phi,K) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
div(meshPhi,p) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
laplacian(diffusivity,cellDisplacement) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
oversetInterpolation
{
method cellVolumeWeight;
}
fluxRequired
{
default no;
pcorr ;
p ;
}
oversetInterpolationSuppressed
{
grad(p);
surfaceIntegrate(phiHbyA);
//grad(pcorr);
//surfaceIntegrate(((rAUf*magSf)*snGradCorr(pcorr)));
}
// ************************************************************************* //

View File

@ -0,0 +1,107 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
cellDisplacement
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0;
maxIter 100;
}
"(rho|h)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-8;
relTol 0.1;
}
"(rho|h)Final"
{
$rho;
tolerance 1e-8;
relTol 0;
}
p
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-11;
relTol 0.01;
}
pFinal
{
$p;
relTol 0;
}
pcorr
{
$pFinal;
}
pcorrFinal
{
$pcorr;
relTol 0;
}
"(U|k|epsilon)"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-6;
relTol 0;
}
"(U|k|epsilon)Final"
{
$U;
tolerance 1e-6;
relTol 0;
}
}
PIMPLE
{
momentumPredictor false;
correctPhi true;
nOuterCorrectors 1;
nCorrectors 4;
nNonOrthogonalCorrectors 0;
ddtCorr false;
}
relaxationFactors
{
fields
{
}
equations
{
".*" 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue zoneID 123
);
regions
(
// Set cell values
// (does zerogradient on boundaries)
cellToCell
{
set c0;
fieldValues
(
volScalarFieldValue zoneID 0
);
}
cellToCell
{
set c1;
fieldValues
(
volScalarFieldValue zoneID 1
);
}
cellToCell
{
set c2;
fieldValues
(
volScalarFieldValue zoneID 2
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,117 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name c0;
type cellSet;
action new;
source regionsToCell;
sourceInfo
{
insidePoints ((0.001 0.001 0.001));
}
}
{
name c1;
type cellSet;
action new;
source cellToCell;
sourceInfo
{
set c0;
}
}
{
name c1;
type cellSet;
action invert;
}
{
name c2;
type cellSet;
action new;
source regionsToCell;
sourceInfo
{
insidePoints ((0.0116 0.00151 0.001));//((0.0076 0.00151 0.001));
set c1;
}
}
{
name c1;
type cellSet;
action delete;
source cellToCell;
sourceInfo
{
set c2;
}
}
// Select box to remove from region 1 and 2
{
name box;
type cellSet;
action new;
source cellToCell;
sourceInfo
{
set c1;
}
}
{
name box;
type cellSet;
action add;
source cellToCell;
sourceInfo
{
set c2;
}
}
{
name box;
type cellSet;
action subset;
source boxToCell;
sourceInfo
{
boxes
(
(0.0025 0.0045 -100)(0.0075 0.0055 100)
//(0.0085 0.0025 -100)(0.0095 0.0075 100)
(0.0125 0.0025 -100)(0.0135 0.0075 100)
);
}
}
{
name box;
type cellSet;
action invert;
}
);
// ************************************************************************* //

View File

@ -61,6 +61,7 @@ sixDoFRigidBodyMotionCoeffs
report on; report on;
accelerationRelaxation 0.6; accelerationRelaxation 0.6;
accelerationDamping 0.9;
solver solver
{ {

View File

@ -30,6 +30,6 @@ air
rho rho [ 1 -3 0 0 0 0 0 ] 1; rho rho [ 1 -3 0 0 0 0 0 ] 1;
} }
sigma sigma [ 1 0 -2 0 0 0 0 ] 0; sigma sigma [ 1 0 -2 0 0 0 0 ] 0.007;
// ************************************************************************* // // ************************************************************************* //

View File

@ -18,19 +18,19 @@ scale 1;
vertices vertices
( (
(0 0 0) (-0.2 -0.2 -0.2)
(1 0 0) (1.2 -0.2 -0.2)
(1 1 0) (1.2 1.2 -0.2)
(0 1 0) (-0.2 1.2 -0.2)
(0 0 1) (-0.2 -0.2 1)
(1 0 1) (1.2 -0.2 1)
(1 1 1) (1.2 1.2 1)
(0 1 1) (-0.2 1.2 1)
); );
blocks blocks
( (
hex (0 1 2 3 4 5 6 7) (35 35 35) simpleGrading (1 1 1) hex (0 1 2 3 4 5 6 7) (80 80 70) simpleGrading (1 1 1)
); );
edges edges

View File

@ -14,24 +14,30 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Load the additional patches, patchFields etc.
libs ("liboverset.so"); libs ("liboverset.so");
DebugSwitches
{
overset 0;
dynamicOversetFvMesh 0;
cellVolumeWeight 1;
}
application overInterDyMFoam ; application overInterDyMFoam ;
startFrom latestTime;//startTime; startFrom latestTime;
startTime 0.0; startTime 0.0;
stopAt endTime; stopAt endTime;
endTime 4; endTime 15;
deltaT 0.001; deltaT 0.001;
writeControl adjustableRunTime; writeControl adjustableRunTime;
writeInterval 0.1; writeInterval 0.5;
purgeWrite 0; purgeWrite 0;
@ -49,8 +55,55 @@ runTimeModifiable yes;
adjustTimeStep yes; adjustTimeStep yes;
maxCo 2.0; maxCo 1.5;
maxAlphaCo 2.0; maxAlphaCo 2.0;
maxDeltaT 1; maxDeltaT 1;
functions
{
probes
{
type probes;
libs ("libsampling.so");
// Name of the directory for probe data
name probes;
// Write at same frequency as fields
writeControl timeStep;
writeInterval 1;
// Fields to be probed
fields (p U);
// Optional: interpolation scheme to use (default is cell)
interpolationScheme cell;
probeLocations
(
(0.00132 0.0009 0.005)
);
}
alphaVol
{
libs ("libutilityFunctionObjects.so");
type coded;
name alphaVolume;
writeControl timeStep;
writeInterval 10;
codeWrite
#{
const volScalarField& alpha =
mesh().lookupObject<volScalarField>("alpha.water");
Info<< "Alpha volume = " << alpha.weightedAverage(mesh().Vsc()) << endl;
#};
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -26,7 +26,7 @@ gradSchemes
divSchemes divSchemes
{ {
div(rhoPhi,U) Gauss limitedLinearV 1; div(rhoPhi,U) Gauss upwind;
div(U) Gauss linear; div(U) Gauss linear;
div(phi,alpha) Gauss vanLeer; div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss linear; div(phirb,alpha) Gauss linear;
@ -54,12 +54,13 @@ snGradSchemes
oversetInterpolation oversetInterpolation
{ {
method inverseDistance; method cellVolumeWeight;
} }
oversetInterpolationRequired oversetInterpolationSuppressed
{ {
alpha.water; grad(p_rgh);
surfaceIntegrate(phiHbyA);
} }
fluxRequired fluxRequired

View File

@ -84,7 +84,6 @@ PIMPLE
ddtCorr yes; ddtCorr yes;
correctPhi no; correctPhi no;
massFluxInterpolation no;
moveMeshOuterCorrectors no; moveMeshOuterCorrectors no;
turbOnFinalIterOnly no; turbOnFinalIterOnly no;
@ -104,8 +103,6 @@ relaxationFactors
} }
cache cache
{ {}
grad(U);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -30,9 +30,10 @@ regions
boxToCell boxToCell
{ {
box ( 0.7 0.8 -100 ) ( 100 100 0.75 ); box ( 0.9 0.9 -100 ) ( 100 100 0.75 );
fieldValues ( volScalarFieldValue alpha.water 1 ); fieldValues ( volScalarFieldValue alpha.water 1 );
} }
cellToCell cellToCell
{ {
set c0; set c0;

View File

@ -18,19 +18,19 @@ scale 1;
vertices vertices
( (
(0.3 0.3 0.1) (0.2 0.2 0.1)
(0.7 0.3 0.1) (0.8 0.2 0.1)
(0.7 0.7 0.1) (0.8 0.8 0.1)
(0.3 0.7 0.1) (0.2 0.8 0.1)
(0.3 0.3 0.8) (0.2 0.2 0.8)
(0.7 0.3 0.8) (0.8 0.2 0.8)
(0.7 0.7 0.8) (0.8 0.8 0.8)
(0.3 0.7 0.8) (0.2 0.8 0.8)
); );
blocks blocks
( (
hex (0 1 2 3 4 5 6 7) (20 20 30) simpleGrading (1 1 1) hex (0 1 2 3 4 5 6 7) (40 40 45) simpleGrading (1 1 1)
); );
edges edges

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
walls
{
type uniformFixedValue;
uniformValue (0 0 0);
}
hole
{
type movingWallVelocity;
value uniform (0 0 0);
}
outlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}
inlet
{
type uniformFixedValue;
uniformValue (0 0 0);
}
overset
{
type overset;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
"(walls|hole|inlet|outlet)"
{
type zeroGradient;
}
overset
{
type overset;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -3 0 0 0 0 ];
internalField uniform 0.1;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
overset
{
type overset;
}
"(walls|hole|inlet|outlet)"
{
type epsilonWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -2 0 0 0 0 ];
internalField uniform 0.01;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
overset
{
type overset;
}
"(walls|hole|inlet|outlet)"
{
type kqRWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -1 0 0 0 0 ];
internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
overset
{
type overset;
}
"(walls|hole|inlet|outlet)"
{
type nutkWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
"(walls|hole|outlet|inlet)"
{
type calculated;
}
overset
{
type overset;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
oversetPatch
{
type overset;
}
"(walls|hole|outlet|inlet)"
{
type fixedFluxPressure;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
".*"
{
type uniformFixedValue;
uniformValue (0 0 0);
}
hole
{
type zeroGradient;
}
overset
{
patchType overset;
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object zoneID;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
overset
{
type overset;
}
".*"
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,11 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
cleanCase0
rm -f constant/polyMesh/boundary
rm -f constant/polyMesh/zoneID
rm -f constant/cellInterpolationWeight
#------------------------------------------------------------------------------

View File

@ -0,0 +1,14 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
./Allrun.pre
# Serial
#runApplication $(getApplication)
# Parallel
runApplication decomposePar -cellDist
runParallel $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,20 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
runApplication blockMesh
# Select cellSets
runApplication -s 1 topoSet
runApplication subsetMesh box -patch hole -overwrite
# Select cellSets
runApplication -s 2 topoSet
restore0Dir
# Use cellSets to write zoneID
runApplication setFields
#------------------------------------------------------------------------------

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicOversetFvMesh;
dynamicOversetFvMeshCoeffs
{
// layerRelax 0.3;
}
solver multiSolidBodyMotionSolver;
multiSolidBodyMotionSolverCoeffs
{
movingZone1
{
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0.005 0.005 0.005);
axis (0 0 1);
omega 20.0;
}
}
movingZone2
{
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0.013 0.005 0.005);
axis (0 0 1);
omega -20.0;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 -9.81 0);
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phases (water air);
water
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
rho rho [ 1 -3 0 0 0 0 0 ] 998.2;
}
air
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1.48e-05;
rho rho [ 1 -3 0 0 0 0 0 ] 1;
}
sigma sigma [ 1 0 -2 0 0 0 0 ] 0.0;
// ************************************************************************* //

View File

@ -0,0 +1,29 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //

View File

@ -0,0 +1,156 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 0.01;
vertices
(
( 0.00 0.0 0)
( 2.00 0.0 0)
( 2.00 1.0 0)
( 0.00 1.0 0)
( 0.00 0.0 1)
( 2.00 0.0 1)
( 2.00 1.0 1)
( 0.00 1.0 1)
// movingZone1
( 0.15 0.35 0)
( 0.85 0.35 0)
( 0.85 0.65 0)
( 0.15 0.65 0)
( 0.15 0.35 1)
( 0.85 0.35 1)
( 0.85 0.65 1)
( 0.15 0.65 1)
// movingZone2
( 1.15 0.15 0)
( 1.45 0.15 0)
( 1.45 0.85 0)
( 1.15 0.85 0)
( 1.15 0.15 1)
( 1.45 0.15 1)
( 1.45 0.85 1)
( 1.15 0.85 1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (140 70 1) simpleGrading (1 1 1)
hex (8 9 10 11 12 13 14 15) movingZone1 (60 24 1) simpleGrading (1 1 1)
hex (16 17 18 19 20 21 22 23) movingZone2 (24 60 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
overset1
{
type overset;
faces
(
( 8 12 15 11)
(10 14 13 9)
(11 15 14 10)
( 9 13 12 8)
);
}
overset2
{
type overset;
faces
(
(16 20 23 19)
(18 22 21 17)
(19 23 22 18)
(17 21 20 16)
);
}
walls
{
type wall;
faces
(
(3 7 6 2)
(1 5 4 0)
);
}
inlet
{
type wall;
faces
(
(0 4 7 3)
);
}
outlet
{
type wall;
faces
(
(2 6 5 1)
);
}
// Populated by subsetMesh
hole
{
type wall;
faces ();
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(4 5 6 7)
);
}
frontAndBack1
{
type empty;
faces
(
( 8 11 10 9)
(12 13 14 15)
);
}
frontAndBack2
{
type empty;
faces
(
(16 19 18 17)
(20 21 22 23)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,110 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
libs ("liboverset.so");
DebugSwitches
{
overset 0;
dynamicOversetFvMesh 0;
cellVolumeWeight 0;
}
application overInterDyMFoam ;
startFrom latestTime;
startTime 0.0;
stopAt endTime;
endTime 2;
deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.01;
purgeWrite 0;
writeFormat ascii;
writePrecision 12;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 1.5;
maxAlphaCo 2.0;
maxDeltaT 1;
functions
{
probes
{
type probes;
libs ("libsampling.so");
// Name of the directory for probe data
name probes;
// Write at same frequency as fields
writeControl timeStep;
writeInterval 1;
// Fields to be probed
fields (p U);
// Optional: interpolation scheme to use (default is cell)
interpolationScheme cell;
probeLocations
(
(0.0009999 0.0015 0.003)
);
}
alphaVol
{
libs ("libutilityFunctionObjects.so");
type coded;
name alphaVolume;
writeControl timeStep;
writeInterval 10;
codeWrite
#{
const volScalarField& alpha =
mesh().lookupObject<volScalarField>("alpha.water");
Info<< "Alpha volume = " << alpha.weightedAverage(mesh().Vsc())
<< endl;
#};
}
}
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 3;
method hierarchical;
coeffs
{
n (3 1 1);
//delta 0.001; // default=0.001
//order xyz; // default=xzy
}
// ************************************************************************* //

View File

@ -0,0 +1,80 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(T) Gauss linear;
}
divSchemes
{
default none;
div(rhoPhi,U) Gauss upwind;
div(U) Gauss linear;
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss linear;
div(phi,alpha.water) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,k) Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
oversetInterpolation
{
method cellVolumeWeight;
}
fluxRequired
{
default no;
pcorr ;
p ;
}
oversetInterpolationSuppressed
{
grad(p_rgh);
surfaceIntegrate(phiHbyA);
}
// ************************************************************************* //

View File

@ -0,0 +1,117 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
cellDisplacement
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0;
maxIter 100;
}
"alpha.water.*"
{
nAlphaCorr 3;
nAlphaSubCycles 2;
cAlpha 1;
icAlpha 0;
scAlpha 0;
MULESCorr yes;
nLimiterIter 5;
alphaApplyPrevCorr no;
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-8;
relTol 0;
}
p_rgh
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-12;
relTol 0.01;
maxIter 500;
}
p_rghFinal
{
$p_rgh;
relTol 0;
}
pcorr
{
$p;
solver PCG;
preconditioner DIC;
}
pcorrFinal
{
$pcorr;
relTol 0;
}
"(U|k|epsilon)"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-6;
relTol 0.01;
maxIter 200;
minIter 1;
}
"(U|k|epsilon)Final"
{
$U;
relTol 0;
}
}
PIMPLE
{
momentumPredictor no;
correctPhi no;
nOuterCorrectors 2;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
ddtCorr true;
pRefPoint (0.0002 0.0099 0.001);
pRefValue 0.0;
}
relaxationFactors
{
fields
{
}
equations
{
".*" 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,64 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue zoneID 123
volScalarFieldValue alpha.water 0
);
regions
(
// Set cell values
// (does zerogradient on boundaries)
cellToCell
{
set c0;
fieldValues
(
volScalarFieldValue zoneID 0
);
}
cellToCell
{
set c1;
fieldValues
(
volScalarFieldValue zoneID 1
);
}
cellToCell
{
set c2;
fieldValues
(
volScalarFieldValue zoneID 2
);
}
boxToCell
{
box ( -100 -100 -100 ) ( 100 0.005 100 );
fieldValues ( volScalarFieldValue alpha.water 1 );
}
);
// ************************************************************************* //

View File

@ -0,0 +1,116 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name c0;
type cellSet;
action new;
source regionsToCell;
sourceInfo
{
insidePoints ((0.001 0.001 0.001));
}
}
{
name c1;
type cellSet;
action new;
source cellToCell;
sourceInfo
{
set c0;
}
}
{
name c1;
type cellSet;
action invert;
}
{
name c2;
type cellSet;
action new;
source regionsToCell;
sourceInfo
{
insidePoints ((0.0116 0.00151 0.001));
set c1;
}
}
{
name c1;
type cellSet;
action delete;
source cellToCell;
sourceInfo
{
set c2;
}
}
// Select box to remove from region 1 and 2
{
name box;
type cellSet;
action new;
source cellToCell;
sourceInfo
{
set c1;
}
}
{
name box;
type cellSet;
action add;
source cellToCell;
sourceInfo
{
set c2;
}
}
{
name box;
type cellSet;
action subset;
source boxToCell;
sourceInfo
{
boxes
(
(0.0025 0.0045 -100)(0.0075 0.0055 100)
(0.0125 0.0025 -100)(0.0135 0.0075 100)
);
}
}
{
name box;
type cellSet;
action invert;
}
);
// ************************************************************************* //