mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -27,7 +27,7 @@
|
|||||||
fvScalarMatrix pDDtEqn
|
fvScalarMatrix pDDtEqn
|
||||||
(
|
(
|
||||||
fvc::ddt(rho) + fvc::div(phiHbyA)
|
fvc::ddt(rho) + fvc::div(phiHbyA)
|
||||||
+ correction(fvm::ddt(psi, p) + fvm::div(phid, p))
|
+ correction(psi*fvm::ddt(p) + fvm::div(phid, p))
|
||||||
);
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
|
|||||||
@ -68,4 +68,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
phi.oldTime() = phi;
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
#include "continuityErrs.H"
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
solve
|
fvScalarMatrix TEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(rho, T)
|
fvm::ddt(rho, T)
|
||||||
+ fvm::div(rhoPhi, T)
|
+ fvm::div(rhoPhi, T)
|
||||||
- fvm::laplacian(twoPhaseProperties.alphaEff(turbulence->mut()), T)
|
- fvm::laplacian(twoPhaseProperties.alphaEff(turbulence->mut()), T)
|
||||||
+ (
|
+ (
|
||||||
p*fvc::div(phi)
|
fvc::div(fvc::absolute(phi, U), p)
|
||||||
+ fvc::ddt(rho, K) + fvc::div(rhoPhi, K)
|
+ fvc::ddt(rho, K) + fvc::div(rhoPhi, K)
|
||||||
)
|
)
|
||||||
*(
|
*(
|
||||||
@ -14,5 +14,8 @@
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
TEqn.relax();
|
||||||
|
TEqn.solve();
|
||||||
|
|
||||||
twoPhaseProperties.correct();
|
twoPhaseProperties.correct();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,6 +56,8 @@
|
|||||||
phi -= pcorrEqn.flux();
|
phi -= pcorrEqn.flux();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
phi.oldTime() = phi;
|
||||||
|
|
||||||
|
#include "continuityErrs.H"
|
||||||
|
|||||||
@ -104,8 +104,6 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rho = alpha1*rho1 + alpha2*rho2;
|
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
Info<< "ExecutionTime = "
|
Info<< "ExecutionTime = "
|
||||||
|
|||||||
@ -38,9 +38,9 @@
|
|||||||
|
|
||||||
volScalarField& p = twoPhaseProperties.p();
|
volScalarField& p = twoPhaseProperties.p();
|
||||||
volScalarField& T = twoPhaseProperties.T();
|
volScalarField& T = twoPhaseProperties.T();
|
||||||
const volScalarField& rho1 = twoPhaseProperties.thermo1().rho();
|
volScalarField& rho1 = twoPhaseProperties.thermo1().rho();
|
||||||
const volScalarField& psi1 = twoPhaseProperties.thermo1().psi();
|
const volScalarField& psi1 = twoPhaseProperties.thermo1().psi();
|
||||||
const volScalarField& rho2 = twoPhaseProperties.thermo2().rho();
|
volScalarField& rho2 = twoPhaseProperties.thermo2().rho();
|
||||||
const volScalarField& psi2 = twoPhaseProperties.thermo2().psi();
|
const volScalarField& psi2 = twoPhaseProperties.thermo2().psi();
|
||||||
|
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
@ -93,18 +93,5 @@
|
|||||||
compressible::turbulenceModel::New(rho, U, rhoPhi, twoPhaseProperties)
|
compressible::turbulenceModel::New(rho, U, rhoPhi, twoPhaseProperties)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Creating field dpdt\n" << endl;
|
|
||||||
volScalarField dpdt
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"dpdt",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating field kinetic energy K\n" << endl;
|
Info<< "Creating field kinetic energy K\n" << endl;
|
||||||
volScalarField K("K", 0.5*magSqr(U));
|
volScalarField K("K", 0.5*magSqr(U));
|
||||||
|
|||||||
@ -26,28 +26,44 @@
|
|||||||
tmp<fvScalarMatrix> p_rghEqnComp1;
|
tmp<fvScalarMatrix> p_rghEqnComp1;
|
||||||
tmp<fvScalarMatrix> p_rghEqnComp2;
|
tmp<fvScalarMatrix> p_rghEqnComp2;
|
||||||
|
|
||||||
//if (transonic)
|
if (pimple.transonic())
|
||||||
//{
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
{
|
{
|
||||||
surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi);
|
surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi);
|
||||||
surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi);
|
surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi);
|
||||||
|
|
||||||
|
p_rghEqnComp1 =
|
||||||
|
fvc::ddt(rho1) + fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1)
|
||||||
|
+ correction
|
||||||
|
(
|
||||||
|
psi1*fvm::ddt(p_rgh)
|
||||||
|
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
|
||||||
|
);
|
||||||
|
deleteDemandDrivenData(p_rghEqnComp1().faceFluxCorrectionPtr());
|
||||||
|
p_rghEqnComp1().relax();
|
||||||
|
|
||||||
|
p_rghEqnComp2 =
|
||||||
|
fvc::ddt(rho2) + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2)
|
||||||
|
+ correction
|
||||||
|
(
|
||||||
|
psi2*fvm::ddt(p_rgh)
|
||||||
|
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
|
||||||
|
);
|
||||||
|
deleteDemandDrivenData(p_rghEqnComp2().faceFluxCorrectionPtr());
|
||||||
|
p_rghEqnComp2().relax();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
p_rghEqnComp1 =
|
p_rghEqnComp1 =
|
||||||
fvc::ddt(rho1) + psi1*correction(fvm::ddt(p_rgh))
|
fvc::ddt(rho1) + psi1*correction(fvm::ddt(p_rgh))
|
||||||
+ fvc::div(phid1, p_rgh)
|
+ fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1);
|
||||||
- fvc::Sp(fvc::div(phid1), p_rgh);
|
|
||||||
|
|
||||||
p_rghEqnComp2 =
|
p_rghEqnComp2 =
|
||||||
fvc::ddt(rho2) + psi2*correction(fvm::ddt(p_rgh))
|
fvc::ddt(rho2) + psi2*correction(fvm::ddt(p_rgh))
|
||||||
+ fvc::div(phid2, p_rgh)
|
+ fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2);
|
||||||
- fvc::Sp(fvc::div(phid2), p_rgh);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
// Cache p_rgh prior to solve for density update
|
||||||
// pressure solution - done in 2 parts. Part 1:
|
volScalarField p_rgh_0(p_rgh);
|
||||||
//twoPhaseProperties.rho() -= psi*p_rgh;
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -69,8 +85,8 @@
|
|||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
{
|
{
|
||||||
// Second part of thermodynamic density update
|
//p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
|
||||||
//twoPhaseProperties.rho() += psi*p_rgh;
|
//p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh;
|
||||||
|
|
||||||
dgdt =
|
dgdt =
|
||||||
(
|
(
|
||||||
@ -88,15 +104,14 @@
|
|||||||
|
|
||||||
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
|
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
|
||||||
|
|
||||||
// twoPhaseProperties.correct();
|
// Update densities from change in p_rgh
|
||||||
|
rho1 += psi1*(p_rgh - p_rgh_0);
|
||||||
|
rho2 += psi2*(p_rgh - p_rgh_0);
|
||||||
|
|
||||||
Info<< "max(U) " << max(mag(U)).value() << endl;
|
rho = alpha1*rho1 + alpha2*rho2;
|
||||||
Info<< "min(p_rgh) " << min(p_rgh).value() << endl;
|
|
||||||
|
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
if (twoPhaseProperties.dpdt())
|
Info<< "max(U) " << max(mag(U)).value() << endl;
|
||||||
{
|
Info<< "min(p_rgh) " << min(p_rgh).value() << endl;
|
||||||
dpdt = fvc::ddt(p);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,6 +94,16 @@ public:
|
|||||||
return thermo2_();
|
return thermo2_();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rhoThermo& thermo1()
|
||||||
|
{
|
||||||
|
return thermo1_();
|
||||||
|
}
|
||||||
|
|
||||||
|
rhoThermo& thermo2()
|
||||||
|
{
|
||||||
|
return thermo2_();
|
||||||
|
}
|
||||||
|
|
||||||
//- Update properties
|
//- Update properties
|
||||||
virtual void correct();
|
virtual void correct();
|
||||||
|
|
||||||
|
|||||||
@ -62,10 +62,10 @@
|
|||||||
|
|
||||||
volScalarField& p = thermo1.p();
|
volScalarField& p = thermo1.p();
|
||||||
|
|
||||||
volScalarField rho1("rho" + phase1Name, thermo1.rho());
|
volScalarField& rho1 = thermo1.rho();
|
||||||
const volScalarField& psi1 = thermo1.psi();
|
const volScalarField& psi1 = thermo1.psi();
|
||||||
|
|
||||||
volScalarField rho2("rho" + phase2Name, thermo2.rho());
|
volScalarField& rho2 = thermo2.rho();
|
||||||
const volScalarField& psi2 = thermo2.psi();
|
const volScalarField& psi2 = thermo2.psi();
|
||||||
|
|
||||||
volVectorField U
|
volVectorField U
|
||||||
|
|||||||
@ -1,7 +1,4 @@
|
|||||||
{
|
{
|
||||||
rho1 = thermo1.rho();
|
|
||||||
rho2 = thermo2.rho();
|
|
||||||
|
|
||||||
surfaceScalarField alpha1f(fvc::interpolate(alpha1));
|
surfaceScalarField alpha1f(fvc::interpolate(alpha1));
|
||||||
surfaceScalarField alpha2f(scalar(1) - alpha1f);
|
surfaceScalarField alpha2f(scalar(1) - alpha1f);
|
||||||
|
|
||||||
@ -91,10 +88,7 @@
|
|||||||
tmp<fvScalarMatrix> pEqnComp1;
|
tmp<fvScalarMatrix> pEqnComp1;
|
||||||
tmp<fvScalarMatrix> pEqnComp2;
|
tmp<fvScalarMatrix> pEqnComp2;
|
||||||
|
|
||||||
//if (transonic)
|
if (pimple.transonic())
|
||||||
//{
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
{
|
{
|
||||||
surfaceScalarField phid1
|
surfaceScalarField phid1
|
||||||
(
|
(
|
||||||
@ -107,17 +101,42 @@
|
|||||||
fvc::interpolate(psi2)*phi2
|
fvc::interpolate(psi2)*phi2
|
||||||
);
|
);
|
||||||
|
|
||||||
|
pEqnComp1 =
|
||||||
|
fvc::ddt(rho1)
|
||||||
|
+ fvc::div(phi1, rho1) - fvc::Sp(fvc::div(phi1), rho1)
|
||||||
|
+ correction
|
||||||
|
(
|
||||||
|
psi1*fvm::ddt(p)
|
||||||
|
+ fvm::div(phid1, p) - fvm::Sp(fvc::div(phid1), p)
|
||||||
|
);
|
||||||
|
deleteDemandDrivenData(pEqnComp1().faceFluxCorrectionPtr());
|
||||||
|
pEqnComp1().relax();
|
||||||
|
|
||||||
|
pEqnComp2 =
|
||||||
|
fvc::ddt(rho2)
|
||||||
|
+ fvc::div(phi2, rho2) - fvc::Sp(fvc::div(phi2), rho2)
|
||||||
|
+ correction
|
||||||
|
(
|
||||||
|
psi2*fvm::ddt(p)
|
||||||
|
+ fvm::div(phid2, p) - fvm::Sp(fvc::div(phid2), p)
|
||||||
|
);
|
||||||
|
deleteDemandDrivenData(pEqnComp2().faceFluxCorrectionPtr());
|
||||||
|
pEqnComp2().relax();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
pEqnComp1 =
|
pEqnComp1 =
|
||||||
fvc::ddt(rho1) + psi1*correction(fvm::ddt(p))
|
fvc::ddt(rho1) + psi1*correction(fvm::ddt(p))
|
||||||
+ fvc::div(phid1, p)
|
+ fvc::div(phi1, rho1) - fvc::Sp(fvc::div(phi1), rho1);
|
||||||
- fvc::Sp(fvc::div(phid1), p);
|
|
||||||
|
|
||||||
pEqnComp2 =
|
pEqnComp2 =
|
||||||
fvc::ddt(rho2) + psi2*correction(fvm::ddt(p))
|
fvc::ddt(rho2) + psi2*correction(fvm::ddt(p))
|
||||||
+ fvc::div(phid2, p)
|
+ fvc::div(phi2, rho2) - fvc::Sp(fvc::div(phi2), rho2);
|
||||||
- fvc::Sp(fvc::div(phid2), p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cache p prior to solve for density update
|
||||||
|
volScalarField p_0(p);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqnIncomp
|
fvScalarMatrix pEqnIncomp
|
||||||
@ -182,10 +201,9 @@
|
|||||||
|
|
||||||
p = max(p, pMin);
|
p = max(p, pMin);
|
||||||
|
|
||||||
thermo1.correct();
|
// Update densities from change in p
|
||||||
thermo2.correct();
|
rho1 += psi1*(p - p_0);
|
||||||
rho1 = thermo1.rho();
|
rho2 += psi2*(p - p_0);
|
||||||
rho2 = thermo2.rho();
|
|
||||||
|
|
||||||
K1 = 0.5*magSqr(U1);
|
K1 = 0.5*magSqr(U1);
|
||||||
K2 = 0.5*magSqr(U2);
|
K2 = 0.5*magSqr(U2);
|
||||||
|
|||||||
@ -53,6 +53,8 @@
|
|||||||
fvc::makeRelative(phi, U);
|
fvc::makeRelative(phi, U);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
phi.oldTime() = phi;
|
||||||
|
|
||||||
|
#include "continuityErrs.H"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -263,8 +263,8 @@ void Foam::sigFpe::set(const bool verbose)
|
|||||||
{
|
{
|
||||||
if (supported)
|
if (supported)
|
||||||
{
|
{
|
||||||
Info<< "SetNaN : Initialising allocated memory to NaN"
|
Info<< "SetNaN : Initialising allocated memory to NaN"
|
||||||
<< " (FOAM_SETNAN)." << endl;
|
<< " (FOAM_SETNAN)." << endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -367,6 +367,8 @@ $(cellShape)/cellShapeIOList.C
|
|||||||
|
|
||||||
meshes/Identifiers/patch/patchIdentifier.C
|
meshes/Identifiers/patch/patchIdentifier.C
|
||||||
|
|
||||||
|
meshes/MeshObject/meshObject.C
|
||||||
|
|
||||||
polyMesh = meshes/polyMesh
|
polyMesh = meshes/polyMesh
|
||||||
|
|
||||||
polyPatches = $(polyMesh)/polyPatches
|
polyPatches = $(polyMesh)/polyPatches
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -132,7 +132,9 @@ inline const T& Foam::PtrList<T>::operator[](const label i) const
|
|||||||
if (!ptrs_[i])
|
if (!ptrs_[i])
|
||||||
{
|
{
|
||||||
FatalErrorIn("PtrList::operator[] const")
|
FatalErrorIn("PtrList::operator[] const")
|
||||||
<< "hanging pointer, cannot dereference"
|
<< "hanging pointer at index " << i
|
||||||
|
<< " (size " << size()
|
||||||
|
<< "), cannot dereference"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +148,9 @@ inline T& Foam::PtrList<T>::operator[](const label i)
|
|||||||
if (!ptrs_[i])
|
if (!ptrs_[i])
|
||||||
{
|
{
|
||||||
FatalErrorIn("PtrList::operator[]")
|
FatalErrorIn("PtrList::operator[]")
|
||||||
<< "hanging pointer, cannot dereference"
|
<< "hanging pointer at index " << i
|
||||||
|
<< " (size " << size()
|
||||||
|
<< "), cannot dereference"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -107,7 +107,9 @@ inline const T& Foam::UPtrList<T>::operator[](const label i) const
|
|||||||
if (!ptrs_[i])
|
if (!ptrs_[i])
|
||||||
{
|
{
|
||||||
FatalErrorIn("UPtrList::operator[] const")
|
FatalErrorIn("UPtrList::operator[] const")
|
||||||
<< "hanging pointer, cannot dereference"
|
<< "hanging pointer at index " << i
|
||||||
|
<< " (size " << size()
|
||||||
|
<< "), cannot dereference"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +123,9 @@ inline T& Foam::UPtrList<T>::operator[](const label i)
|
|||||||
if (!ptrs_[i])
|
if (!ptrs_[i])
|
||||||
{
|
{
|
||||||
FatalErrorIn("UPtrList::operator[]")
|
FatalErrorIn("UPtrList::operator[]")
|
||||||
<< "hanging pointer, cannot dereference"
|
<< "hanging pointer at index " << i
|
||||||
|
<< " (size " << size()
|
||||||
|
<< "), cannot dereference"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,7 +24,6 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "processorPointPatchField.H"
|
#include "processorPointPatchField.H"
|
||||||
//#include "transformField.H"
|
|
||||||
#include "processorPolyPatch.H"
|
#include "processorPolyPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -92,73 +91,6 @@ processorPointPatchField<Type>::~processorPointPatchField()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void processorPointPatchField<Type>::initSwapAddSeparated
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes commsType,
|
|
||||||
Field<Type>& pField
|
|
||||||
)
|
|
||||||
const
|
|
||||||
{
|
|
||||||
// if (Pstream::parRun())
|
|
||||||
// {
|
|
||||||
// // Get internal field into correct order for opposite side
|
|
||||||
// Field<Type> pf
|
|
||||||
// (
|
|
||||||
// this->patchInternalField
|
|
||||||
// (
|
|
||||||
// pField,
|
|
||||||
// procPatch_.reverseMeshPoints()
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// OPstream::write
|
|
||||||
// (
|
|
||||||
// commsType,
|
|
||||||
// procPatch_.neighbProcNo(),
|
|
||||||
// reinterpret_cast<const char*>(pf.begin()),
|
|
||||||
// pf.byteSize(),
|
|
||||||
// procPatch_.tag()
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void processorPointPatchField<Type>::swapAddSeparated
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes commsType,
|
|
||||||
Field<Type>& pField
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
// if (Pstream::parRun())
|
|
||||||
// {
|
|
||||||
// Field<Type> pnf(this->size());
|
|
||||||
//
|
|
||||||
// IPstream::read
|
|
||||||
// (
|
|
||||||
// commsType,
|
|
||||||
// procPatch_.neighbProcNo(),
|
|
||||||
// reinterpret_cast<char*>(pnf.begin()),
|
|
||||||
// pnf.byteSize(),
|
|
||||||
// procPatch_.tag()
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// if (doTransform())
|
|
||||||
// {
|
|
||||||
// const processorPolyPatch& ppp = procPatch_.procPolyPatch();
|
|
||||||
// const tensor& forwardT = ppp.forwardT();
|
|
||||||
//
|
|
||||||
// transform(pnf, forwardT, pnf);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// addToInternalField(pField, pnf, procPatch_.separatedPoints());
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -57,7 +57,6 @@ class processorPointPatchField
|
|||||||
//- Local reference to processor patch
|
//- Local reference to processor patch
|
||||||
const processorPointPatch& procPatch_;
|
const processorPointPatch& procPatch_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -176,19 +175,13 @@ public:
|
|||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Initialise swap of non-collocated patch point values
|
//- Assume processor patch always collocated
|
||||||
virtual void initSwapAddSeparated
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes commsType,
|
|
||||||
Field<Type>&
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Complete swap of patch point values and add to local values
|
|
||||||
virtual void swapAddSeparated
|
virtual void swapAddSeparated
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes commsType,
|
const Pstream::commsTypes commsType,
|
||||||
Field<Type>&
|
Field<Type>&
|
||||||
) const;
|
) const
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -38,7 +38,8 @@ Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
coupledPointPatchField<Type>(p, iF),
|
coupledPointPatchField<Type>(p, iF),
|
||||||
procPatch_(refCast<const processorCyclicPointPatch>(p))
|
procPatch_(refCast<const processorCyclicPointPatch>(p)),
|
||||||
|
receiveBuf_(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -51,7 +52,8 @@ Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
coupledPointPatchField<Type>(p, iF, dict),
|
coupledPointPatchField<Type>(p, iF, dict),
|
||||||
procPatch_(refCast<const processorCyclicPointPatch>(p))
|
procPatch_(refCast<const processorCyclicPointPatch>(p)),
|
||||||
|
receiveBuf_(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -65,7 +67,8 @@ Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
coupledPointPatchField<Type>(ptf, p, iF, mapper),
|
coupledPointPatchField<Type>(ptf, p, iF, mapper),
|
||||||
procPatch_(refCast<const processorCyclicPointPatch>(ptf.patch()))
|
procPatch_(refCast<const processorCyclicPointPatch>(ptf.patch())),
|
||||||
|
receiveBuf_(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -77,7 +80,8 @@ Foam::processorCyclicPointPatchField<Type>::processorCyclicPointPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
coupledPointPatchField<Type>(ptf, iF),
|
coupledPointPatchField<Type>(ptf, iF),
|
||||||
procPatch_(refCast<const processorCyclicPointPatch>(ptf.patch()))
|
procPatch_(refCast<const processorCyclicPointPatch>(ptf.patch())),
|
||||||
|
receiveBuf_(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -109,6 +113,18 @@ void Foam::processorCyclicPointPatchField<Type>::initSwapAddSeparated
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (commsType == Pstream::nonBlocking)
|
||||||
|
{
|
||||||
|
receiveBuf_.setSize(pf.size());
|
||||||
|
IPstream::read
|
||||||
|
(
|
||||||
|
commsType,
|
||||||
|
procPatch_.neighbProcNo(),
|
||||||
|
reinterpret_cast<char*>(receiveBuf_.begin()),
|
||||||
|
receiveBuf_.byteSize(),
|
||||||
|
procPatch_.tag()
|
||||||
|
);
|
||||||
|
}
|
||||||
OPstream::write
|
OPstream::write
|
||||||
(
|
(
|
||||||
commsType,
|
commsType,
|
||||||
@ -130,16 +146,19 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
|
|||||||
{
|
{
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
Field<Type> pnf(this->size());
|
// If nonblocking data has already been received into receiveBuf_
|
||||||
|
if (commsType != Pstream::nonBlocking)
|
||||||
IPstream::read
|
{
|
||||||
(
|
receiveBuf_.setSize(this->size());
|
||||||
commsType,
|
IPstream::read
|
||||||
procPatch_.neighbProcNo(),
|
(
|
||||||
reinterpret_cast<char*>(pnf.begin()),
|
commsType,
|
||||||
pnf.byteSize(),
|
procPatch_.neighbProcNo(),
|
||||||
procPatch_.tag()
|
reinterpret_cast<char*>(receiveBuf_.begin()),
|
||||||
);
|
receiveBuf_.byteSize(),
|
||||||
|
procPatch_.tag()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (doTransform())
|
if (doTransform())
|
||||||
{
|
{
|
||||||
@ -147,11 +166,11 @@ void Foam::processorCyclicPointPatchField<Type>::swapAddSeparated
|
|||||||
procPatch_.procCyclicPolyPatch();
|
procPatch_.procCyclicPolyPatch();
|
||||||
const tensor& forwardT = ppp.forwardT()[0];
|
const tensor& forwardT = ppp.forwardT()[0];
|
||||||
|
|
||||||
transform(pnf, forwardT, pnf);
|
transform(receiveBuf_, forwardT, receiveBuf_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// All points are separated
|
// All points are separated
|
||||||
this->addToInternalField(pField, pnf);
|
this->addToInternalField(pField, receiveBuf_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -57,6 +57,9 @@ class processorCyclicPointPatchField
|
|||||||
//- Local reference to processor patch
|
//- Local reference to processor patch
|
||||||
const processorCyclicPointPatch& procPatch_;
|
const processorCyclicPointPatch& procPatch_;
|
||||||
|
|
||||||
|
//- Receive buffer for non-blocking communication
|
||||||
|
mutable Field<Type> receiveBuf_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,7 @@ License
|
|||||||
|
|
||||||
#include "MeshObject.H"
|
#include "MeshObject.H"
|
||||||
#include "objectRegistry.H"
|
#include "objectRegistry.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -59,6 +60,11 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (meshObject::debug)
|
||||||
|
{
|
||||||
|
Pout<< "MeshObject::New(const Mesh&) : constructing new "
|
||||||
|
<< Type::typeName << endl;
|
||||||
|
}
|
||||||
return regIOobject::store(new Type(mesh));
|
return regIOobject::store(new Type(mesh));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,6 +93,11 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (meshObject::debug)
|
||||||
|
{
|
||||||
|
Pout<< "MeshObject::New(const Mesh&) : constructing new "
|
||||||
|
<< Type::typeName << endl;
|
||||||
|
}
|
||||||
return regIOobject::store(new Type(mesh, d));
|
return regIOobject::store(new Type(mesh, d));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,6 +127,11 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (meshObject::debug)
|
||||||
|
{
|
||||||
|
Pout<< "MeshObject(const Mesh&) : constructing new "
|
||||||
|
<< Type::typeName << endl;
|
||||||
|
}
|
||||||
return regIOobject::store(new Type(mesh, d1, d2));
|
return regIOobject::store(new Type(mesh, d1, d2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,6 +162,11 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (meshObject::debug)
|
||||||
|
{
|
||||||
|
Pout<< "MeshObject(const Mesh&) : constructing new "
|
||||||
|
<< Type::typeName << endl;
|
||||||
|
}
|
||||||
return regIOobject::store(new Type(mesh, d1, d2, d3));
|
return regIOobject::store(new Type(mesh, d1, d2, d3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -177,6 +198,11 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (meshObject::debug)
|
||||||
|
{
|
||||||
|
Pout<< "MeshObject(const Mesh&) : constructing new "
|
||||||
|
<< Type::typeName << endl;
|
||||||
|
}
|
||||||
return regIOobject::store(new Type(mesh, d1, d2, d3, d4));
|
return regIOobject::store(new Type(mesh, d1, d2, d3, d4));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -195,6 +221,12 @@ bool Foam::MeshObject<Mesh, MeshObjectType, Type>::Delete(const Mesh& mesh)
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (meshObject::debug)
|
||||||
|
{
|
||||||
|
Pout<< "MeshObject::Delete(const Mesh&) : deleting "
|
||||||
|
<< Type::typeName << endl;
|
||||||
|
}
|
||||||
|
|
||||||
return mesh.thisDb().checkOut
|
return mesh.thisDb().checkOut
|
||||||
(
|
(
|
||||||
const_cast<Type&>
|
const_cast<Type&>
|
||||||
@ -237,10 +269,22 @@ void Foam::meshObject::movePoints(objectRegistry& obr)
|
|||||||
{
|
{
|
||||||
if (isA<MoveableMeshObject<Mesh> >(*iter()))
|
if (isA<MoveableMeshObject<Mesh> >(*iter()))
|
||||||
{
|
{
|
||||||
|
if (meshObject::debug)
|
||||||
|
{
|
||||||
|
Pout<< "meshObject::movePoints(objectRegistry&) :"
|
||||||
|
<< " movePoints on "
|
||||||
|
<< iter()->name() << endl;
|
||||||
|
}
|
||||||
dynamic_cast<MoveableMeshObject<Mesh>*>(iter())->movePoints();
|
dynamic_cast<MoveableMeshObject<Mesh>*>(iter())->movePoints();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (meshObject::debug)
|
||||||
|
{
|
||||||
|
Pout<< "meshObject::movePoints(objectRegistry&) :"
|
||||||
|
<< " destroying "
|
||||||
|
<< iter()->name() << endl;
|
||||||
|
}
|
||||||
obr.checkOut(*iter());
|
obr.checkOut(*iter());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -264,10 +308,21 @@ void Foam::meshObject::updateMesh(objectRegistry& obr, const mapPolyMesh& mpm)
|
|||||||
{
|
{
|
||||||
if (isA<UpdateableMeshObject<Mesh> >(*iter()))
|
if (isA<UpdateableMeshObject<Mesh> >(*iter()))
|
||||||
{
|
{
|
||||||
|
if (meshObject::debug)
|
||||||
|
{
|
||||||
|
Pout<< "meshObject::updateMesh(objectRegistry&) :"
|
||||||
|
<< " updateMesh on "
|
||||||
|
<< iter()->name() << endl;
|
||||||
|
}
|
||||||
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->updateMesh(mpm);
|
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->updateMesh(mpm);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (meshObject::debug)
|
||||||
|
{
|
||||||
|
Pout<< "meshObject::updateMesh(objectRegistry&) : destroying "
|
||||||
|
<< iter()->name() << endl;
|
||||||
|
}
|
||||||
obr.checkOut(*iter());
|
obr.checkOut(*iter());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -284,6 +339,11 @@ void Foam::meshObject::clear(objectRegistry& obr)
|
|||||||
|
|
||||||
forAllIter(typename HashTable<MeshObjectType<Mesh>*>, meshObjects, iter)
|
forAllIter(typename HashTable<MeshObjectType<Mesh>*>, meshObjects, iter)
|
||||||
{
|
{
|
||||||
|
if (meshObject::debug)
|
||||||
|
{
|
||||||
|
Pout<< "meshObject::clear(objectRegistry&) : destroying "
|
||||||
|
<< iter()->name() << endl;
|
||||||
|
}
|
||||||
obr.checkOut(*iter());
|
obr.checkOut(*iter());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -164,20 +164,12 @@ class meshObject
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// Declare name of the class and its debug switch
|
||||||
|
ClassName("meshObject");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
meshObject(const word& typeName, const objectRegistry& obr)
|
meshObject(const word& typeName, const objectRegistry& obr);
|
||||||
:
|
|
||||||
regIOobject
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
typeName,
|
|
||||||
obr.instance(),
|
|
||||||
obr
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Static member functions
|
// Static member functions
|
||||||
|
|||||||
52
src/OpenFOAM/meshes/MeshObject/meshObject.C
Normal file
52
src/OpenFOAM/meshes/MeshObject/meshObject.C
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "MeshObject.H"
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(meshObject, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::meshObject::meshObject(const word& typeName, const objectRegistry& obr)
|
||||||
|
:
|
||||||
|
regIOobject
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
typeName,
|
||||||
|
obr.instance(),
|
||||||
|
obr
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -37,10 +37,7 @@ namespace Foam
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
||||||
(
|
(
|
||||||
@ -66,20 +63,10 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
neighbProcNo,
|
neighbProcNo,
|
||||||
transform
|
transform
|
||||||
),
|
),
|
||||||
tag_
|
|
||||||
(
|
|
||||||
Pstream::nProcs()*max(myProcNo, neighbProcNo)
|
|
||||||
+ min(myProcNo, neighbProcNo)
|
|
||||||
),
|
|
||||||
referPatchName_(referPatchName),
|
referPatchName_(referPatchName),
|
||||||
|
tag_(-1),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{
|
{}
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Pout<< "processorCyclicPolyPatch " << name << " uses tag " << tag_
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
||||||
@ -92,20 +79,10 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPolyPatch(name, dict, index, bm, patchType),
|
processorPolyPatch(name, dict, index, bm, patchType),
|
||||||
tag_
|
|
||||||
(
|
|
||||||
Pstream::nProcs()*max(myProcNo(), neighbProcNo())
|
|
||||||
+ min(myProcNo(), neighbProcNo())
|
|
||||||
),
|
|
||||||
referPatchName_(dict.lookup("referPatch")),
|
referPatchName_(dict.lookup("referPatch")),
|
||||||
|
tag_(dict.lookupOrDefault<int>("tag", -1)),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{
|
{}
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Pout<< "processorCyclicPolyPatch " << name << " uses tag " << tag_
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
||||||
@ -115,8 +92,8 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPolyPatch(pp, bm),
|
processorPolyPatch(pp, bm),
|
||||||
tag_(pp.tag_),
|
|
||||||
referPatchName_(pp.referPatchName()),
|
referPatchName_(pp.referPatchName()),
|
||||||
|
tag_(pp.tag()),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -132,8 +109,8 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPolyPatch(pp, bm, index, newSize, newStart),
|
processorPolyPatch(pp, bm, index, newSize, newStart),
|
||||||
tag_(pp.tag_),
|
|
||||||
referPatchName_(referPatchName),
|
referPatchName_(referPatchName),
|
||||||
|
tag_(-1),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -148,8 +125,8 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPolyPatch(pp, bm, index, mapAddressing, newStart),
|
processorPolyPatch(pp, bm, index, mapAddressing, newStart),
|
||||||
tag_(pp.tag_),
|
|
||||||
referPatchName_(pp.referPatchName()),
|
referPatchName_(pp.referPatchName()),
|
||||||
|
tag_(-1),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -162,6 +139,45 @@ Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int Foam::processorCyclicPolyPatch::tag() const
|
||||||
|
{
|
||||||
|
if (tag_ == -1)
|
||||||
|
{
|
||||||
|
// Get unique tag to use for all comms. Make sure that both sides
|
||||||
|
// use the same tag
|
||||||
|
const cyclicPolyPatch& cycPatch = refCast<const cyclicPolyPatch>
|
||||||
|
(
|
||||||
|
referPatch()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (cycPatch.owner())
|
||||||
|
{
|
||||||
|
tag_ = Hash<word>()(cycPatch.name());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tag_ = Hash<word>()(cycPatch.neighbPatch().name());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tag_ == Pstream::msgType() || tag_ == -1)
|
||||||
|
{
|
||||||
|
FatalErrorIn("processorCyclicPolyPatch::tag() const")
|
||||||
|
<< "Tag calculated from cyclic patch name " << tag_
|
||||||
|
<< " is the same as the current message type "
|
||||||
|
<< Pstream::msgType() << " or -1" << nl
|
||||||
|
<< "Please set a non-conflicting, unique, tag by hand"
|
||||||
|
<< " using the 'tag' entry"
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "processorCyclicPolyPatch " << name() << " uses tag " << tag_
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tag_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::processorCyclicPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
void Foam::processorCyclicPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
||||||
{
|
{
|
||||||
@ -283,6 +299,11 @@ void Foam::processorCyclicPolyPatch::write(Ostream& os) const
|
|||||||
processorPolyPatch::write(os);
|
processorPolyPatch::write(os);
|
||||||
os.writeKeyword("referPatch") << referPatchName_
|
os.writeKeyword("referPatch") << referPatchName_
|
||||||
<< token::END_STATEMENT << nl;
|
<< token::END_STATEMENT << nl;
|
||||||
|
if (tag_ != -1)
|
||||||
|
{
|
||||||
|
os.writeKeyword("tag") << tag_
|
||||||
|
<< token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -54,12 +54,12 @@ class processorCyclicPolyPatch
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Message tag to use for communication
|
|
||||||
const int tag_;
|
|
||||||
|
|
||||||
//- Name of originating patch
|
//- Name of originating patch
|
||||||
const word referPatchName_;
|
const word referPatchName_;
|
||||||
|
|
||||||
|
//- Message tag to use for communication
|
||||||
|
mutable int tag_;
|
||||||
|
|
||||||
//- Index of originating patch
|
//- Index of originating patch
|
||||||
mutable label referPatchID_;
|
mutable label referPatchID_;
|
||||||
|
|
||||||
@ -264,10 +264,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return message tag to use for communication
|
//- Return message tag to use for communication
|
||||||
virtual int tag() const
|
virtual int tag() const;
|
||||||
{
|
|
||||||
return tag_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Does this side own the patch ?
|
//- Does this side own the patch ?
|
||||||
virtual bool owner() const
|
virtual bool owner() const
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -42,12 +42,9 @@ mappedFieldFvPatchField<Type>::mappedFieldFvPatchField
|
|||||||
const DimensionedField<Type, volMesh>& iF
|
const DimensionedField<Type, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mappedPatchBase(p.patch()),
|
|
||||||
fixedValueFvPatchField<Type>(p, iF),
|
fixedValueFvPatchField<Type>(p, iF),
|
||||||
fieldName_(iF.name()),
|
mappedPatchBase(p.patch()),
|
||||||
setAverage_(false),
|
mappedPatchFieldBase<Type>(*this, *this)
|
||||||
average_(pTraits<Type>::zero),
|
|
||||||
interpolationScheme_(interpolationCell<Type>::typeName)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -60,12 +57,9 @@ mappedFieldFvPatchField<Type>::mappedFieldFvPatchField
|
|||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mappedPatchBase(p.patch(), ptf),
|
|
||||||
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
||||||
fieldName_(ptf.fieldName_),
|
mappedPatchBase(p.patch(), ptf),
|
||||||
setAverage_(ptf.setAverage_),
|
mappedPatchFieldBase<Type>(*this, *this, ptf)
|
||||||
average_(ptf.average_),
|
|
||||||
interpolationScheme_(ptf.interpolationScheme_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -77,18 +71,10 @@ mappedFieldFvPatchField<Type>::mappedFieldFvPatchField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mappedPatchBase(p.patch(), dict),
|
|
||||||
fixedValueFvPatchField<Type>(p, iF, dict),
|
fixedValueFvPatchField<Type>(p, iF, dict),
|
||||||
fieldName_(dict.template lookupOrDefault<word>("fieldName", iF.name())),
|
mappedPatchBase(p.patch(), dict),
|
||||||
setAverage_(readBool(dict.lookup("setAverage"))),
|
mappedPatchFieldBase<Type>(*this, *this, dict)
|
||||||
average_(pTraits<Type>(dict.lookup("average"))),
|
{}
|
||||||
interpolationScheme_(interpolationCell<Type>::typeName)
|
|
||||||
{
|
|
||||||
if (mode() == mappedPatchBase::NEARESTCELL)
|
|
||||||
{
|
|
||||||
dict.lookup("interpolationScheme") >> interpolationScheme_;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -110,6 +96,7 @@ mappedFieldFvPatchField<Type>::mappedFieldFvPatchField
|
|||||||
const word& interpolationScheme
|
const word& interpolationScheme
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
fixedValueFvPatchField<Type>(p, iF),
|
||||||
mappedPatchBase
|
mappedPatchBase
|
||||||
(
|
(
|
||||||
p.patch(),
|
p.patch(),
|
||||||
@ -118,11 +105,15 @@ mappedFieldFvPatchField<Type>::mappedFieldFvPatchField
|
|||||||
samplePatch,
|
samplePatch,
|
||||||
distance
|
distance
|
||||||
),
|
),
|
||||||
fixedValueFvPatchField<Type>(p, iF),
|
mappedPatchFieldBase<Type>
|
||||||
fieldName_(fieldName),
|
(
|
||||||
setAverage_(setAverage),
|
*this,
|
||||||
average_(average),
|
*this,
|
||||||
interpolationScheme_(interpolationScheme)
|
fieldName,
|
||||||
|
setAverage,
|
||||||
|
average,
|
||||||
|
interpolationScheme
|
||||||
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -132,12 +123,9 @@ mappedFieldFvPatchField<Type>::mappedFieldFvPatchField
|
|||||||
const mappedFieldFvPatchField<Type>& ptf
|
const mappedFieldFvPatchField<Type>& ptf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mappedPatchBase(ptf.patch().patch(), ptf),
|
|
||||||
fixedValueFvPatchField<Type>(ptf),
|
fixedValueFvPatchField<Type>(ptf),
|
||||||
fieldName_(ptf.fieldName_),
|
mappedPatchBase(ptf.patch().patch(), ptf),
|
||||||
setAverage_(ptf.setAverage_),
|
mappedPatchFieldBase<Type>(ptf)
|
||||||
average_(ptf.average_),
|
|
||||||
interpolationScheme_(ptf.interpolationScheme_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -148,65 +136,14 @@ mappedFieldFvPatchField<Type>::mappedFieldFvPatchField
|
|||||||
const DimensionedField<Type, volMesh>& iF
|
const DimensionedField<Type, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mappedPatchBase(ptf.patch().patch(), ptf),
|
|
||||||
fixedValueFvPatchField<Type>(ptf, iF),
|
fixedValueFvPatchField<Type>(ptf, iF),
|
||||||
fieldName_(ptf.fieldName_),
|
mappedPatchBase(ptf.patch().patch(), ptf),
|
||||||
setAverage_(ptf.setAverage_),
|
mappedPatchFieldBase<Type>(*this, *this, ptf)
|
||||||
average_(ptf.average_),
|
|
||||||
interpolationScheme_(ptf.interpolationScheme_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const GeometricField<Type, fvPatchField, volMesh>&
|
|
||||||
mappedFieldFvPatchField<Type>::sampleField() const
|
|
||||||
{
|
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
|
||||||
|
|
||||||
const fvMesh& nbrMesh = refCast<const fvMesh>(sampleMesh());
|
|
||||||
|
|
||||||
if (sameRegion())
|
|
||||||
{
|
|
||||||
if (fieldName_ == this->dimensionedInternalField().name())
|
|
||||||
{
|
|
||||||
// Optimisation: bypass field lookup
|
|
||||||
return
|
|
||||||
dynamic_cast<const fieldType&>
|
|
||||||
(
|
|
||||||
this->dimensionedInternalField()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const fvMesh& thisMesh = this->patch().boundaryMesh().mesh();
|
|
||||||
return thisMesh.template lookupObject<fieldType>(fieldName_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return nbrMesh.template lookupObject<fieldType>(fieldName_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const interpolation<Type>&
|
|
||||||
mappedFieldFvPatchField<Type>::interpolator() const
|
|
||||||
{
|
|
||||||
if (!interpolator_.valid())
|
|
||||||
{
|
|
||||||
interpolator_ = interpolation<Type>::New
|
|
||||||
(
|
|
||||||
interpolationScheme_,
|
|
||||||
sampleField()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return interpolator_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void mappedFieldFvPatchField<Type>::updateCoeffs()
|
void mappedFieldFvPatchField<Type>::updateCoeffs()
|
||||||
{
|
{
|
||||||
@ -215,132 +152,7 @@ void mappedFieldFvPatchField<Type>::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
this->operator==(this->mappedField());
|
||||||
|
|
||||||
// Since we're inside initEvaluate/evaluate there might be processor
|
|
||||||
// comms underway. Change the tag we use.
|
|
||||||
int oldTag = UPstream::msgType();
|
|
||||||
UPstream::msgType() = oldTag + 1;
|
|
||||||
|
|
||||||
const fvMesh& thisMesh = this->patch().boundaryMesh().mesh();
|
|
||||||
const fvMesh& nbrMesh = refCast<const fvMesh>(sampleMesh());
|
|
||||||
|
|
||||||
// Result of obtaining remote values
|
|
||||||
Field<Type> newValues;
|
|
||||||
|
|
||||||
switch (mode())
|
|
||||||
{
|
|
||||||
case NEARESTCELL:
|
|
||||||
{
|
|
||||||
const mapDistribute& mapDist = this->mappedPatchBase::map();
|
|
||||||
|
|
||||||
if (interpolationScheme_ != interpolationCell<Type>::typeName)
|
|
||||||
{
|
|
||||||
// Need to do interpolation so need cells to sample
|
|
||||||
|
|
||||||
// Send back sample points to the processor that holds the cell
|
|
||||||
vectorField samples(samplePoints());
|
|
||||||
mapDist.reverseDistribute
|
|
||||||
(
|
|
||||||
(sameRegion() ? thisMesh.nCells() : nbrMesh.nCells()),
|
|
||||||
point::max,
|
|
||||||
samples
|
|
||||||
);
|
|
||||||
|
|
||||||
const interpolation<Type>& interp = interpolator();
|
|
||||||
|
|
||||||
newValues.setSize(samples.size(), pTraits<Type>::max);
|
|
||||||
forAll(samples, cellI)
|
|
||||||
{
|
|
||||||
if (samples[cellI] != point::max)
|
|
||||||
{
|
|
||||||
newValues[cellI] = interp.interpolate
|
|
||||||
(
|
|
||||||
samples[cellI],
|
|
||||||
cellI
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newValues = sampleField();
|
|
||||||
}
|
|
||||||
|
|
||||||
mapDist.distribute(newValues);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case NEARESTPATCHFACE: case NEARESTPATCHFACEAMI:
|
|
||||||
{
|
|
||||||
const label nbrPatchID =
|
|
||||||
nbrMesh.boundaryMesh().findPatchID(samplePatch());
|
|
||||||
if (nbrPatchID < 0)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"void mappedFieldFvPatchField<Type>::updateCoeffs()"
|
|
||||||
)<< "Unable to find sample patch " << samplePatch()
|
|
||||||
<< " in region " << sampleRegion()
|
|
||||||
<< " for patch " << this->patch().name() << nl
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
const fieldType& nbrField = sampleField();
|
|
||||||
|
|
||||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
|
||||||
this->distribute(newValues);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case NEARESTFACE:
|
|
||||||
{
|
|
||||||
Field<Type> allValues(nbrMesh.nFaces(), pTraits<Type>::zero);
|
|
||||||
|
|
||||||
const fieldType& nbrField = sampleField();
|
|
||||||
|
|
||||||
forAll(nbrField.boundaryField(), patchI)
|
|
||||||
{
|
|
||||||
const fvPatchField<Type>& pf =
|
|
||||||
nbrField.boundaryField()[patchI];
|
|
||||||
label faceStart = pf.patch().patch().start();
|
|
||||||
|
|
||||||
forAll(pf, faceI)
|
|
||||||
{
|
|
||||||
allValues[faceStart++] = pf[faceI];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this->distribute(allValues);
|
|
||||||
newValues.transfer(allValues);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
FatalErrorIn("mappedFieldFvPatchField<Type>::updateCoeffs()")
|
|
||||||
<< "Unknown sampling mode: " << mode()
|
|
||||||
<< nl << abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (setAverage_)
|
|
||||||
{
|
|
||||||
Type averagePsi =
|
|
||||||
gSum(this->patch().magSf()*newValues)
|
|
||||||
/gSum(this->patch().magSf());
|
|
||||||
|
|
||||||
if (mag(averagePsi)/mag(average_) > 0.5)
|
|
||||||
{
|
|
||||||
newValues *= mag(average_)/mag(averagePsi);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newValues += (average_ - averagePsi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this->operator==(newValues);
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -352,9 +164,6 @@ void mappedFieldFvPatchField<Type>::updateCoeffs()
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore tag
|
|
||||||
UPstream::msgType() = oldTag;
|
|
||||||
|
|
||||||
fixedValueFvPatchField<Type>::updateCoeffs();
|
fixedValueFvPatchField<Type>::updateCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,11 +173,7 @@ void mappedFieldFvPatchField<Type>::write(Ostream& os) const
|
|||||||
{
|
{
|
||||||
fvPatchField<Type>::write(os);
|
fvPatchField<Type>::write(os);
|
||||||
mappedPatchBase::write(os);
|
mappedPatchBase::write(os);
|
||||||
os.writeKeyword("fieldName") << fieldName_ << token::END_STATEMENT << nl;
|
mappedPatchFieldBase<Type>::write(os);
|
||||||
os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("average") << average_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("interpolationScheme") << interpolationScheme_
|
|
||||||
<< token::END_STATEMENT << nl;
|
|
||||||
this->writeEntry("value", os);
|
this->writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,6 +75,7 @@ SourceFiles
|
|||||||
#define mappedFieldFvPatchField_H
|
#define mappedFieldFvPatchField_H
|
||||||
|
|
||||||
#include "mappedPatchBase.H"
|
#include "mappedPatchBase.H"
|
||||||
|
#include "mappedPatchFieldBase.H"
|
||||||
#include "fixedValueFvPatchFields.H"
|
#include "fixedValueFvPatchFields.H"
|
||||||
#include "interpolation.H"
|
#include "interpolation.H"
|
||||||
|
|
||||||
@ -90,37 +91,10 @@ namespace Foam
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
class mappedFieldFvPatchField
|
class mappedFieldFvPatchField
|
||||||
:
|
:
|
||||||
|
public fixedValueFvPatchField<Type>,
|
||||||
public mappedPatchBase,
|
public mappedPatchBase,
|
||||||
public fixedValueFvPatchField<Type>
|
public mappedPatchFieldBase<Type>
|
||||||
{
|
{
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Name of field to sample - defaults to field associated with this
|
|
||||||
// patchField if not specified
|
|
||||||
word fieldName_;
|
|
||||||
|
|
||||||
//- If true adjust the mapped field to maintain average value average_
|
|
||||||
const bool setAverage_;
|
|
||||||
|
|
||||||
//- Average value the mapped field is adjusted to maintain if
|
|
||||||
// setAverage_ is set true
|
|
||||||
const Type average_;
|
|
||||||
|
|
||||||
//- Interpolation scheme to use for nearestCell mode
|
|
||||||
word interpolationScheme_;
|
|
||||||
|
|
||||||
//- Pointer to the cell interpolator
|
|
||||||
mutable autoPtr<interpolation<Type> > interpolator_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Field to sample. Either on my or nbr mesh
|
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& sampleField() const;
|
|
||||||
|
|
||||||
//- Access the interpolation method
|
|
||||||
const interpolation<Type>& interpolator() const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,340 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "mappedPatchFieldBase.H"
|
||||||
|
#include "mappedPatchBase.H"
|
||||||
|
#include "interpolationCell.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
mappedPatchFieldBase<Type>::mappedPatchFieldBase
|
||||||
|
(
|
||||||
|
const mappedPatchBase& mapper,
|
||||||
|
const fvPatchField<Type>& patchField,
|
||||||
|
const word& fieldName,
|
||||||
|
const bool setAverage,
|
||||||
|
const Type average,
|
||||||
|
const word& interpolationScheme
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mapper_(mapper),
|
||||||
|
patchField_(patchField),
|
||||||
|
fieldName_(fieldName),
|
||||||
|
setAverage_(setAverage),
|
||||||
|
average_(average),
|
||||||
|
interpolationScheme_(interpolationScheme)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
mappedPatchFieldBase<Type>::mappedPatchFieldBase
|
||||||
|
(
|
||||||
|
const mappedPatchBase& mapper,
|
||||||
|
const fvPatchField<Type>& patchField,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mapper_(mapper),
|
||||||
|
patchField_(patchField),
|
||||||
|
fieldName_
|
||||||
|
(
|
||||||
|
dict.template lookupOrDefault<word>
|
||||||
|
(
|
||||||
|
"fieldName",
|
||||||
|
patchField_.dimensionedInternalField().name()
|
||||||
|
)
|
||||||
|
),
|
||||||
|
setAverage_(readBool(dict.lookup("setAverage"))),
|
||||||
|
average_(pTraits<Type>(dict.lookup("average"))),
|
||||||
|
interpolationScheme_(interpolationCell<Type>::typeName)
|
||||||
|
{
|
||||||
|
if (mapper_.mode() == mappedPatchBase::NEARESTCELL)
|
||||||
|
{
|
||||||
|
dict.lookup("interpolationScheme") >> interpolationScheme_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
mappedPatchFieldBase<Type>::mappedPatchFieldBase
|
||||||
|
(
|
||||||
|
const mappedPatchBase& mapper,
|
||||||
|
const fvPatchField<Type>& patchField
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mapper_(mapper),
|
||||||
|
patchField_(patchField),
|
||||||
|
fieldName_(patchField_.dimensionedInternalField().name()),
|
||||||
|
setAverage_(false),
|
||||||
|
average_(pTraits<Type>::zero),
|
||||||
|
interpolationScheme_(interpolationCell<Type>::typeName)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
mappedPatchFieldBase<Type>::mappedPatchFieldBase
|
||||||
|
(
|
||||||
|
const mappedPatchFieldBase<Type>& mapper
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mapper_(mapper.mapper_),
|
||||||
|
patchField_(mapper.patchField_),
|
||||||
|
fieldName_(mapper.fieldName_),
|
||||||
|
setAverage_(mapper.setAverage_),
|
||||||
|
average_(mapper.average_),
|
||||||
|
interpolationScheme_(mapper.interpolationScheme_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
mappedPatchFieldBase<Type>::mappedPatchFieldBase
|
||||||
|
(
|
||||||
|
const mappedPatchBase& mapper,
|
||||||
|
const fvPatchField<Type>& patchField,
|
||||||
|
const mappedPatchFieldBase<Type>& base
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mapper_(mapper),
|
||||||
|
patchField_(patchField),
|
||||||
|
fieldName_(base.fieldName_),
|
||||||
|
setAverage_(base.setAverage_),
|
||||||
|
average_(base.average_),
|
||||||
|
interpolationScheme_(base.interpolationScheme_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
const GeometricField<Type, fvPatchField, volMesh>&
|
||||||
|
mappedPatchFieldBase<Type>::sampleField() const
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||||
|
|
||||||
|
const fvMesh& nbrMesh = refCast<const fvMesh>(mapper_.sampleMesh());
|
||||||
|
|
||||||
|
if (mapper_.sameRegion())
|
||||||
|
{
|
||||||
|
if (fieldName_ == patchField_.dimensionedInternalField().name())
|
||||||
|
{
|
||||||
|
// Optimisation: bypass field lookup
|
||||||
|
return
|
||||||
|
dynamic_cast<const fieldType&>
|
||||||
|
(
|
||||||
|
patchField_.dimensionedInternalField()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const fvMesh& thisMesh = patchField_.patch().boundaryMesh().mesh();
|
||||||
|
return thisMesh.template lookupObject<fieldType>(fieldName_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return nbrMesh.template lookupObject<fieldType>(fieldName_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
const interpolation<Type>& mappedPatchFieldBase<Type>::interpolator() const
|
||||||
|
{
|
||||||
|
if (!interpolator_.valid())
|
||||||
|
{
|
||||||
|
interpolator_ = interpolation<Type>::New
|
||||||
|
(
|
||||||
|
interpolationScheme_,
|
||||||
|
sampleField()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return interpolator_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type> > mappedPatchFieldBase<Type>::mappedField() const
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||||
|
|
||||||
|
// Since we're inside initEvaluate/evaluate there might be processor
|
||||||
|
// comms underway. Change the tag we use.
|
||||||
|
int oldTag = UPstream::msgType();
|
||||||
|
UPstream::msgType() = oldTag + 1;
|
||||||
|
|
||||||
|
const fvMesh& thisMesh = patchField_.patch().boundaryMesh().mesh();
|
||||||
|
const fvMesh& nbrMesh = refCast<const fvMesh>(mapper_.sampleMesh());
|
||||||
|
|
||||||
|
// Result of obtaining remote values
|
||||||
|
tmp<Field<Type> > tnewValues(new Field<Type>(0));
|
||||||
|
Field<Type>& newValues = tnewValues();
|
||||||
|
|
||||||
|
switch (mapper_.mode())
|
||||||
|
{
|
||||||
|
case mappedPatchBase::NEARESTCELL:
|
||||||
|
{
|
||||||
|
const mapDistribute& distMap = mapper_.map();
|
||||||
|
|
||||||
|
if (interpolationScheme_ != interpolationCell<Type>::typeName)
|
||||||
|
{
|
||||||
|
// Send back sample points to the processor that holds the cell
|
||||||
|
vectorField samples(mapper_.samplePoints());
|
||||||
|
distMap.reverseDistribute
|
||||||
|
(
|
||||||
|
(
|
||||||
|
mapper_.sameRegion()
|
||||||
|
? thisMesh.nCells()
|
||||||
|
: nbrMesh.nCells()
|
||||||
|
),
|
||||||
|
point::max,
|
||||||
|
samples
|
||||||
|
);
|
||||||
|
|
||||||
|
const interpolation<Type>& interp = interpolator();
|
||||||
|
|
||||||
|
newValues.setSize(samples.size(), pTraits<Type>::max);
|
||||||
|
forAll(samples, cellI)
|
||||||
|
{
|
||||||
|
if (samples[cellI] != point::max)
|
||||||
|
{
|
||||||
|
newValues[cellI] = interp.interpolate
|
||||||
|
(
|
||||||
|
samples[cellI],
|
||||||
|
cellI
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newValues = sampleField();
|
||||||
|
}
|
||||||
|
|
||||||
|
distMap.distribute(newValues);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case mappedPatchBase::NEARESTPATCHFACE:
|
||||||
|
case mappedPatchBase::NEARESTPATCHFACEAMI:
|
||||||
|
{
|
||||||
|
const label nbrPatchID =
|
||||||
|
nbrMesh.boundaryMesh().findPatchID(mapper_.samplePatch());
|
||||||
|
|
||||||
|
if (nbrPatchID < 0)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"void mappedPatchFieldBase<Type>::updateCoeffs()"
|
||||||
|
)<< "Unable to find sample patch " << mapper_.samplePatch()
|
||||||
|
<< " in region " << mapper_.sampleRegion()
|
||||||
|
<< " for patch " << patchField_.patch().name() << nl
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
const fieldType& nbrField = sampleField();
|
||||||
|
|
||||||
|
newValues = nbrField.boundaryField()[nbrPatchID];
|
||||||
|
mapper_.distribute(newValues);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case mappedPatchBase::NEARESTFACE:
|
||||||
|
{
|
||||||
|
Field<Type> allValues(nbrMesh.nFaces(), pTraits<Type>::zero);
|
||||||
|
|
||||||
|
const fieldType& nbrField = sampleField();
|
||||||
|
|
||||||
|
forAll(nbrField.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
const fvPatchField<Type>& pf =
|
||||||
|
nbrField.boundaryField()[patchI];
|
||||||
|
label faceStart = pf.patch().start();
|
||||||
|
|
||||||
|
forAll(pf, faceI)
|
||||||
|
{
|
||||||
|
allValues[faceStart++] = pf[faceI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mapper_.distribute(allValues);
|
||||||
|
newValues.transfer(allValues);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"mappedPatchFieldBase<Type>::updateCoeffs()"
|
||||||
|
)<< "Unknown sampling mode: " << mapper_.mode()
|
||||||
|
<< nl << abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (setAverage_)
|
||||||
|
{
|
||||||
|
Type averagePsi =
|
||||||
|
gSum(patchField_.patch().magSf()*newValues)
|
||||||
|
/gSum(patchField_.patch().magSf());
|
||||||
|
|
||||||
|
if (mag(averagePsi)/mag(average_) > 0.5)
|
||||||
|
{
|
||||||
|
newValues *= mag(average_)/mag(averagePsi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newValues += (average_ - averagePsi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restore tag
|
||||||
|
UPstream::msgType() = oldTag;
|
||||||
|
|
||||||
|
return tnewValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void mappedPatchFieldBase<Type>::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("fieldName") << fieldName_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("average") << average_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("interpolationScheme") << interpolationScheme_
|
||||||
|
<< token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,166 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::mappedPatchFieldBase
|
||||||
|
|
||||||
|
Description
|
||||||
|
Functionality for sampling fields using mappedPatchBase.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
mappedPatchFieldBase.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef mappedPatchFieldBase_H
|
||||||
|
#define mappedPatchFieldBase_H
|
||||||
|
|
||||||
|
#include "fixedValueFvPatchFields.H"
|
||||||
|
#include "volFieldsFwd.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
class mappedPatchBase;
|
||||||
|
template<class> class interpolation;
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class mappedPatchFieldBase Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
class mappedPatchFieldBase
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Mapping engine
|
||||||
|
const mappedPatchBase& mapper_;
|
||||||
|
|
||||||
|
//- Underlying patch field
|
||||||
|
const fvPatchField<Type>& patchField_;
|
||||||
|
|
||||||
|
//- Name of field to sample
|
||||||
|
word fieldName_;
|
||||||
|
|
||||||
|
//- If true adjust the mapped field to maintain average value average_
|
||||||
|
const bool setAverage_;
|
||||||
|
|
||||||
|
//- Average value the mapped field is adjusted to maintain if
|
||||||
|
// setAverage_ is set true
|
||||||
|
const Type average_;
|
||||||
|
|
||||||
|
//- Interpolation scheme to use for nearestcell mode
|
||||||
|
word interpolationScheme_;
|
||||||
|
|
||||||
|
mutable autoPtr<interpolation<Type> > interpolator_;
|
||||||
|
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
mappedPatchFieldBase
|
||||||
|
(
|
||||||
|
const mappedPatchBase& mapper,
|
||||||
|
const fvPatchField<Type>& patchField,
|
||||||
|
const word& fieldName,
|
||||||
|
const bool setAverage,
|
||||||
|
const Type average,
|
||||||
|
const word& interpolationScheme
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
mappedPatchFieldBase
|
||||||
|
(
|
||||||
|
const mappedPatchBase& mapper,
|
||||||
|
const fvPatchField<Type>& patchField,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct empty
|
||||||
|
mappedPatchFieldBase
|
||||||
|
(
|
||||||
|
const mappedPatchBase& mapper,
|
||||||
|
const fvPatchField<Type>& patchField
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct copy
|
||||||
|
mappedPatchFieldBase
|
||||||
|
(
|
||||||
|
const mappedPatchFieldBase<Type>& mapper
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct copy, resetting patch and field
|
||||||
|
mappedPatchFieldBase
|
||||||
|
(
|
||||||
|
const mappedPatchBase& mapper,
|
||||||
|
const fvPatchField<Type>& patchField,
|
||||||
|
const mappedPatchFieldBase<Type>& base
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~mappedPatchFieldBase<Type>()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
//- Field to sample. Either on my or nbr mesh
|
||||||
|
const GeometricField<Type, fvPatchField, volMesh>& sampleField() const;
|
||||||
|
|
||||||
|
//- Access the interpolation method
|
||||||
|
const interpolation<Type>& interpolator() const;
|
||||||
|
|
||||||
|
//- Map sampleField onto *this patch
|
||||||
|
virtual tmp<Field<Type> > mappedField() const;
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "mappedPatchFieldBase.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -26,7 +26,6 @@ License
|
|||||||
#include "mappedFixedValueFvPatchField.H"
|
#include "mappedFixedValueFvPatchField.H"
|
||||||
#include "mappedPatchBase.H"
|
#include "mappedPatchBase.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "interpolationCell.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -43,10 +42,7 @@ mappedFixedValueFvPatchField<Type>::mappedFixedValueFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchField<Type>(p, iF),
|
fixedValueFvPatchField<Type>(p, iF),
|
||||||
fieldName_(iF.name()),
|
mappedPatchFieldBase<Type>(this->mapper(p, iF), *this)
|
||||||
setAverage_(false),
|
|
||||||
average_(pTraits<Type>::zero),
|
|
||||||
interpolationScheme_(interpolationCell<Type>::typeName)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -60,31 +56,8 @@ mappedFixedValueFvPatchField<Type>::mappedFixedValueFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
||||||
fieldName_(ptf.fieldName_),
|
mappedPatchFieldBase<Type>(this->mapper(p, iF), *this, ptf)
|
||||||
setAverage_(ptf.setAverage_),
|
{}
|
||||||
average_(ptf.average_),
|
|
||||||
interpolationScheme_(ptf.interpolationScheme_)
|
|
||||||
{
|
|
||||||
if (!isA<mappedPatchBase>(this->patch().patch()))
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"mappedFixedValueFvPatchField<Type>::"
|
|
||||||
"mappedFixedValueFvPatchField\n"
|
|
||||||
"(\n"
|
|
||||||
" const mappedFixedValueFvPatchField<Type>&,\n"
|
|
||||||
" const fvPatch&,\n"
|
|
||||||
" const Field<Type>&,\n"
|
|
||||||
" const fvPatchFieldMapper&\n"
|
|
||||||
")\n"
|
|
||||||
) << "\n patch type '" << p.type()
|
|
||||||
<< "' not type '" << mappedPatchBase::typeName << "'"
|
|
||||||
<< "\n for patch " << p.name()
|
|
||||||
<< " of field " << this->dimensionedInternalField().name()
|
|
||||||
<< " in file " << this->dimensionedInternalField().objectPath()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -96,39 +69,8 @@ mappedFixedValueFvPatchField<Type>::mappedFixedValueFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchField<Type>(p, iF, dict),
|
fixedValueFvPatchField<Type>(p, iF, dict),
|
||||||
fieldName_(dict.lookupOrDefault<word>("fieldName", iF.name())),
|
mappedPatchFieldBase<Type>(this->mapper(p, iF), *this, dict)
|
||||||
setAverage_(readBool(dict.lookup("setAverage"))),
|
{}
|
||||||
average_(pTraits<Type>(dict.lookup("average"))),
|
|
||||||
interpolationScheme_(interpolationCell<Type>::typeName)
|
|
||||||
{
|
|
||||||
if (!isA<mappedPatchBase>(this->patch().patch()))
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"mappedFixedValueFvPatchField<Type>::"
|
|
||||||
"mappedFixedValueFvPatchField\n"
|
|
||||||
"(\n"
|
|
||||||
" const fvPatch& p,\n"
|
|
||||||
" const DimensionedField<Type, volMesh>& iF,\n"
|
|
||||||
" const dictionary& dict\n"
|
|
||||||
")\n"
|
|
||||||
) << "\n patch type '" << p.type()
|
|
||||||
<< "' not type '" << mappedPatchBase::typeName << "'"
|
|
||||||
<< "\n for patch " << p.name()
|
|
||||||
<< " of field " << this->dimensionedInternalField().name()
|
|
||||||
<< " in file " << this->dimensionedInternalField().objectPath()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
const mappedPatchBase& mpp = refCast<const mappedPatchBase>
|
|
||||||
(
|
|
||||||
mappedFixedValueFvPatchField<Type>::patch().patch()
|
|
||||||
);
|
|
||||||
if (mpp.mode() == mappedPatchBase::NEARESTCELL)
|
|
||||||
{
|
|
||||||
dict.lookup("interpolationScheme") >> interpolationScheme_;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -138,10 +80,7 @@ mappedFixedValueFvPatchField<Type>::mappedFixedValueFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchField<Type>(ptf),
|
fixedValueFvPatchField<Type>(ptf),
|
||||||
fieldName_(ptf.fieldName_),
|
mappedPatchFieldBase<Type>(ptf)
|
||||||
setAverage_(ptf.setAverage_),
|
|
||||||
average_(ptf.average_),
|
|
||||||
interpolationScheme_(ptf.interpolationScheme_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -153,64 +92,32 @@ mappedFixedValueFvPatchField<Type>::mappedFixedValueFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchField<Type>(ptf, iF),
|
fixedValueFvPatchField<Type>(ptf, iF),
|
||||||
fieldName_(ptf.fieldName_),
|
mappedPatchFieldBase<Type>(this->mapper(this->patch(), iF), *this, ptf)
|
||||||
setAverage_(ptf.setAverage_),
|
|
||||||
average_(ptf.average_),
|
|
||||||
interpolationScheme_(ptf.interpolationScheme_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
const GeometricField<Type, fvPatchField, volMesh>&
|
const mappedPatchBase& mappedFixedValueFvPatchField<Type>::mapper
|
||||||
mappedFixedValueFvPatchField<Type>::sampleField() const
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, volMesh>& iF
|
||||||
|
)
|
||||||
{
|
{
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
if (!isA<mappedPatchBase>(p.patch()))
|
||||||
|
|
||||||
const mappedPatchBase& mpp = refCast<const mappedPatchBase>
|
|
||||||
(
|
|
||||||
mappedFixedValueFvPatchField<Type>::patch().patch()
|
|
||||||
);
|
|
||||||
const fvMesh& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
|
|
||||||
|
|
||||||
if (mpp.sameRegion())
|
|
||||||
{
|
{
|
||||||
if (fieldName_ == this->dimensionedInternalField().name())
|
FatalErrorIn
|
||||||
{
|
|
||||||
// Optimisation: bypass field lookup
|
|
||||||
return
|
|
||||||
dynamic_cast<const fieldType&>
|
|
||||||
(
|
|
||||||
this->dimensionedInternalField()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const fvMesh& thisMesh = this->patch().boundaryMesh().mesh();
|
|
||||||
return thisMesh.lookupObject<fieldType>(fieldName_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return nbrMesh.lookupObject<fieldType>(fieldName_);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const interpolation<Type>&
|
|
||||||
mappedFixedValueFvPatchField<Type>::interpolator() const
|
|
||||||
{
|
|
||||||
if (!interpolator_.valid())
|
|
||||||
{
|
|
||||||
interpolator_ = interpolation<Type>::New
|
|
||||||
(
|
(
|
||||||
interpolationScheme_,
|
"mappedFixedValueFvPatchField<Type>::mapper()"
|
||||||
sampleField()
|
) << "\n patch type '" << p.patch().type()
|
||||||
);
|
<< "' not type '" << mappedPatchBase::typeName << "'"
|
||||||
|
<< "\n for patch " << p.patch().name()
|
||||||
|
<< " of field " << iF.name()
|
||||||
|
<< " in file " << iF.objectPath()
|
||||||
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
return interpolator_();
|
return refCast<const mappedPatchBase>(p.patch());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -222,140 +129,7 @@ void mappedFixedValueFvPatchField<Type>::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
this->operator==(this->mappedField());
|
||||||
|
|
||||||
// Since we're inside initEvaluate/evaluate there might be processor
|
|
||||||
// comms underway. Change the tag we use.
|
|
||||||
int oldTag = UPstream::msgType();
|
|
||||||
UPstream::msgType() = oldTag + 1;
|
|
||||||
|
|
||||||
// Get the scheduling information from the mappedPatchBase
|
|
||||||
const mappedPatchBase& mpp = refCast<const mappedPatchBase>
|
|
||||||
(
|
|
||||||
mappedFixedValueFvPatchField<Type>::patch().patch()
|
|
||||||
);
|
|
||||||
|
|
||||||
const fvMesh& thisMesh = this->patch().boundaryMesh().mesh();
|
|
||||||
const fvMesh& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
|
|
||||||
|
|
||||||
// Result of obtaining remote values
|
|
||||||
Field<Type> newValues;
|
|
||||||
|
|
||||||
switch (mpp.mode())
|
|
||||||
{
|
|
||||||
case mappedPatchBase::NEARESTCELL:
|
|
||||||
{
|
|
||||||
const mapDistribute& distMap = mpp.map();
|
|
||||||
|
|
||||||
if (interpolationScheme_ != interpolationCell<Type>::typeName)
|
|
||||||
{
|
|
||||||
// Send back sample points to the processor that holds the cell
|
|
||||||
vectorField samples(mpp.samplePoints());
|
|
||||||
distMap.reverseDistribute
|
|
||||||
(
|
|
||||||
(mpp.sameRegion() ? thisMesh.nCells() : nbrMesh.nCells()),
|
|
||||||
point::max,
|
|
||||||
samples
|
|
||||||
);
|
|
||||||
|
|
||||||
const interpolation<Type>& interp = interpolator();
|
|
||||||
|
|
||||||
newValues.setSize(samples.size(), pTraits<Type>::max);
|
|
||||||
forAll(samples, cellI)
|
|
||||||
{
|
|
||||||
if (samples[cellI] != point::max)
|
|
||||||
{
|
|
||||||
newValues[cellI] = interp.interpolate
|
|
||||||
(
|
|
||||||
samples[cellI],
|
|
||||||
cellI
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newValues = sampleField();
|
|
||||||
}
|
|
||||||
|
|
||||||
distMap.distribute(newValues);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case mappedPatchBase::NEARESTPATCHFACE:
|
|
||||||
case mappedPatchBase::NEARESTPATCHFACEAMI:
|
|
||||||
{
|
|
||||||
const label nbrPatchID =
|
|
||||||
nbrMesh.boundaryMesh().findPatchID(mpp.samplePatch());
|
|
||||||
|
|
||||||
if (nbrPatchID < 0)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"void mappedFixedValueFvPatchField<Type>::updateCoeffs()"
|
|
||||||
)<< "Unable to find sample patch " << mpp.samplePatch()
|
|
||||||
<< " in region " << mpp.sampleRegion()
|
|
||||||
<< " for patch " << this->patch().name() << nl
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
const fieldType& nbrField = sampleField();
|
|
||||||
|
|
||||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
|
||||||
mpp.distribute(newValues);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case mappedPatchBase::NEARESTFACE:
|
|
||||||
{
|
|
||||||
Field<Type> allValues(nbrMesh.nFaces(), pTraits<Type>::zero);
|
|
||||||
|
|
||||||
const fieldType& nbrField = sampleField();
|
|
||||||
|
|
||||||
forAll(nbrField.boundaryField(), patchI)
|
|
||||||
{
|
|
||||||
const fvPatchField<Type>& pf =
|
|
||||||
nbrField.boundaryField()[patchI];
|
|
||||||
label faceStart = pf.patch().start();
|
|
||||||
|
|
||||||
forAll(pf, faceI)
|
|
||||||
{
|
|
||||||
allValues[faceStart++] = pf[faceI];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mpp.distribute(allValues);
|
|
||||||
newValues.transfer(allValues);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"mappedFixedValueFvPatchField<Type>::updateCoeffs()"
|
|
||||||
)<< "Unknown sampling mode: " << mpp.mode()
|
|
||||||
<< nl << abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (setAverage_)
|
|
||||||
{
|
|
||||||
Type averagePsi =
|
|
||||||
gSum(this->patch().magSf()*newValues)
|
|
||||||
/gSum(this->patch().magSf());
|
|
||||||
|
|
||||||
if (mag(averagePsi)/mag(average_) > 0.5)
|
|
||||||
{
|
|
||||||
newValues *= mag(average_)/mag(averagePsi);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newValues += (average_ - averagePsi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this->operator==(newValues);
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -368,9 +142,6 @@ void mappedFixedValueFvPatchField<Type>::updateCoeffs()
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore tag
|
|
||||||
UPstream::msgType() = oldTag;
|
|
||||||
|
|
||||||
fixedValueFvPatchField<Type>::updateCoeffs();
|
fixedValueFvPatchField<Type>::updateCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,11 +150,7 @@ template<class Type>
|
|||||||
void mappedFixedValueFvPatchField<Type>::write(Ostream& os) const
|
void mappedFixedValueFvPatchField<Type>::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchField<Type>::write(os);
|
fvPatchField<Type>::write(os);
|
||||||
os.writeKeyword("fieldName") << fieldName_ << token::END_STATEMENT << nl;
|
mappedPatchFieldBase<Type>::write(os);
|
||||||
os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("average") << average_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("interpolationScheme") << interpolationScheme_
|
|
||||||
<< token::END_STATEMENT << nl;
|
|
||||||
this->writeEntry("value", os);
|
this->writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -83,7 +83,8 @@ SourceFiles
|
|||||||
#define mappedFixedValueFvPatchField_H
|
#define mappedFixedValueFvPatchField_H
|
||||||
|
|
||||||
#include "fixedValueFvPatchFields.H"
|
#include "fixedValueFvPatchFields.H"
|
||||||
#include "interpolation.H"
|
//#include "interpolation.H"
|
||||||
|
#include "mappedPatchFieldBase.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -97,37 +98,19 @@ namespace Foam
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
class mappedFixedValueFvPatchField
|
class mappedFixedValueFvPatchField
|
||||||
:
|
:
|
||||||
public fixedValueFvPatchField<Type>
|
public fixedValueFvPatchField<Type>,
|
||||||
|
public mappedPatchFieldBase<Type>
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Name of field to sample - defaults to field associated with this
|
|
||||||
// patchField if not specified
|
|
||||||
word fieldName_;
|
|
||||||
|
|
||||||
//- If true adjust the mapped field to maintain average value average_
|
|
||||||
const bool setAverage_;
|
|
||||||
|
|
||||||
//- Average value the mapped field is adjusted to maintain if
|
|
||||||
// setAverage_ is set true
|
|
||||||
const Type average_;
|
|
||||||
|
|
||||||
//- Interpolation scheme to use for nearestcell mode
|
|
||||||
word interpolationScheme_;
|
|
||||||
|
|
||||||
mutable autoPtr<interpolation<Type> > interpolator_;
|
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Field to sample. Either on my or nbr mesh
|
const mappedPatchBase& mapper
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& sampleField() const;
|
(
|
||||||
|
const fvPatch& p,
|
||||||
//- Access the interpolation method
|
const DimensionedField<Type, volMesh>& iF
|
||||||
const interpolation<Type>& interpolator() const;
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -198,10 +198,61 @@ void Foam::fvPatchField<Type>::patchInternalField(Field<Type>& pif) const
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::fvPatchField<Type>::autoMap
|
void Foam::fvPatchField<Type>::autoMap
|
||||||
(
|
(
|
||||||
const fvPatchFieldMapper& m
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Field<Type>::autoMap(m);
|
Field<Type>& f = *this;
|
||||||
|
|
||||||
|
if (!this->size())
|
||||||
|
{
|
||||||
|
f.setSize(mapper.size());
|
||||||
|
if (f.size())
|
||||||
|
{
|
||||||
|
f = this->patchInternalField();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Map all faces provided with mapping data
|
||||||
|
Field<Type>::autoMap(mapper);
|
||||||
|
|
||||||
|
// For unmapped faces set to internal field value (zero-gradient)
|
||||||
|
if
|
||||||
|
(
|
||||||
|
mapper.direct()
|
||||||
|
&& &mapper.directAddressing()
|
||||||
|
&& mapper.directAddressing().size()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Field<Type> pif(this->patchInternalField());
|
||||||
|
|
||||||
|
const labelList& mapAddressing = mapper.directAddressing();
|
||||||
|
|
||||||
|
forAll(mapAddressing, i)
|
||||||
|
{
|
||||||
|
if (mapAddressing[i] < 0)
|
||||||
|
{
|
||||||
|
f[i] = pif[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!mapper.direct() && mapper.addressing().size())
|
||||||
|
{
|
||||||
|
Field<Type> pif(this->patchInternalField());
|
||||||
|
|
||||||
|
const labelListList& mapAddressing = mapper.addressing();
|
||||||
|
|
||||||
|
forAll(mapAddressing, i)
|
||||||
|
{
|
||||||
|
const labelList& localAddrs = mapAddressing[i];
|
||||||
|
|
||||||
|
if (!localAddrs.size())
|
||||||
|
{
|
||||||
|
f[i] = pif[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -171,7 +171,10 @@ surfaceInterpolationScheme<Type>::interpolate
|
|||||||
"(const GeometricField<Type, fvPatchField, volMesh>&, "
|
"(const GeometricField<Type, fvPatchField, volMesh>&, "
|
||||||
"const tmp<surfaceScalarField>&, "
|
"const tmp<surfaceScalarField>&, "
|
||||||
"const tmp<surfaceScalarField>&) : "
|
"const tmp<surfaceScalarField>&) : "
|
||||||
"interpolating volTypeField from cells to faces "
|
"interpolating "
|
||||||
|
<< vf.type() << " "
|
||||||
|
<< vf.name()
|
||||||
|
<< " from cells to faces "
|
||||||
"without explicit correction"
|
"without explicit correction"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -252,7 +255,10 @@ surfaceInterpolationScheme<Type>::interpolate
|
|||||||
Info<< "surfaceInterpolationScheme<Type>::interpolate"
|
Info<< "surfaceInterpolationScheme<Type>::interpolate"
|
||||||
"(const GeometricField<Type, fvPatchField, volMesh>&, "
|
"(const GeometricField<Type, fvPatchField, volMesh>&, "
|
||||||
"const tmp<surfaceScalarField>&) : "
|
"const tmp<surfaceScalarField>&) : "
|
||||||
"interpolating volTypeField from cells to faces "
|
"interpolating "
|
||||||
|
<< vf.type() << " "
|
||||||
|
<< vf.name()
|
||||||
|
<< " from cells to faces "
|
||||||
"without explicit correction"
|
"without explicit correction"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -326,7 +332,10 @@ surfaceInterpolationScheme<Type>::interpolate
|
|||||||
{
|
{
|
||||||
Info<< "surfaceInterpolationScheme<Type>::interpolate"
|
Info<< "surfaceInterpolationScheme<Type>::interpolate"
|
||||||
"(const GeometricField<Type, fvPatchField, volMesh>&) : "
|
"(const GeometricField<Type, fvPatchField, volMesh>&) : "
|
||||||
<< "interpolating volTypeField from cells to faces"
|
"interpolating "
|
||||||
|
<< vf.type() << " "
|
||||||
|
<< vf.name()
|
||||||
|
<< " from cells to faces"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -49,8 +49,8 @@ void faceZoneSet::updateSet()
|
|||||||
{
|
{
|
||||||
labelList order;
|
labelList order;
|
||||||
sortedOrder(addressing_, order);
|
sortedOrder(addressing_, order);
|
||||||
inplaceReorder(order, addressing_);
|
addressing_ = UIndirectList<label>(addressing_, order)();
|
||||||
inplaceReorder(order, flipMap_);
|
flipMap_ = UIndirectList<bool>(flipMap_, order)();
|
||||||
|
|
||||||
faceSet::clearStorage();
|
faceSet::clearStorage();
|
||||||
faceSet::resize(2*addressing_.size());
|
faceSet::resize(2*addressing_.size());
|
||||||
|
|||||||
@ -161,10 +161,13 @@ public:
|
|||||||
|
|
||||||
// Member operators
|
// Member operators
|
||||||
|
|
||||||
inline constTransport& operator=
|
inline constTransport& operator=(const constTransport&);
|
||||||
(
|
|
||||||
const constTransport&
|
inline void operator+=(const constTransport&);
|
||||||
);
|
|
||||||
|
inline void operator-=(const constTransport&);
|
||||||
|
|
||||||
|
inline void operator*=(const scalar);
|
||||||
|
|
||||||
|
|
||||||
// Friend operators
|
// Friend operators
|
||||||
|
|||||||
@ -143,6 +143,52 @@ inline Foam::constTransport<Thermo>& Foam::constTransport<Thermo>::operator=
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Thermo>
|
||||||
|
inline void Foam::constTransport<Thermo>::operator+=
|
||||||
|
(
|
||||||
|
const constTransport<Thermo>& st
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar molr1 = this->nMoles();
|
||||||
|
|
||||||
|
Thermo::operator+=(st);
|
||||||
|
|
||||||
|
molr1 /= this->nMoles();
|
||||||
|
scalar molr2 = st.nMoles()/this->nMoles();
|
||||||
|
|
||||||
|
mu_ = molr1*mu_ + molr2*st.mu_;
|
||||||
|
rPr_ = molr1*rPr_ + molr2*st.rPr_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Thermo>
|
||||||
|
inline void Foam::constTransport<Thermo>::operator-=
|
||||||
|
(
|
||||||
|
const constTransport<Thermo>& st
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar molr1 = this->nMoles();
|
||||||
|
|
||||||
|
Thermo::operator-=(st);
|
||||||
|
|
||||||
|
molr1 /= this->nMoles();
|
||||||
|
scalar molr2 = st.nMoles()/this->nMoles();
|
||||||
|
|
||||||
|
mu_ = molr1*mu_ - molr2*st.mu_;
|
||||||
|
rPr_ = molr1*rPr_ - molr2*st.rPr_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Thermo>
|
||||||
|
inline void Foam::constTransport<Thermo>::operator*=
|
||||||
|
(
|
||||||
|
const scalar s
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Thermo::operator*=(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Thermo>
|
template<class Thermo>
|
||||||
|
|||||||
@ -180,10 +180,13 @@ public:
|
|||||||
|
|
||||||
// Member operators
|
// Member operators
|
||||||
|
|
||||||
inline sutherlandTransport& operator=
|
inline sutherlandTransport& operator=(const sutherlandTransport&);
|
||||||
(
|
|
||||||
const sutherlandTransport&
|
inline void operator+=(const sutherlandTransport&);
|
||||||
);
|
|
||||||
|
inline void operator-=(const sutherlandTransport&);
|
||||||
|
|
||||||
|
inline void operator*=(const scalar);
|
||||||
|
|
||||||
|
|
||||||
// Friend operators
|
// Friend operators
|
||||||
|
|||||||
@ -180,6 +180,52 @@ Foam::sutherlandTransport<Thermo>::operator=
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Thermo>
|
||||||
|
inline void Foam::sutherlandTransport<Thermo>::operator+=
|
||||||
|
(
|
||||||
|
const sutherlandTransport<Thermo>& st
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar molr1 = this->nMoles();
|
||||||
|
|
||||||
|
Thermo::operator+=(st);
|
||||||
|
|
||||||
|
molr1 /= this->nMoles();
|
||||||
|
scalar molr2 = st.nMoles()/this->nMoles();
|
||||||
|
|
||||||
|
As_ = molr1*As_ + molr2*st.As_;
|
||||||
|
Ts_ = molr1*Ts_ + molr2*st.Ts_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Thermo>
|
||||||
|
inline void Foam::sutherlandTransport<Thermo>::operator-=
|
||||||
|
(
|
||||||
|
const sutherlandTransport<Thermo>& st
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar molr1 = this->nMoles();
|
||||||
|
|
||||||
|
Thermo::operator-=(st);
|
||||||
|
|
||||||
|
molr1 /= this->nMoles();
|
||||||
|
scalar molr2 = st.nMoles()/this->nMoles();
|
||||||
|
|
||||||
|
As_ = molr1*As_ - molr2*st.As_;
|
||||||
|
Ts_ = molr1*Ts_ - molr2*st.Ts_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Thermo>
|
||||||
|
inline void Foam::sutherlandTransport<Thermo>::operator*=
|
||||||
|
(
|
||||||
|
const scalar s
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Thermo::operator*=(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Thermo>
|
template<class Thermo>
|
||||||
|
|||||||
@ -55,7 +55,7 @@ int yyFlexLexer::yylex()
|
|||||||
// It is called by yylex but is not used as the mechanism to change file.
|
// It is called by yylex but is not used as the mechanism to change file.
|
||||||
// See <<EOF>>
|
// See <<EOF>>
|
||||||
//! \cond dummy
|
//! \cond dummy
|
||||||
#if YY_FLEX_SUBMINOR_VERSION < 34 || YY_FLEX_SUBMINOR_VERSION > 36
|
#if YY_FLEX_SUBMINOR_VERSION < 34
|
||||||
extern "C" int yywrap()
|
extern "C" int yywrap()
|
||||||
#else
|
#else
|
||||||
int yyFlexLexer::yywrap()
|
int yyFlexLexer::yywrap()
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -66,8 +66,12 @@ Foam::anisotropicFilter::anisotropicFilter
|
|||||||
coeff_.internalField().replace
|
coeff_.internalField().replace
|
||||||
(
|
(
|
||||||
d,
|
d,
|
||||||
(2.0/widthCoeff_)*mesh.V()
|
(1/widthCoeff_)*
|
||||||
/fvc::surfaceSum(mag(mesh.Sf().component(d)))().internalField()
|
sqr
|
||||||
|
(
|
||||||
|
2.0*mesh.V()
|
||||||
|
/fvc::surfaceSum(mag(mesh.Sf().component(d)))().internalField()
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,8 +103,12 @@ Foam::anisotropicFilter::anisotropicFilter
|
|||||||
coeff_.internalField().replace
|
coeff_.internalField().replace
|
||||||
(
|
(
|
||||||
d,
|
d,
|
||||||
(2.0/widthCoeff_)*mesh.V()
|
(1/widthCoeff_)*
|
||||||
/fvc::surfaceSum(mag(mesh.Sf().component(d)))().internalField()
|
sqr
|
||||||
|
(
|
||||||
|
2.0*mesh.V()
|
||||||
|
/fvc::surfaceSum(mag(mesh.Sf().component(d)))().internalField()
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -57,7 +57,7 @@ Foam::laplaceFilter::laplaceFilter(const fvMesh& mesh, scalar widthCoeff)
|
|||||||
calculatedFvPatchScalarField::typeName
|
calculatedFvPatchScalarField::typeName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
coeff_.internalField() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
|
coeff_.dimensionedInternalField() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ Foam::laplaceFilter::laplaceFilter(const fvMesh& mesh, const dictionary& bd)
|
|||||||
calculatedFvPatchScalarField::typeName
|
calculatedFvPatchScalarField::typeName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
coeff_.internalField() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
|
coeff_.dimensionedInternalField() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -66,7 +66,7 @@ volScalarField dynOneEqEddy::ck
|
|||||||
|
|
||||||
const volSymmTensorField MM
|
const volSymmTensorField MM
|
||||||
(
|
(
|
||||||
simpleFilter_(-2.0*delta()*pow(KK, 0.5)*filter_(D))
|
simpleFilter_(-2.0*delta()*sqrt(KK)*filter_(D))
|
||||||
);
|
);
|
||||||
|
|
||||||
const volScalarField ck
|
const volScalarField ck
|
||||||
|
|||||||
@ -27,14 +27,17 @@ gradSchemes
|
|||||||
|
|
||||||
divSchemes
|
divSchemes
|
||||||
{
|
{
|
||||||
div(rho*phi,U) Gauss upwind;
|
|
||||||
div(phi,alpha) Gauss vanLeer;
|
div(phi,alpha) Gauss vanLeer;
|
||||||
div(phirb,alpha) Gauss interfaceCompression 1;
|
div(phirb,alpha) Gauss interfaceCompression 1;
|
||||||
div(phid1,p_rgh) Gauss upwind;
|
|
||||||
div(phid2,p_rgh) Gauss upwind;
|
div(rho*phi,U) Gauss upwind;
|
||||||
|
div(phi,thermo:rhowater) Gauss upwind;
|
||||||
|
div(phi,thermo:rhoair) Gauss upwind;
|
||||||
div(rho*phi,T) Gauss upwind;
|
div(rho*phi,T) Gauss upwind;
|
||||||
div(rho*phi,K) Gauss upwind;
|
div(rho*phi,K) Gauss upwind;
|
||||||
div(phi,k) Gauss vanLeer;
|
div(phi,p) Gauss upwind;
|
||||||
|
div(phi,k) Gauss upwind;
|
||||||
|
|
||||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -103,9 +103,9 @@ solvers
|
|||||||
PIMPLE
|
PIMPLE
|
||||||
{
|
{
|
||||||
momentumPredictor no;
|
momentumPredictor no;
|
||||||
transSonic no;
|
transonic no;
|
||||||
nOuterCorrectors 3;
|
nOuterCorrectors 1;
|
||||||
nCorrectors 1;
|
nCorrectors 2;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 1;
|
nAlphaSubCycles 1;
|
||||||
|
|||||||
@ -1,59 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
| ========= | |
|
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
|
||||||
| \\ / O peration | Version: dev |
|
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
|
||||||
| \\/ M anipulation | |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object transportProperties;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
phases (water air);
|
|
||||||
|
|
||||||
water
|
|
||||||
{
|
|
||||||
transportModel Newtonian;
|
|
||||||
nu 1e-06;
|
|
||||||
rho 1000;
|
|
||||||
k 0; // 0.613;
|
|
||||||
Cv 4179;
|
|
||||||
|
|
||||||
equationOfState
|
|
||||||
{
|
|
||||||
type perfectFluid;
|
|
||||||
|
|
||||||
rho0 1000;
|
|
||||||
R 3000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
air
|
|
||||||
{
|
|
||||||
transportModel Newtonian;
|
|
||||||
nu 1.589e-05;
|
|
||||||
rho 1;
|
|
||||||
k 0; // 2.63e-2;
|
|
||||||
Cv 721;
|
|
||||||
|
|
||||||
equationOfState
|
|
||||||
{
|
|
||||||
type perfectFluid;
|
|
||||||
|
|
||||||
rho0 0;
|
|
||||||
R 287;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pMin pMin [ 1 -1 -2 0 0 0 0 ] 10000;
|
|
||||||
|
|
||||||
sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07;
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -27,14 +27,17 @@ gradSchemes
|
|||||||
|
|
||||||
divSchemes
|
divSchemes
|
||||||
{
|
{
|
||||||
div(rho*phi,U) Gauss upwind;
|
|
||||||
div(phi,alpha) Gauss vanLeer;
|
div(phi,alpha) Gauss vanLeer;
|
||||||
div(phirb,alpha) Gauss interfaceCompression 1;
|
div(phirb,alpha) Gauss interfaceCompression 1;
|
||||||
div(phid1,p_rgh) Gauss upwind;
|
|
||||||
div(phid2,p_rgh) Gauss upwind;
|
div(rho*phi,U) Gauss upwind;
|
||||||
|
div(phi,thermo:rhowater) Gauss upwind;
|
||||||
|
div(phi,thermo:rhoair) Gauss upwind;
|
||||||
div(rho*phi,T) Gauss upwind;
|
div(rho*phi,T) Gauss upwind;
|
||||||
div(rho*phi,K) Gauss upwind;
|
div(rho*phi,K) Gauss upwind;
|
||||||
div(phi,k) Gauss vanLeer;
|
div(phi,p) Gauss upwind;
|
||||||
|
div(phi,k) Gauss upwind;
|
||||||
|
|
||||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -103,9 +103,9 @@ solvers
|
|||||||
PIMPLE
|
PIMPLE
|
||||||
{
|
{
|
||||||
momentumPredictor no;
|
momentumPredictor no;
|
||||||
transSonic no;
|
transonic no;
|
||||||
nOuterCorrectors 3;
|
nOuterCorrectors 1;
|
||||||
nCorrectors 1;
|
nCorrectors 2;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 1;
|
nAlphaSubCycles 1;
|
||||||
|
|||||||
@ -29,6 +29,7 @@ boundaryField
|
|||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phiwater;
|
||||||
inletValue uniform 0.1;
|
inletValue uniform 0.1;
|
||||||
value uniform 0.1;
|
value uniform 0.1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,7 @@ boundaryField
|
|||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phiwater;
|
||||||
inletValue uniform 1e-8;
|
inletValue uniform 1e-8;
|
||||||
value uniform 1e-8;
|
value uniform 1e-8;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@ divSchemes
|
|||||||
"div\(alphaPhi.*,U.*\)" Gauss limitedLinearV 1;
|
"div\(alphaPhi.*,U.*\)" Gauss limitedLinearV 1;
|
||||||
"div\(phi.*,U.*\)" Gauss limitedLinearV 1;
|
"div\(phi.*,U.*\)" Gauss limitedLinearV 1;
|
||||||
"div\(\(alpha.*Rc\)\)" Gauss linear;
|
"div\(\(alpha.*Rc\)\)" Gauss linear;
|
||||||
"div\(phid.*,p\)" Gauss upwind;
|
"div\(phi.*,.*rho.*\)" Gauss linear;
|
||||||
|
|
||||||
"div\(alphaPhi.*,h.*\)" Gauss limitedLinear 1;
|
"div\(alphaPhi.*,h.*\)" Gauss limitedLinear 1;
|
||||||
"div\(alphaPhi.*,K.*\)" Gauss limitedLinear 1;
|
"div\(alphaPhi.*,K.*\)" Gauss limitedLinear 1;
|
||||||
|
|||||||
@ -31,6 +31,7 @@ boundaryField
|
|||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phi2;
|
||||||
inletValue uniform 10.0;
|
inletValue uniform 10.0;
|
||||||
value uniform 10.0;
|
value uniform 10.0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,7 @@ boundaryField
|
|||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phi2;
|
||||||
inletValue uniform 1.0;
|
inletValue uniform 1.0;
|
||||||
value uniform 1.0;
|
value uniform 1.0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@ divSchemes
|
|||||||
"div\(alphaPhi.,U.\)" Gauss limitedLinearV 1;
|
"div\(alphaPhi.,U.\)" Gauss limitedLinearV 1;
|
||||||
"div\(phi.,U.\)" Gauss limitedLinearV 1;
|
"div\(phi.,U.\)" Gauss limitedLinearV 1;
|
||||||
"div\(\(alpha.*Rc\)\)" Gauss linear;
|
"div\(\(alpha.*Rc\)\)" Gauss linear;
|
||||||
"div\(phid.,p\)" Gauss upwind;
|
"div\(phi.*,.*rho.*\)" Gauss linear;
|
||||||
|
|
||||||
"div\(alphaPhi.,(h|e).\)" Gauss limitedLinear 1;
|
"div\(alphaPhi.,(h|e).\)" Gauss limitedLinear 1;
|
||||||
"div\(alphaPhi.,(K.|p)\)" Gauss limitedLinear 1;
|
"div\(alphaPhi.,(K.|p)\)" Gauss limitedLinear 1;
|
||||||
|
|||||||
@ -35,7 +35,7 @@ divSchemes
|
|||||||
"div\(alphaPhi.,U.\)" Gauss limitedLinearV 1;
|
"div\(alphaPhi.,U.\)" Gauss limitedLinearV 1;
|
||||||
"div\(phi.,U.\)" Gauss limitedLinearV 1;
|
"div\(phi.,U.\)" Gauss limitedLinearV 1;
|
||||||
"div\(\(alpha.*Rc\)\)" Gauss linear;
|
"div\(\(alpha.*Rc\)\)" Gauss linear;
|
||||||
"div\(phid.,p\)" Gauss linear;
|
"div\(phi.*,.*rho.*\)" Gauss linear;
|
||||||
|
|
||||||
"div\(alphaPhi.,h.\)" Gauss limitedLinear 1;
|
"div\(alphaPhi.,h.\)" Gauss limitedLinear 1;
|
||||||
"div\(alphaPhi.,K.\)" Gauss limitedLinear 1;
|
"div\(alphaPhi.,K.\)" Gauss limitedLinear 1;
|
||||||
|
|||||||
@ -30,6 +30,7 @@ boundaryField
|
|||||||
top
|
top
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phi1;
|
||||||
inletValue uniform 1.0e-8;
|
inletValue uniform 1.0e-8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ boundaryField
|
|||||||
top
|
top
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phi2;
|
||||||
inletValue uniform 10.0;
|
inletValue uniform 10.0;
|
||||||
value uniform 10.0;
|
value uniform 10.0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,7 @@ boundaryField
|
|||||||
top
|
top
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phi2;
|
||||||
inletValue uniform 1.0;
|
inletValue uniform 1.0;
|
||||||
value uniform 1.0;
|
value uniform 1.0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,7 @@ boundaryField
|
|||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phi2;
|
||||||
inletValue uniform 10.0;
|
inletValue uniform 10.0;
|
||||||
value uniform 10.0;
|
value uniform 10.0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,7 @@ boundaryField
|
|||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phi2;
|
||||||
inletValue uniform 1.0;
|
inletValue uniform 1.0;
|
||||||
value uniform 1.0;
|
value uniform 1.0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,7 @@ boundaryField
|
|||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phi1;
|
||||||
inletValue uniform 1.0e-7;
|
inletValue uniform 1.0e-7;
|
||||||
value uniform 1.0e-7;
|
value uniform 1.0e-7;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,7 @@ boundaryField
|
|||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phi2;
|
||||||
inletValue uniform 0.1;
|
inletValue uniform 0.1;
|
||||||
value uniform 0.1;
|
value uniform 0.1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,7 @@ boundaryField
|
|||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
|
phi phi2;
|
||||||
inletValue uniform 1e-8;
|
inletValue uniform 1e-8;
|
||||||
value uniform 1e-8;
|
value uniform 1e-8;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user