Merge branch 'master' of github.com:OpenFOAM/OpenFOAM-2.3.x
This commit is contained in:
commit
22d5b76bfa
39 changed files with 714 additions and 145 deletions
|
|
@ -19,6 +19,16 @@ fvOptions.makeRelative(phiHbyA);
|
||||||
|
|
||||||
adjustPhi(phiHbyA, U, p);
|
adjustPhi(phiHbyA, U, p);
|
||||||
|
|
||||||
|
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||||
|
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p.boundaryField(),
|
||||||
|
(
|
||||||
|
phiHbyA.boundaryField()
|
||||||
|
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||||
|
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||||
|
);
|
||||||
|
|
||||||
// Non-orthogonal pressure corrector loop
|
// Non-orthogonal pressure corrector loop
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ Description
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
#include "IOporosityModelList.H"
|
#include "IOporosityModelList.H"
|
||||||
#include "IOMRFZoneList.H"
|
#include "IOMRFZoneList.H"
|
||||||
|
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,11 +138,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const
|
||||||
(
|
(
|
||||||
pair_.rho()
|
pair_.rho()
|
||||||
*pair_.magUr()
|
*pair_.magUr()
|
||||||
/(
|
/(magGradI*muI)
|
||||||
magGradI
|
|
||||||
*max(alpha1*alpha2, sqr(residualAlpha_))
|
|
||||||
*muI
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
volScalarField lambda(m_*ReI + n_*muAlphaI/muI);
|
volScalarField lambda(m_*ReI + n_*muAlphaI/muI);
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,34 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
|
||||||
),
|
),
|
||||||
U.mesh(),
|
U.mesh(),
|
||||||
dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0)
|
dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0)
|
||||||
|
),
|
||||||
|
|
||||||
|
gs0_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName("gs0", phase.name()),
|
||||||
|
U.time().timeName(),
|
||||||
|
U.mesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
U.mesh(),
|
||||||
|
dimensionedScalar("zero", dimensionSet(0, 0, 0, 0, 0), 0.0)
|
||||||
|
),
|
||||||
|
|
||||||
|
kappa_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
IOobject::groupName("kappa", phase.name()),
|
||||||
|
U.time().timeName(),
|
||||||
|
U.mesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
U.mesh(),
|
||||||
|
dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (type == typeName)
|
if (type == typeName)
|
||||||
|
|
@ -371,17 +399,17 @@ void Foam::RASModels::kineticTheoryModel::correct()
|
||||||
volSymmTensorField D(symm(gradU));
|
volSymmTensorField D(symm(gradU));
|
||||||
|
|
||||||
// Calculating the radial distribution function
|
// Calculating the radial distribution function
|
||||||
volScalarField gs0(radialModel_->g0(alpha, alphaMinFriction_, alphaMax_));
|
gs0_ = radialModel_->g0(alpha, alphaMinFriction_, alphaMax_);
|
||||||
|
|
||||||
if (!equilibrium_)
|
if (!equilibrium_)
|
||||||
{
|
{
|
||||||
// particle viscosity (Table 3.2, p.47)
|
// particle viscosity (Table 3.2, p.47)
|
||||||
nut_ = viscosityModel_->nu(alpha, Theta_, gs0, rho, da, e_);
|
nut_ = viscosityModel_->nu(alpha, Theta_, gs0_, rho, da, e_);
|
||||||
|
|
||||||
volScalarField ThetaSqrt(sqrt(Theta_));
|
volScalarField ThetaSqrt(sqrt(Theta_));
|
||||||
|
|
||||||
// Bulk viscosity p. 45 (Lun et al. 1984).
|
// Bulk viscosity p. 45 (Lun et al. 1984).
|
||||||
lambda_ = (4.0/3.0)*sqr(alpha)*da*gs0*(1.0 + e_)*ThetaSqrt/sqrtPi;
|
lambda_ = (4.0/3.0)*sqr(alpha)*da*gs0_*(1.0 + e_)*ThetaSqrt/sqrtPi;
|
||||||
|
|
||||||
// Stress tensor, Definitions, Table 3.1, p. 43
|
// Stress tensor, Definitions, Table 3.1, p. 43
|
||||||
volSymmTensorField tau(2.0*nut_*D + (lambda_ - (2.0/3.0)*nut_)*tr(D)*I);
|
volSymmTensorField tau(2.0*nut_*D + (lambda_ - (2.0/3.0)*nut_)*tr(D)*I);
|
||||||
|
|
@ -391,7 +419,7 @@ void Foam::RASModels::kineticTheoryModel::correct()
|
||||||
(
|
(
|
||||||
12.0*(1.0 - sqr(e_))
|
12.0*(1.0 - sqr(e_))
|
||||||
*max(sqr(alpha), residualAlpha_)
|
*max(sqr(alpha), residualAlpha_)
|
||||||
*gs0*(1.0/da)*ThetaSqrt/sqrtPi
|
*gs0_*(1.0/da)*ThetaSqrt/sqrtPi
|
||||||
);
|
);
|
||||||
|
|
||||||
// NB, drag = K*alpha*alpha2,
|
// NB, drag = K*alpha*alpha2,
|
||||||
|
|
@ -426,17 +454,14 @@ void Foam::RASModels::kineticTheoryModel::correct()
|
||||||
granularPressureModel_->granularPressureCoeff
|
granularPressureModel_->granularPressureCoeff
|
||||||
(
|
(
|
||||||
alpha,
|
alpha,
|
||||||
gs0,
|
gs0_,
|
||||||
rho,
|
rho,
|
||||||
e_
|
e_
|
||||||
)/rho
|
)/rho
|
||||||
);
|
);
|
||||||
|
|
||||||
// 'thermal' conductivity (Table 3.3, p. 49)
|
// 'thermal' conductivity (Table 3.3, p. 49)
|
||||||
volScalarField kappa
|
kappa_ = conductivityModel_->kappa(alpha, Theta_, gs0_, rho, da, e_);
|
||||||
(
|
|
||||||
conductivityModel_->kappa(alpha, Theta_, gs0, rho, da, e_)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Construct the granular temperature equation (Eq. 3.20, p. 44)
|
// Construct the granular temperature equation (Eq. 3.20, p. 44)
|
||||||
// NB. note that there are two typos in Eq. 3.20:
|
// NB. note that there are two typos in Eq. 3.20:
|
||||||
|
|
@ -450,7 +475,7 @@ void Foam::RASModels::kineticTheoryModel::correct()
|
||||||
+ fvm::div(alphaPhi, Theta_)
|
+ fvm::div(alphaPhi, Theta_)
|
||||||
- fvc::Sp(fvc::ddt(alpha) + fvc::div(alphaPhi), Theta_)
|
- fvc::Sp(fvc::ddt(alpha) + fvc::div(alphaPhi), Theta_)
|
||||||
)
|
)
|
||||||
- fvm::laplacian(kappa, Theta_, "laplacian(kappa, Theta)")
|
- fvm::laplacian(kappa_, Theta_, "laplacian(kappa, Theta)")
|
||||||
==
|
==
|
||||||
fvm::SuSp(-((PsCoeff*I) && gradU), Theta_)
|
fvm::SuSp(-((PsCoeff*I) && gradU), Theta_)
|
||||||
+ (tau && gradU)
|
+ (tau && gradU)
|
||||||
|
|
@ -466,23 +491,23 @@ void Foam::RASModels::kineticTheoryModel::correct()
|
||||||
{
|
{
|
||||||
// Equilibrium => dissipation == production
|
// Equilibrium => dissipation == production
|
||||||
// Eq. 4.14, p.82
|
// Eq. 4.14, p.82
|
||||||
volScalarField K1(2.0*(1.0 + e_)*rho*gs0);
|
volScalarField K1(2.0*(1.0 + e_)*rho*gs0_);
|
||||||
volScalarField K3
|
volScalarField K3
|
||||||
(
|
(
|
||||||
0.5*da*rho*
|
0.5*da*rho*
|
||||||
(
|
(
|
||||||
(sqrtPi/(3.0*(3.0-e_)))
|
(sqrtPi/(3.0*(3.0-e_)))
|
||||||
*(1.0 + 0.4*(1.0 + e_)*(3.0*e_ - 1.0)*alpha*gs0)
|
*(1.0 + 0.4*(1.0 + e_)*(3.0*e_ - 1.0)*alpha*gs0_)
|
||||||
+1.6*alpha*gs0*(1.0 + e_)/sqrtPi
|
+1.6*alpha*gs0_*(1.0 + e_)/sqrtPi
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
volScalarField K2
|
volScalarField K2
|
||||||
(
|
(
|
||||||
4.0*da*rho*(1.0 + e_)*alpha*gs0/(3.0*sqrtPi) - 2.0*K3/3.0
|
4.0*da*rho*(1.0 + e_)*alpha*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0
|
||||||
);
|
);
|
||||||
|
|
||||||
volScalarField K4(12.0*(1.0 - sqr(e_))*rho*gs0/(da*sqrtPi));
|
volScalarField K4(12.0*(1.0 - sqr(e_))*rho*gs0_/(da*sqrtPi));
|
||||||
|
|
||||||
volScalarField trD
|
volScalarField trD
|
||||||
(
|
(
|
||||||
|
|
@ -508,6 +533,8 @@ void Foam::RASModels::kineticTheoryModel::correct()
|
||||||
(l1 + sqrt(l2 + l3))
|
(l1 + sqrt(l2 + l3))
|
||||||
/(2.0*max(alpha, residualAlpha_)*K4)
|
/(2.0*max(alpha, residualAlpha_)*K4)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
kappa_ = conductivityModel_->kappa(alpha, Theta_, gs0_, rho, da, e_);
|
||||||
}
|
}
|
||||||
|
|
||||||
Theta_.max(0);
|
Theta_.max(0);
|
||||||
|
|
@ -515,12 +542,12 @@ void Foam::RASModels::kineticTheoryModel::correct()
|
||||||
|
|
||||||
{
|
{
|
||||||
// particle viscosity (Table 3.2, p.47)
|
// particle viscosity (Table 3.2, p.47)
|
||||||
nut_ = viscosityModel_->nu(alpha, Theta_, gs0, rho, da, e_);
|
nut_ = viscosityModel_->nu(alpha, Theta_, gs0_, rho, da, e_);
|
||||||
|
|
||||||
volScalarField ThetaSqrt(sqrt(Theta_));
|
volScalarField ThetaSqrt(sqrt(Theta_));
|
||||||
|
|
||||||
// Bulk viscosity p. 45 (Lun et al. 1984).
|
// Bulk viscosity p. 45 (Lun et al. 1984).
|
||||||
lambda_ = (4.0/3.0)*sqr(alpha)*da*gs0*(1.0 + e_)*ThetaSqrt/sqrtPi;
|
lambda_ = (4.0/3.0)*sqr(alpha)*da*gs0_*(1.0 + e_)*ThetaSqrt/sqrtPi;
|
||||||
|
|
||||||
// Frictional pressure
|
// Frictional pressure
|
||||||
volScalarField pf
|
volScalarField pf
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,12 @@ class kineticTheoryModel
|
||||||
//- The granular bulk viscosity
|
//- The granular bulk viscosity
|
||||||
volScalarField lambda_;
|
volScalarField lambda_;
|
||||||
|
|
||||||
|
//- The granular radial distribution
|
||||||
|
volScalarField gs0_;
|
||||||
|
|
||||||
|
//- The granular "thermal" conductivity
|
||||||
|
volScalarField kappa_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ tmp<volScalarField> NicenoKEqn<BasicTurbulenceModel>::bubbleG() const
|
||||||
|
|
||||||
tmp<volScalarField> bubbleG
|
tmp<volScalarField> bubbleG
|
||||||
(
|
(
|
||||||
Cp_*gas*sqr(magUr)*fluid.drag(gas).K()/liquid.rho()
|
Cp_*sqr(magUr)*fluid.drag(gas).K()/liquid.rho()
|
||||||
);
|
);
|
||||||
|
|
||||||
return bubbleG;
|
return bubbleG;
|
||||||
|
|
|
||||||
|
|
@ -194,9 +194,10 @@ tmp<volScalarField> LaheyKEpsilon<BasicTurbulenceModel>::bubbleG() const
|
||||||
tmp<volScalarField> bubbleG
|
tmp<volScalarField> bubbleG
|
||||||
(
|
(
|
||||||
Cp_
|
Cp_
|
||||||
|
*liquid*liquid.rho()
|
||||||
*(
|
*(
|
||||||
pow3(magUr)
|
pow3(magUr)
|
||||||
+ pow(fluid.drag(gas).K()*gas.d()/liquid.rho(), 4.0/3.0)
|
+ pow(fluid.drag(gas).CdRe()*liquid.nu()/gas.d(), 4.0/3.0)
|
||||||
*pow(magUr, 5.0/3.0)
|
*pow(magUr, 5.0/3.0)
|
||||||
)
|
)
|
||||||
*gas
|
*gas
|
||||||
|
|
|
||||||
|
|
@ -380,7 +380,7 @@ tmp<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::Ct2() const
|
||||||
volScalarField beta
|
volScalarField beta
|
||||||
(
|
(
|
||||||
(6*this->Cmu_/(4*sqrt(3.0/2.0)))
|
(6*this->Cmu_/(4*sqrt(3.0/2.0)))
|
||||||
*alphag*fluid.drag(gas).K()/liquid.rho()
|
*fluid.drag(gas).K()/liquid.rho()
|
||||||
*(liquidTurbulence.k_/liquidTurbulence.epsilon_)
|
*(liquidTurbulence.k_/liquidTurbulence.epsilon_)
|
||||||
);
|
);
|
||||||
volScalarField Ct0((3 + beta)/(1 + beta + 2*gas.rho()/liquid.rho()));
|
volScalarField Ct0((3 + beta)/(1 + beta + 2*gas.rho()/liquid.rho()));
|
||||||
|
|
@ -488,10 +488,10 @@ tmp<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::bubbleG() const
|
||||||
tmp<volScalarField> bubbleG
|
tmp<volScalarField> bubbleG
|
||||||
(
|
(
|
||||||
Cp_
|
Cp_
|
||||||
*sqr(liquid)*liquid.rho()
|
*liquid*liquid.rho()
|
||||||
*(
|
*(
|
||||||
pow3(magUr)
|
pow3(magUr)
|
||||||
+ pow(fluid.drag(gas).K()*gas.d()/liquid.rho(), 4.0/3.0)
|
+ pow(fluid.drag(gas).CdRe()*liquid.nu()/gas.d(), 4.0/3.0)
|
||||||
*pow(magUr, 5.0/3.0)
|
*pow(magUr, 5.0/3.0)
|
||||||
)
|
)
|
||||||
*gas
|
*gas
|
||||||
|
|
@ -501,7 +501,7 @@ tmp<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::bubbleG() const
|
||||||
// Simple model
|
// Simple model
|
||||||
// tmp<volScalarField> bubbleG
|
// tmp<volScalarField> bubbleG
|
||||||
// (
|
// (
|
||||||
// Cp_*sqr(liquid)*gas*fluid.drag(gas).K()*sqr(magUr)
|
// Cp_*liquid*fluid.drag(gas).K()*sqr(magUr)
|
||||||
// );
|
// );
|
||||||
|
|
||||||
return bubbleG;
|
return bubbleG;
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,7 @@ $(derivedFvPatchFields)/pressureInletOutletVelocity/pressureInletOutletVelocityF
|
||||||
$(derivedFvPatchFields)/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C
|
||||||
$(derivedFvPatchFields)/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C
|
||||||
$(derivedFvPatchFields)/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C
|
||||||
|
$(derivedFvPatchFields)/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C
|
||||||
$(derivedFvPatchFields)/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
|
||||||
$(derivedFvPatchFields)/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
|
$(derivedFvPatchFields)/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
|
||||||
$(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@ SourceFiles
|
||||||
|
|
||||||
#include "fvPatchFields.H"
|
#include "fvPatchFields.H"
|
||||||
#include "fixedGradientFvPatchFields.H"
|
#include "fixedGradientFvPatchFields.H"
|
||||||
#include "Switch.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,218 @@
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2014 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 "fixedNormalInletOutletVelocityFvPatchVectorField.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "surfaceFields.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
directionMixedFvPatchVectorField(p, iF),
|
||||||
|
phiName_("phi"),
|
||||||
|
fixTangentialInflow_(true),
|
||||||
|
normalVelocity_
|
||||||
|
(
|
||||||
|
fvPatchVectorField::New("fixedValue", p, iF)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
refValue() = vector::zero;
|
||||||
|
refGrad() = vector::zero;
|
||||||
|
valueFraction() = symmTensor::zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedNormalInletOutletVelocityFvPatchVectorField& ptf,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
|
const fvPatchFieldMapper& mapper
|
||||||
|
)
|
||||||
|
:
|
||||||
|
directionMixedFvPatchVectorField(ptf, p, iF, mapper),
|
||||||
|
phiName_(ptf.phiName_),
|
||||||
|
fixTangentialInflow_(ptf.fixTangentialInflow_),
|
||||||
|
normalVelocity_
|
||||||
|
(
|
||||||
|
fvPatchVectorField::New(ptf.normalVelocity(), p, iF, mapper)
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
directionMixedFvPatchVectorField(p, iF),
|
||||||
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
|
fixTangentialInflow_(dict.lookup("fixTangentialInflow")),
|
||||||
|
normalVelocity_
|
||||||
|
(
|
||||||
|
fvPatchVectorField::New(p, iF, dict.subDict("normalVelocity"))
|
||||||
|
)
|
||||||
|
{
|
||||||
|
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||||
|
refValue() = normalVelocity();
|
||||||
|
refGrad() = vector::zero;
|
||||||
|
valueFraction() = symmTensor::zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedNormalInletOutletVelocityFvPatchVectorField& pivpvf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
directionMixedFvPatchVectorField(pivpvf),
|
||||||
|
phiName_(pivpvf.phiName_),
|
||||||
|
fixTangentialInflow_(pivpvf.fixTangentialInflow_),
|
||||||
|
normalVelocity_(pivpvf.normalVelocity().clone())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedNormalInletOutletVelocityFvPatchVectorField& pivpvf,
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
directionMixedFvPatchVectorField(pivpvf, iF),
|
||||||
|
phiName_(pivpvf.phiName_),
|
||||||
|
fixTangentialInflow_(pivpvf.fixTangentialInflow_),
|
||||||
|
normalVelocity_(pivpvf.normalVelocity().clone())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fixedNormalInletOutletVelocityFvPatchVectorField::autoMap
|
||||||
|
(
|
||||||
|
const fvPatchFieldMapper& m
|
||||||
|
)
|
||||||
|
{
|
||||||
|
directionMixedFvPatchVectorField::autoMap(m);
|
||||||
|
normalVelocity_->autoMap(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fixedNormalInletOutletVelocityFvPatchVectorField::rmap
|
||||||
|
(
|
||||||
|
const fvPatchVectorField& ptf,
|
||||||
|
const labelList& addr
|
||||||
|
)
|
||||||
|
{
|
||||||
|
directionMixedFvPatchVectorField::rmap(ptf, addr);
|
||||||
|
|
||||||
|
const fixedNormalInletOutletVelocityFvPatchVectorField& fniovptf =
|
||||||
|
refCast<const fixedNormalInletOutletVelocityFvPatchVectorField>(ptf);
|
||||||
|
|
||||||
|
normalVelocity_->rmap(fniovptf.normalVelocity(), addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fixedNormalInletOutletVelocityFvPatchVectorField::updateCoeffs()
|
||||||
|
{
|
||||||
|
if (updated())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
normalVelocity_->evaluate();
|
||||||
|
refValue() = normalVelocity();
|
||||||
|
|
||||||
|
valueFraction() = sqr(patch().nf());
|
||||||
|
|
||||||
|
if (fixTangentialInflow_)
|
||||||
|
{
|
||||||
|
const fvsPatchField<scalar>& phip =
|
||||||
|
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||||
|
|
||||||
|
valueFraction() += neg(phip)*(I - valueFraction());
|
||||||
|
}
|
||||||
|
|
||||||
|
directionMixedFvPatchVectorField::updateCoeffs();
|
||||||
|
directionMixedFvPatchVectorField::evaluate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fixedNormalInletOutletVelocityFvPatchVectorField::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
)
|
||||||
|
const
|
||||||
|
{
|
||||||
|
fvPatchVectorField::write(os);
|
||||||
|
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||||
|
os.writeKeyword("fixTangentialInflow")
|
||||||
|
<< fixTangentialInflow_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("normalVelocity")
|
||||||
|
<< nl << indent << token::BEGIN_BLOCK << nl << incrIndent;
|
||||||
|
normalVelocity_->write(os);
|
||||||
|
os << decrIndent << indent << token::END_BLOCK << endl;
|
||||||
|
writeEntry("value", os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fixedNormalInletOutletVelocityFvPatchVectorField::operator=
|
||||||
|
(
|
||||||
|
const fvPatchField<vector>& pvf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<vectorField> normalValue = transform(valueFraction(), refValue());
|
||||||
|
tmp<vectorField> transformGradValue = transform(I - valueFraction(), pvf);
|
||||||
|
fvPatchField<vector>::operator=(normalValue + transformGradValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
makePatchTypeField
|
||||||
|
(
|
||||||
|
fvPatchVectorField,
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
|
|
@ -0,0 +1,248 @@
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2014 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::fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpInletletBoundaryConditions grpOutletBoundaryConditions
|
||||||
|
|
||||||
|
Description
|
||||||
|
|
||||||
|
This velocity inlet/outlet boundary condition combines a fixed normal
|
||||||
|
component obtained from the "normalVelocity" patchField supplied with a
|
||||||
|
fixed or zero-gradiented tangential component depending on the direction
|
||||||
|
of the flow and the setting of "fixTangentialInflow":
|
||||||
|
- Outflow: apply zero-gradient condition to tangential components
|
||||||
|
- Inflow:
|
||||||
|
- fixTangentialInflow is true
|
||||||
|
apply value provided by the normalVelocity patchField to the
|
||||||
|
tangential components
|
||||||
|
- fixTangentialInflow is false
|
||||||
|
apply zero-gradient condition to tangential components.
|
||||||
|
|
||||||
|
\heading Patch usage
|
||||||
|
|
||||||
|
\table
|
||||||
|
Property | Description | Required | Default value
|
||||||
|
phi | flux field name | no | phi
|
||||||
|
fixTangentialInflow | If true fix the tangential component for inflow | yes |
|
||||||
|
normalVelocity | patchField providing the normal velocity field | yes |
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
Example of the boundary condition specification:
|
||||||
|
\verbatim
|
||||||
|
myPatch
|
||||||
|
{
|
||||||
|
type fixedNormalInletOutletVelocity;
|
||||||
|
|
||||||
|
fixTangentialInflow false;
|
||||||
|
normalVelocity
|
||||||
|
{
|
||||||
|
type oscillatingFixedValue;
|
||||||
|
refValue uniform (0 1 0);
|
||||||
|
offset (0 -1 0);
|
||||||
|
amplitude table
|
||||||
|
(
|
||||||
|
( 0 0)
|
||||||
|
( 2 0.088)
|
||||||
|
( 8 0.088)
|
||||||
|
);
|
||||||
|
frequency constant 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef fixedNormalInletOutletVelocityFvPatchVectorField_H
|
||||||
|
#define fixedNormalInletOutletVelocityFvPatchVectorField_H
|
||||||
|
|
||||||
|
#include "fvPatchFields.H"
|
||||||
|
#include "directionMixedFvPatchFields.H"
|
||||||
|
#include "Switch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class fixedNormalInletOutletVelocityFvPatchVectorField Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
:
|
||||||
|
public directionMixedFvPatchVectorField
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Flux field name
|
||||||
|
word phiName_;
|
||||||
|
|
||||||
|
//- Set true to fix the tangential component for inflow
|
||||||
|
Switch fixTangentialInflow_;
|
||||||
|
|
||||||
|
//- BC which provided the normal component of the velocity
|
||||||
|
tmp<fvPatchVectorField> normalVelocity_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("fixedNormalInletOutletVelocity");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from patch and internal field
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from patch, internal field and dictionary
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&,
|
||||||
|
const dictionary&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct by mapping given
|
||||||
|
// fixedNormalInletOutletVelocityFvPatchVectorField onto a new patch
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedNormalInletOutletVelocityFvPatchVectorField&,
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&,
|
||||||
|
const fvPatchFieldMapper&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct as copy
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedNormalInletOutletVelocityFvPatchVectorField&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual tmp<fvPatchVectorField> clone() const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchVectorField>
|
||||||
|
(
|
||||||
|
new fixedNormalInletOutletVelocityFvPatchVectorField(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Construct as copy setting internal field reference
|
||||||
|
fixedNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedNormalInletOutletVelocityFvPatchVectorField&,
|
||||||
|
const DimensionedField<vector, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone setting internal field reference
|
||||||
|
virtual tmp<fvPatchVectorField> clone
|
||||||
|
(
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchVectorField>
|
||||||
|
(
|
||||||
|
new fixedNormalInletOutletVelocityFvPatchVectorField(*this, iF)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return the name of phi
|
||||||
|
const word& phiName() const
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return reference to the name of phi to allow adjustment
|
||||||
|
word& phiName()
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
Switch fixTangentialInflow() const
|
||||||
|
{
|
||||||
|
return fixTangentialInflow_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the BC which provides the normal component of velocity
|
||||||
|
const fvPatchVectorField& normalVelocity() const
|
||||||
|
{
|
||||||
|
return normalVelocity_();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Mapping functions
|
||||||
|
|
||||||
|
//- Map (and resize as needed) from self given a mapping object
|
||||||
|
virtual void autoMap
|
||||||
|
(
|
||||||
|
const fvPatchFieldMapper&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Reverse map the given fvPatchField onto this fvPatchField
|
||||||
|
virtual void rmap
|
||||||
|
(
|
||||||
|
const fvPatchVectorField&,
|
||||||
|
const labelList&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Update the coefficients associated with the patch field
|
||||||
|
virtual void updateCoeffs();
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member operators
|
||||||
|
|
||||||
|
virtual void operator=(const fvPatchField<vector>& pvf);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#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-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -57,7 +57,7 @@ Foam::displacementSBRStressFvMotionSolver::displacementSBRStressFvMotionSolver
|
||||||
const IOdictionary& dict
|
const IOdictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
displacementMotionSolver(mesh, dict, typeName),
|
displacementMotionSolver(mesh, dict, dict.lookup("solver")),
|
||||||
fvMotionSolverCore(mesh),
|
fvMotionSolverCore(mesh),
|
||||||
cellDisplacement_
|
cellDisplacement_
|
||||||
(
|
(
|
||||||
|
|
|
||||||
|
|
@ -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-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -111,6 +111,12 @@ public:
|
||||||
return cellDisplacement_;
|
return cellDisplacement_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return diffusivity
|
||||||
|
motionDiffusivity& diffusivity()
|
||||||
|
{
|
||||||
|
return diffusivityPtr_();
|
||||||
|
}
|
||||||
|
|
||||||
//- Return point location obtained from the current motion field
|
//- Return point location obtained from the current motion field
|
||||||
virtual tmp<pointField> curPoints() const;
|
virtual tmp<pointField> curPoints() const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -206,32 +206,40 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Normalise the weights
|
// Normalise the weights
|
||||||
wghtSum.setSize(wght.size());
|
wghtSum.setSize(wght.size(), 0.0);
|
||||||
label nLowWeight = 0;
|
label nLowWeight = 0;
|
||||||
|
|
||||||
forAll(wght, faceI)
|
forAll(wght, faceI)
|
||||||
{
|
{
|
||||||
scalarList& w = wght[faceI];
|
scalarList& w = wght[faceI];
|
||||||
scalar denom = patchAreas[faceI];
|
|
||||||
|
|
||||||
scalar s = sum(w);
|
if (w.size())
|
||||||
scalar t = s/denom;
|
|
||||||
|
|
||||||
if (conformal)
|
|
||||||
{
|
{
|
||||||
denom = s;
|
scalar denom = patchAreas[faceI];
|
||||||
|
|
||||||
|
scalar s = sum(w);
|
||||||
|
scalar t = s/denom;
|
||||||
|
|
||||||
|
if (conformal)
|
||||||
|
{
|
||||||
|
denom = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(w, i)
|
||||||
|
{
|
||||||
|
w[i] /= denom;
|
||||||
|
}
|
||||||
|
|
||||||
|
wghtSum[faceI] = t;
|
||||||
|
|
||||||
|
if (t < lowWeightTol)
|
||||||
|
{
|
||||||
|
nLowWeight++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
forAll(w, i)
|
|
||||||
{
|
{
|
||||||
w[i] /= denom;
|
wghtSum[faceI] = 0;
|
||||||
}
|
|
||||||
|
|
||||||
wghtSum[faceI] = t;
|
|
||||||
|
|
||||||
if (t < lowWeightTol)
|
|
||||||
{
|
|
||||||
nLowWeight++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -534,6 +542,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
|
||||||
const SourcePatch& srcPatch,
|
const SourcePatch& srcPatch,
|
||||||
const TargetPatch& tgtPatch,
|
const TargetPatch& tgtPatch,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
|
const bool requireMatch,
|
||||||
const interpolationMethod& method,
|
const interpolationMethod& method,
|
||||||
const scalar lowWeightCorrection,
|
const scalar lowWeightCorrection,
|
||||||
const bool reverseTarget
|
const bool reverseTarget
|
||||||
|
|
@ -541,6 +550,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
|
||||||
:
|
:
|
||||||
method_(method),
|
method_(method),
|
||||||
reverseTarget_(reverseTarget),
|
reverseTarget_(reverseTarget),
|
||||||
|
requireMatch_(requireMatch),
|
||||||
singlePatchProc_(-999),
|
singlePatchProc_(-999),
|
||||||
lowWeightCorrection_(lowWeightCorrection),
|
lowWeightCorrection_(lowWeightCorrection),
|
||||||
srcAddress_(),
|
srcAddress_(),
|
||||||
|
|
@ -564,6 +574,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
|
||||||
const TargetPatch& tgtPatch,
|
const TargetPatch& tgtPatch,
|
||||||
const autoPtr<searchableSurface>& surfPtr,
|
const autoPtr<searchableSurface>& surfPtr,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
|
const bool requireMatch,
|
||||||
const interpolationMethod& method,
|
const interpolationMethod& method,
|
||||||
const scalar lowWeightCorrection,
|
const scalar lowWeightCorrection,
|
||||||
const bool reverseTarget
|
const bool reverseTarget
|
||||||
|
|
@ -571,6 +582,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
|
||||||
:
|
:
|
||||||
method_(method),
|
method_(method),
|
||||||
reverseTarget_(reverseTarget),
|
reverseTarget_(reverseTarget),
|
||||||
|
requireMatch_(requireMatch),
|
||||||
singlePatchProc_(-999),
|
singlePatchProc_(-999),
|
||||||
lowWeightCorrection_(lowWeightCorrection),
|
lowWeightCorrection_(lowWeightCorrection),
|
||||||
srcAddress_(),
|
srcAddress_(),
|
||||||
|
|
@ -654,6 +666,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
|
||||||
:
|
:
|
||||||
method_(fineAMI.method_),
|
method_(fineAMI.method_),
|
||||||
reverseTarget_(fineAMI.reverseTarget_),
|
reverseTarget_(fineAMI.reverseTarget_),
|
||||||
|
requireMatch_(fineAMI.requireMatch_),
|
||||||
singlePatchProc_(fineAMI.singlePatchProc_),
|
singlePatchProc_(fineAMI.singlePatchProc_),
|
||||||
lowWeightCorrection_(-1.0),
|
lowWeightCorrection_(-1.0),
|
||||||
srcAddress_(),
|
srcAddress_(),
|
||||||
|
|
@ -862,7 +875,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
|
||||||
srcMagSf_,
|
srcMagSf_,
|
||||||
tgtMagSf_,
|
tgtMagSf_,
|
||||||
triMode_,
|
triMode_,
|
||||||
reverseTarget_
|
reverseTarget_,
|
||||||
|
requireMatch_
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -978,7 +992,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
|
||||||
srcMagSf_,
|
srcMagSf_,
|
||||||
tgtMagSf_,
|
tgtMagSf_,
|
||||||
triMode_,
|
triMode_,
|
||||||
reverseTarget_
|
reverseTarget_,
|
||||||
|
requireMatch_
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,10 @@ private:
|
||||||
// that the orientation of the target patch should be reversed
|
// that the orientation of the target patch should be reversed
|
||||||
const bool reverseTarget_;
|
const bool reverseTarget_;
|
||||||
|
|
||||||
|
//- Flag to indicate that the two patches must be matched/an overlap
|
||||||
|
// exists between them
|
||||||
|
const bool requireMatch_;
|
||||||
|
|
||||||
//- Index of processor that holds all of both sides. -1 in all other
|
//- Index of processor that holds all of both sides. -1 in all other
|
||||||
// cases
|
// cases
|
||||||
label singlePatchProc_;
|
label singlePatchProc_;
|
||||||
|
|
@ -276,6 +280,7 @@ public:
|
||||||
const SourcePatch& srcPatch,
|
const SourcePatch& srcPatch,
|
||||||
const TargetPatch& tgtPatch,
|
const TargetPatch& tgtPatch,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
|
const bool requireMatch = true,
|
||||||
const interpolationMethod& method = imFaceAreaWeight,
|
const interpolationMethod& method = imFaceAreaWeight,
|
||||||
const scalar lowWeightCorrection = -1,
|
const scalar lowWeightCorrection = -1,
|
||||||
const bool reverseTarget = false
|
const bool reverseTarget = false
|
||||||
|
|
@ -288,6 +293,7 @@ public:
|
||||||
const TargetPatch& tgtPatch,
|
const TargetPatch& tgtPatch,
|
||||||
const autoPtr<searchableSurface>& surf,
|
const autoPtr<searchableSurface>& surf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
|
const bool requireMatch = true,
|
||||||
const interpolationMethod& method = imFaceAreaWeight,
|
const interpolationMethod& method = imFaceAreaWeight,
|
||||||
const scalar lowWeightCorrection = -1,
|
const scalar lowWeightCorrection = -1,
|
||||||
const bool reverseTarget = false
|
const bool reverseTarget = false
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,10 @@ bool Foam::AMIMethod<SourcePatch, TargetPatch>::initialise
|
||||||
(
|
(
|
||||||
"void Foam::AMIMethod<SourcePatch, TargetPatch>::initialise"
|
"void Foam::AMIMethod<SourcePatch, TargetPatch>::initialise"
|
||||||
"("
|
"("
|
||||||
|
"labelListList&, "
|
||||||
|
"scalarListList&, "
|
||||||
|
"labelListList&, "
|
||||||
|
"scalarListList&, "
|
||||||
"label&, "
|
"label&, "
|
||||||
"label&"
|
"label&"
|
||||||
")"
|
")"
|
||||||
|
|
@ -129,14 +133,24 @@ bool Foam::AMIMethod<SourcePatch, TargetPatch>::initialise
|
||||||
|
|
||||||
if (!foundFace)
|
if (!foundFace)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
if (requireMatch_)
|
||||||
(
|
{
|
||||||
"void Foam::AMIMethod<SourcePatch, TargetPatch>::initialise"
|
FatalErrorIn
|
||||||
"("
|
(
|
||||||
"label&, "
|
"void Foam::AMIMethod<SourcePatch, TargetPatch>::initialise"
|
||||||
"label&"
|
"("
|
||||||
")"
|
"labelListList&, "
|
||||||
) << "Unable to find initial target face" << abort(FatalError);
|
"scalarListList&, "
|
||||||
|
"labelListList&, "
|
||||||
|
"scalarListList&, "
|
||||||
|
"label&, "
|
||||||
|
"label&"
|
||||||
|
")"
|
||||||
|
) << "Unable to find initial target face"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -327,12 +341,14 @@ Foam::AMIMethod<SourcePatch, TargetPatch>::AMIMethod
|
||||||
const scalarField& srcMagSf,
|
const scalarField& srcMagSf,
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget
|
const bool reverseTarget,
|
||||||
|
const bool requireMatch
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
srcPatch_(srcPatch),
|
srcPatch_(srcPatch),
|
||||||
tgtPatch_(tgtPatch),
|
tgtPatch_(tgtPatch),
|
||||||
reverseTarget_(reverseTarget),
|
reverseTarget_(reverseTarget),
|
||||||
|
requireMatch_(requireMatch),
|
||||||
srcMagSf_(srcMagSf),
|
srcMagSf_(srcMagSf),
|
||||||
tgtMagSf_(tgtMagSf),
|
tgtMagSf_(tgtMagSf),
|
||||||
srcNonOverlap_(),
|
srcNonOverlap_(),
|
||||||
|
|
|
||||||
|
|
@ -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) 2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -85,6 +85,10 @@ protected:
|
||||||
// that the orientation of the target patch should be reversed
|
// that the orientation of the target patch should be reversed
|
||||||
const bool reverseTarget_;
|
const bool reverseTarget_;
|
||||||
|
|
||||||
|
//- Flag to indicate that the two patches must be matched/an overlap
|
||||||
|
// exists between them
|
||||||
|
const bool requireMatch_;
|
||||||
|
|
||||||
//- Source face areas
|
//- Source face areas
|
||||||
const scalarField& srcMagSf_;
|
const scalarField& srcMagSf_;
|
||||||
|
|
||||||
|
|
@ -166,9 +170,18 @@ public:
|
||||||
const scalarField& srcMagSf,
|
const scalarField& srcMagSf,
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget
|
const bool reverseTarget,
|
||||||
|
const bool requireMatch
|
||||||
),
|
),
|
||||||
(srcPatch, tgtPatch, srcMagSf, tgtMagSf, triMode, reverseTarget)
|
(
|
||||||
|
srcPatch,
|
||||||
|
tgtPatch,
|
||||||
|
srcMagSf,
|
||||||
|
tgtMagSf,
|
||||||
|
triMode,
|
||||||
|
reverseTarget,
|
||||||
|
requireMatch
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
|
|
@ -179,7 +192,8 @@ public:
|
||||||
const scalarField& srcMagSf,
|
const scalarField& srcMagSf,
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget
|
const bool reverseTarget,
|
||||||
|
const bool requireMatch
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Selector
|
//- Selector
|
||||||
|
|
@ -191,7 +205,8 @@ public:
|
||||||
const scalarField& srcMagSf,
|
const scalarField& srcMagSf,
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget
|
const bool reverseTarget,
|
||||||
|
const bool requireMatch
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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) 2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -35,7 +35,8 @@ Foam::AMIMethod<SourcePatch, TargetPatch>::New
|
||||||
const scalarField& srcMagSf,
|
const scalarField& srcMagSf,
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget
|
const bool reverseTarget,
|
||||||
|
const bool requireMatch
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
|
|
@ -58,6 +59,7 @@ Foam::AMIMethod<SourcePatch, TargetPatch>::New
|
||||||
"const scalarField&, "
|
"const scalarField&, "
|
||||||
"const scalarField&, "
|
"const scalarField&, "
|
||||||
"const faceAreaIntersect::triangulationMode&, "
|
"const faceAreaIntersect::triangulationMode&, "
|
||||||
|
"const bool, "
|
||||||
"const bool"
|
"const bool"
|
||||||
")"
|
")"
|
||||||
) << "Unknown AMIMethod type "
|
) << "Unknown AMIMethod type "
|
||||||
|
|
@ -75,7 +77,8 @@ Foam::AMIMethod<SourcePatch, TargetPatch>::New
|
||||||
srcMagSf,
|
srcMagSf,
|
||||||
tgtMagSf,
|
tgtMagSf,
|
||||||
triMode,
|
triMode,
|
||||||
reverseTarget
|
reverseTarget,
|
||||||
|
requireMatch
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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) 2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -106,7 +106,8 @@ Foam::directAMI<SourcePatch, TargetPatch>::directAMI
|
||||||
const scalarField& srcMagSf,
|
const scalarField& srcMagSf,
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget
|
const bool reverseTarget,
|
||||||
|
const bool requireMatch
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
AMIMethod<SourcePatch, TargetPatch>
|
AMIMethod<SourcePatch, TargetPatch>
|
||||||
|
|
@ -116,7 +117,8 @@ Foam::directAMI<SourcePatch, TargetPatch>::directAMI
|
||||||
srcMagSf,
|
srcMagSf,
|
||||||
tgtMagSf,
|
tgtMagSf,
|
||||||
triMode,
|
triMode,
|
||||||
reverseTarget
|
reverseTarget,
|
||||||
|
requireMatch
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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) 2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -102,7 +102,8 @@ public:
|
||||||
const scalarField& srcMagSf,
|
const scalarField& srcMagSf,
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget = false
|
const bool reverseTarget = false,
|
||||||
|
const bool requireMatch = true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -482,6 +482,7 @@ Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::faceAreaWeightAMI
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget,
|
const bool reverseTarget,
|
||||||
|
const bool requireMatch,
|
||||||
const bool restartUncoveredSourceFace
|
const bool restartUncoveredSourceFace
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
|
|
@ -492,7 +493,8 @@ Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::faceAreaWeightAMI
|
||||||
srcMagSf,
|
srcMagSf,
|
||||||
tgtMagSf,
|
tgtMagSf,
|
||||||
triMode,
|
triMode,
|
||||||
reverseTarget
|
reverseTarget,
|
||||||
|
requireMatch
|
||||||
),
|
),
|
||||||
restartUncoveredSourceFace_(restartUncoveredSourceFace)
|
restartUncoveredSourceFace_(restartUncoveredSourceFace)
|
||||||
{}
|
{}
|
||||||
|
|
|
||||||
|
|
@ -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) 2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -144,6 +144,7 @@ public:
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget = false,
|
const bool reverseTarget = false,
|
||||||
|
const bool requireMatch = true,
|
||||||
const bool restartUncoveredSourceFace = true
|
const bool restartUncoveredSourceFace = true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,8 @@ Foam::mapNearestAMI<SourcePatch, TargetPatch>::mapNearestAMI
|
||||||
const scalarField& srcMagSf,
|
const scalarField& srcMagSf,
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget
|
const bool reverseTarget,
|
||||||
|
const bool requireMatch
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
AMIMethod<SourcePatch, TargetPatch>
|
AMIMethod<SourcePatch, TargetPatch>
|
||||||
|
|
@ -193,7 +194,8 @@ Foam::mapNearestAMI<SourcePatch, TargetPatch>::mapNearestAMI
|
||||||
srcMagSf,
|
srcMagSf,
|
||||||
tgtMagSf,
|
tgtMagSf,
|
||||||
triMode,
|
triMode,
|
||||||
reverseTarget
|
reverseTarget,
|
||||||
|
requireMatch
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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) 2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -116,7 +116,8 @@ public:
|
||||||
const scalarField& srcMagSf,
|
const scalarField& srcMagSf,
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget = false
|
const bool reverseTarget = false,
|
||||||
|
const bool requireMatch = true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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) 2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -63,7 +63,8 @@ partialFaceAreaWeightAMI
|
||||||
const scalarField& srcMagSf,
|
const scalarField& srcMagSf,
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget
|
const bool reverseTarget,
|
||||||
|
const bool requireMatch
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
faceAreaWeightAMI<SourcePatch, TargetPatch>
|
faceAreaWeightAMI<SourcePatch, TargetPatch>
|
||||||
|
|
@ -73,7 +74,8 @@ partialFaceAreaWeightAMI
|
||||||
srcMagSf,
|
srcMagSf,
|
||||||
tgtMagSf,
|
tgtMagSf,
|
||||||
triMode,
|
triMode,
|
||||||
reverseTarget
|
reverseTarget,
|
||||||
|
requireMatch
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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) 2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -93,7 +93,8 @@ public:
|
||||||
const scalarField& srcMagSf,
|
const scalarField& srcMagSf,
|
||||||
const scalarField& tgtMagSf,
|
const scalarField& tgtMagSf,
|
||||||
const faceAreaIntersect::triangulationMode& triMode,
|
const faceAreaIntersect::triangulationMode& triMode,
|
||||||
const bool reverseTarget = false
|
const bool reverseTarget = false,
|
||||||
|
const bool requireMatch = true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -208,6 +208,8 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch
|
||||||
tgtMask_(),
|
tgtMask_(),
|
||||||
updated_(false)
|
updated_(false)
|
||||||
{
|
{
|
||||||
|
AMIRequireMatch_ = false;
|
||||||
|
|
||||||
// Non-overlapping patch might not be valid yet so cannot determine
|
// Non-overlapping patch might not be valid yet so cannot determine
|
||||||
// associated patchID
|
// associated patchID
|
||||||
}
|
}
|
||||||
|
|
@ -230,6 +232,8 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch
|
||||||
tgtMask_(),
|
tgtMask_(),
|
||||||
updated_(false)
|
updated_(false)
|
||||||
{
|
{
|
||||||
|
AMIRequireMatch_ = false;
|
||||||
|
|
||||||
if (nonOverlapPatchName_ == name)
|
if (nonOverlapPatchName_ == name)
|
||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorIn
|
||||||
|
|
@ -267,6 +271,8 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch
|
||||||
tgtMask_(),
|
tgtMask_(),
|
||||||
updated_(false)
|
updated_(false)
|
||||||
{
|
{
|
||||||
|
AMIRequireMatch_ = false;
|
||||||
|
|
||||||
// Non-overlapping patch might not be valid yet so cannot determine
|
// Non-overlapping patch might not be valid yet so cannot determine
|
||||||
// associated patchID
|
// associated patchID
|
||||||
}
|
}
|
||||||
|
|
@ -291,6 +297,8 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch
|
||||||
tgtMask_(),
|
tgtMask_(),
|
||||||
updated_(false)
|
updated_(false)
|
||||||
{
|
{
|
||||||
|
AMIRequireMatch_ = false;
|
||||||
|
|
||||||
if (nonOverlapPatchName_ == name())
|
if (nonOverlapPatchName_ == name())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
|
|
@ -328,7 +336,9 @@ Foam::cyclicACMIPolyPatch::cyclicACMIPolyPatch
|
||||||
srcMask_(),
|
srcMask_(),
|
||||||
tgtMask_(),
|
tgtMask_(),
|
||||||
updated_(false)
|
updated_(false)
|
||||||
{}
|
{
|
||||||
|
AMIRequireMatch_ = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
|
||||||
|
|
@ -388,6 +388,7 @@ void Foam::cyclicAMIPolyPatch::resetAMI
|
||||||
nbrPatch0,
|
nbrPatch0,
|
||||||
surfPtr(),
|
surfPtr(),
|
||||||
faceAreaIntersect::tmMesh,
|
faceAreaIntersect::tmMesh,
|
||||||
|
AMIRequireMatch_,
|
||||||
AMIMethod,
|
AMIMethod,
|
||||||
AMILowWeightCorrection_,
|
AMILowWeightCorrection_,
|
||||||
AMIReverse_
|
AMIReverse_
|
||||||
|
|
@ -501,6 +502,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
|
||||||
separationVector_(vector::zero),
|
separationVector_(vector::zero),
|
||||||
AMIPtr_(NULL),
|
AMIPtr_(NULL),
|
||||||
AMIReverse_(false),
|
AMIReverse_(false),
|
||||||
|
AMIRequireMatch_(true),
|
||||||
AMILowWeightCorrection_(-1.0),
|
AMILowWeightCorrection_(-1.0),
|
||||||
surfPtr_(NULL),
|
surfPtr_(NULL),
|
||||||
surfDict_(fileName("surface"))
|
surfDict_(fileName("surface"))
|
||||||
|
|
@ -530,6 +532,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
|
||||||
separationVector_(vector::zero),
|
separationVector_(vector::zero),
|
||||||
AMIPtr_(NULL),
|
AMIPtr_(NULL),
|
||||||
AMIReverse_(dict.lookupOrDefault<bool>("flipNormals", false)),
|
AMIReverse_(dict.lookupOrDefault<bool>("flipNormals", false)),
|
||||||
|
AMIRequireMatch_(true),
|
||||||
AMILowWeightCorrection_(dict.lookupOrDefault("lowWeightCorrection", -1.0)),
|
AMILowWeightCorrection_(dict.lookupOrDefault("lowWeightCorrection", -1.0)),
|
||||||
surfPtr_(NULL),
|
surfPtr_(NULL),
|
||||||
surfDict_(dict.subOrEmptyDict("surface"))
|
surfDict_(dict.subOrEmptyDict("surface"))
|
||||||
|
|
@ -639,6 +642,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
|
||||||
separationVector_(pp.separationVector_),
|
separationVector_(pp.separationVector_),
|
||||||
AMIPtr_(NULL),
|
AMIPtr_(NULL),
|
||||||
AMIReverse_(pp.AMIReverse_),
|
AMIReverse_(pp.AMIReverse_),
|
||||||
|
AMIRequireMatch_(pp.AMIRequireMatch_),
|
||||||
AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
|
AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
|
||||||
surfPtr_(NULL),
|
surfPtr_(NULL),
|
||||||
surfDict_(pp.surfDict_)
|
surfDict_(pp.surfDict_)
|
||||||
|
|
@ -669,6 +673,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
|
||||||
separationVector_(pp.separationVector_),
|
separationVector_(pp.separationVector_),
|
||||||
AMIPtr_(NULL),
|
AMIPtr_(NULL),
|
||||||
AMIReverse_(pp.AMIReverse_),
|
AMIReverse_(pp.AMIReverse_),
|
||||||
|
AMIRequireMatch_(pp.AMIRequireMatch_),
|
||||||
AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
|
AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
|
||||||
surfPtr_(NULL),
|
surfPtr_(NULL),
|
||||||
surfDict_(pp.surfDict_)
|
surfDict_(pp.surfDict_)
|
||||||
|
|
@ -713,6 +718,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
|
||||||
separationVector_(pp.separationVector_),
|
separationVector_(pp.separationVector_),
|
||||||
AMIPtr_(NULL),
|
AMIPtr_(NULL),
|
||||||
AMIReverse_(pp.AMIReverse_),
|
AMIReverse_(pp.AMIReverse_),
|
||||||
|
AMIRequireMatch_(pp.AMIRequireMatch_),
|
||||||
AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
|
AMILowWeightCorrection_(pp.AMILowWeightCorrection_),
|
||||||
surfPtr_(NULL),
|
surfPtr_(NULL),
|
||||||
surfDict_(pp.surfDict_)
|
surfDict_(pp.surfDict_)
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,24 @@ class cyclicAMIPolyPatch
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Return normal of face at max distance from rotation axis
|
||||||
|
vector findFaceNormalMaxRadius(const pointField& faceCentres) const;
|
||||||
|
|
||||||
|
void calcTransforms
|
||||||
|
(
|
||||||
|
const primitivePatch& half0,
|
||||||
|
const pointField& half0Ctrs,
|
||||||
|
const vectorField& half0Areas,
|
||||||
|
const pointField& half1Ctrs,
|
||||||
|
const vectorField& half1Areas
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
//- Name of other half
|
//- Name of other half
|
||||||
mutable word nbrPatchName_;
|
mutable word nbrPatchName_;
|
||||||
|
|
@ -97,6 +114,9 @@ private:
|
||||||
//- Flag to indicate that slave patch should be reversed for AMI
|
//- Flag to indicate that slave patch should be reversed for AMI
|
||||||
const bool AMIReverse_;
|
const bool AMIReverse_;
|
||||||
|
|
||||||
|
//- Flag to indicate that patches should match/overlap
|
||||||
|
bool AMIRequireMatch_;
|
||||||
|
|
||||||
//- Low weight correction threshold for AMI
|
//- Low weight correction threshold for AMI
|
||||||
const scalar AMILowWeightCorrection_;
|
const scalar AMILowWeightCorrection_;
|
||||||
|
|
||||||
|
|
@ -107,23 +127,6 @@ private:
|
||||||
const dictionary surfDict_;
|
const dictionary surfDict_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Return normal of face at max distance from rotation axis
|
|
||||||
vector findFaceNormalMaxRadius(const pointField& faceCentres) const;
|
|
||||||
|
|
||||||
void calcTransforms
|
|
||||||
(
|
|
||||||
const primitivePatch& half0,
|
|
||||||
const pointField& half0Ctrs,
|
|
||||||
const vectorField& half0Areas,
|
|
||||||
const pointField& half1Ctrs,
|
|
||||||
const vectorField& half1Areas
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Reset the AMI interpolator
|
//- Reset the AMI interpolator
|
||||||
|
|
|
||||||
|
|
@ -836,6 +836,7 @@ void Foam::mappedPatchBase::calcAMI() const
|
||||||
samplePolyPatch(), // nbrPatch0,
|
samplePolyPatch(), // nbrPatch0,
|
||||||
surfPtr(),
|
surfPtr(),
|
||||||
faceAreaIntersect::tmMesh,
|
faceAreaIntersect::tmMesh,
|
||||||
|
true,
|
||||||
AMIPatchToPatchInterpolation::imFaceAreaWeight,
|
AMIPatchToPatchInterpolation::imFaceAreaWeight,
|
||||||
-1,
|
-1,
|
||||||
AMIReverse_
|
AMIReverse_
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,7 @@ void Foam::regionCoupledBase::resetAMI() const
|
||||||
nbrPatch0,
|
nbrPatch0,
|
||||||
surfPtr(),
|
surfPtr(),
|
||||||
faceAreaIntersect::tmMesh,
|
faceAreaIntersect::tmMesh,
|
||||||
|
true,
|
||||||
AMIPatchToPatchInterpolation::imFaceAreaWeight,
|
AMIPatchToPatchInterpolation::imFaceAreaWeight,
|
||||||
-1,
|
-1,
|
||||||
AMIReverse_
|
AMIReverse_
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,7 @@ Foam::regionModels::regionModel::interRegionAMI
|
||||||
p,
|
p,
|
||||||
nbrP,
|
nbrP,
|
||||||
faceAreaIntersect::tmMesh,
|
faceAreaIntersect::tmMesh,
|
||||||
|
true,
|
||||||
AMIPatchToPatchInterpolation::imFaceAreaWeight,
|
AMIPatchToPatchInterpolation::imFaceAreaWeight,
|
||||||
-1,
|
-1,
|
||||||
flip
|
flip
|
||||||
|
|
@ -284,6 +285,7 @@ Foam::regionModels::regionModel::interRegionAMI
|
||||||
p,
|
p,
|
||||||
nbrP,
|
nbrP,
|
||||||
faceAreaIntersect::tmMesh,
|
faceAreaIntersect::tmMesh,
|
||||||
|
true,
|
||||||
AMIPatchToPatchInterpolation::imFaceAreaWeight,
|
AMIPatchToPatchInterpolation::imFaceAreaWeight,
|
||||||
-1,
|
-1,
|
||||||
flip
|
flip
|
||||||
|
|
|
||||||
|
|
@ -419,6 +419,7 @@ Foam::meshToMesh::patchAMIs() const
|
||||||
srcPP,
|
srcPP,
|
||||||
tgtPP,
|
tgtPP,
|
||||||
faceAreaIntersect::tmMesh,
|
faceAreaIntersect::tmMesh,
|
||||||
|
false,
|
||||||
interpolationMethodAMI(method_),
|
interpolationMethodAMI(method_),
|
||||||
-1,
|
-1,
|
||||||
true // flip target patch since patch normals are aligned
|
true // flip target patch since patch normals are aligned
|
||||||
|
|
|
||||||
|
|
@ -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-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -270,7 +270,7 @@ void Foam::radiation::radiativeIntensityRay::addIntensity()
|
||||||
|
|
||||||
forAll(ILambda_, lambdaI)
|
forAll(ILambda_, lambdaI)
|
||||||
{
|
{
|
||||||
I_ += absorptionEmission_.addIntensity(lambdaI, ILambda_[lambdaI]);
|
I_ += ILambda_[lambdaI];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -235,17 +235,6 @@ bool Foam::radiation::absorptionEmissionModel::isGrey() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::radiation::absorptionEmissionModel::addIntensity
|
|
||||||
(
|
|
||||||
const label rayI,
|
|
||||||
const volScalarField& ILambda
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return ILambda;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::radiation::absorptionEmissionModel::correct
|
void Foam::radiation::absorptionEmissionModel::correct
|
||||||
(
|
(
|
||||||
volScalarField& a,
|
volScalarField& a,
|
||||||
|
|
|
||||||
|
|
@ -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-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -170,13 +170,6 @@ public:
|
||||||
//- Flag for whether the absorption/emission is for a grey gas
|
//- Flag for whether the absorption/emission is for a grey gas
|
||||||
virtual bool isGrey() const;
|
virtual bool isGrey() const;
|
||||||
|
|
||||||
//- Add radiative intensity for ray i
|
|
||||||
virtual tmp<volScalarField> addIntensity
|
|
||||||
(
|
|
||||||
const label rayI,
|
|
||||||
const volScalarField& ILambda
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Correct absorption coefficients
|
//- Correct absorption coefficients
|
||||||
virtual void correct
|
virtual void correct
|
||||||
(
|
(
|
||||||
|
|
|
||||||
|
|
@ -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-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -293,16 +293,6 @@ Foam::radiation::wideBandAbsorptionEmission::ECont(const label bandI) const
|
||||||
return E;
|
return E;
|
||||||
}
|
}
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::radiation::wideBandAbsorptionEmission::addIntensity
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const volScalarField& ILambda
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return ILambda*(iBands_[i][1] - iBands_[i][0])/totalWaveLength_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::radiation::wideBandAbsorptionEmission::correct
|
void Foam::radiation::wideBandAbsorptionEmission::correct
|
||||||
(
|
(
|
||||||
|
|
|
||||||
|
|
@ -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-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -227,14 +227,7 @@ public:
|
||||||
return iBands_[i];
|
return iBands_[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Add contribution of ILambda to the total radiative intensity in
|
//- Correct rays
|
||||||
// direction i
|
|
||||||
tmp<volScalarField> addIntensity
|
|
||||||
(
|
|
||||||
const label i,
|
|
||||||
const volScalarField& ILambda
|
|
||||||
) const;
|
|
||||||
|
|
||||||
void correct
|
void correct
|
||||||
(
|
(
|
||||||
volScalarField& a_,
|
volScalarField& a_,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue