mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -4,12 +4,24 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime);
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
volTensorField gradUaT = fvc::grad(Ua)().T();
|
volTensorField gradUaT = fvc::grad(Ua)().T();
|
||||||
|
|
||||||
|
if (kineticTheory.on())
|
||||||
|
{
|
||||||
|
kineticTheory.solve(gradUaT);
|
||||||
|
nuEffa = kineticTheory.mua()/rhoa;
|
||||||
|
}
|
||||||
|
else // If not using kinetic theory is using Ct model
|
||||||
|
{
|
||||||
|
nuEffa = sqr(Ct)*nutb + nua;
|
||||||
|
}
|
||||||
|
|
||||||
volTensorField Rca
|
volTensorField Rca
|
||||||
(
|
(
|
||||||
"Rca",
|
"Rca",
|
||||||
((2.0/3.0)*I)*(sqr(Ct)*k + nuEffa*tr(gradUaT)) - nuEffa*gradUaT
|
((2.0/3.0)*I)*(sqr(Ct)*k + nuEffa*tr(gradUaT)) - nuEffa*gradUaT
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if (kineticTheory.on())
|
if (kineticTheory.on())
|
||||||
{
|
{
|
||||||
Rca -= ((kineticTheory.lambda()/rhoa)*tr(gradUaT))*tensor(I);
|
Rca -= ((kineticTheory.lambda()/rhoa)*tr(gradUaT))*tensor(I);
|
||||||
|
|||||||
62
applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H
Normal file
62
applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
if(turbulence)
|
||||||
|
{
|
||||||
|
if (mesh.changing())
|
||||||
|
{
|
||||||
|
y.correct();
|
||||||
|
}
|
||||||
|
|
||||||
|
tmp<volTensorField> tgradUb = fvc::grad(Ub);
|
||||||
|
volScalarField G = 2*nutb*(tgradUb() && dev(symm(tgradUb())));
|
||||||
|
tgradUb.clear();
|
||||||
|
|
||||||
|
#include "wallFunctions.H"
|
||||||
|
|
||||||
|
// Dissipation equation
|
||||||
|
fvScalarMatrix epsEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(beta, epsilon)
|
||||||
|
+ fvm::div(phib, epsilon)
|
||||||
|
- fvm::laplacian
|
||||||
|
(
|
||||||
|
alphaEps*nuEffb, epsilon,
|
||||||
|
"laplacian(DepsilonEff,epsilon)"
|
||||||
|
)
|
||||||
|
==
|
||||||
|
C1*beta*G*epsilon/k
|
||||||
|
- fvm::Sp(C2*beta*epsilon/k, epsilon)
|
||||||
|
);
|
||||||
|
|
||||||
|
#include "wallDissipation.H"
|
||||||
|
|
||||||
|
epsEqn.relax();
|
||||||
|
epsEqn.solve();
|
||||||
|
|
||||||
|
epsilon.max(dimensionedScalar("zero", epsilon.dimensions(), 1.0e-15));
|
||||||
|
|
||||||
|
|
||||||
|
// Turbulent kinetic energy equation
|
||||||
|
fvScalarMatrix kEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(beta, k)
|
||||||
|
+ fvm::div(phib, k)
|
||||||
|
- fvm::laplacian
|
||||||
|
(
|
||||||
|
alphak*nuEffb, k,
|
||||||
|
"laplacian(DkEff,k)"
|
||||||
|
)
|
||||||
|
==
|
||||||
|
beta*G
|
||||||
|
- fvm::Sp(beta*epsilon/k, k)
|
||||||
|
);
|
||||||
|
kEqn.relax();
|
||||||
|
kEqn.solve();
|
||||||
|
|
||||||
|
k.max(dimensionedScalar("zero", k.dimensions(), 1.0e-8));
|
||||||
|
|
||||||
|
//- Re-calculate turbulence viscosity
|
||||||
|
nutb = Cmu*sqr(k)/epsilon;
|
||||||
|
|
||||||
|
#include "wallViscosity.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
nuEffb = nutb + nub;
|
||||||
@ -102,7 +102,7 @@ Foam::tmp<Foam::volScalarField> Foam::JohnsonJacksonFrictionalStress::muf
|
|||||||
const volScalarField& alpha,
|
const volScalarField& alpha,
|
||||||
const dimensionedScalar& alphaMax,
|
const dimensionedScalar& alphaMax,
|
||||||
const volScalarField& pf,
|
const volScalarField& pf,
|
||||||
const volTensorField& D,
|
const volSymmTensorField& D,
|
||||||
const dimensionedScalar& phi
|
const dimensionedScalar& phi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -93,7 +93,7 @@ public:
|
|||||||
const volScalarField& alpha,
|
const volScalarField& alpha,
|
||||||
const dimensionedScalar& alphaMax,
|
const dimensionedScalar& alphaMax,
|
||||||
const volScalarField& pf,
|
const volScalarField& pf,
|
||||||
const volTensorField& D,
|
const volSymmTensorField& D,
|
||||||
const dimensionedScalar& phi
|
const dimensionedScalar& phi
|
||||||
) const;
|
) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -99,7 +99,7 @@ Foam::tmp<Foam::volScalarField> Foam::SchaefferFrictionalStress::muf
|
|||||||
const volScalarField& alpha,
|
const volScalarField& alpha,
|
||||||
const dimensionedScalar& alphaMax,
|
const dimensionedScalar& alphaMax,
|
||||||
const volScalarField& pf,
|
const volScalarField& pf,
|
||||||
const volTensorField& D,
|
const volSymmTensorField& D,
|
||||||
const dimensionedScalar& phi
|
const dimensionedScalar& phi
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -93,7 +93,7 @@ public:
|
|||||||
const volScalarField& alpha,
|
const volScalarField& alpha,
|
||||||
const dimensionedScalar& alphaMax,
|
const dimensionedScalar& alphaMax,
|
||||||
const volScalarField& pf,
|
const volScalarField& pf,
|
||||||
const volTensorField& D,
|
const volSymmTensorField& D,
|
||||||
const dimensionedScalar& phi
|
const dimensionedScalar& phi
|
||||||
) const;
|
) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -48,7 +48,7 @@ namespace Foam
|
|||||||
|
|
||||||
class frictionalStressModel
|
class frictionalStressModel
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private member functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
frictionalStressModel(const frictionalStressModel&);
|
frictionalStressModel(const frictionalStressModel&);
|
||||||
@ -127,7 +127,7 @@ public:
|
|||||||
const volScalarField& alpha,
|
const volScalarField& alpha,
|
||||||
const dimensionedScalar& alphaMax,
|
const dimensionedScalar& alphaMax,
|
||||||
const volScalarField& pf,
|
const volScalarField& pf,
|
||||||
const volTensorField& D,
|
const volSymmTensorField& D,
|
||||||
const dimensionedScalar& phi
|
const dimensionedScalar& phi
|
||||||
) const = 0;
|
) const = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -56,12 +56,13 @@ Foam::kineticTheoryModel::kineticTheoryModel
|
|||||||
"kineticTheoryProperties",
|
"kineticTheoryProperties",
|
||||||
Ua_.time().constant(),
|
Ua_.time().constant(),
|
||||||
Ua_.mesh(),
|
Ua_.mesh(),
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
kineticTheory_(kineticTheoryProperties_.lookup("kineticTheory")),
|
kineticTheory_(kineticTheoryProperties_.lookup("kineticTheory")),
|
||||||
equilibrium_(kineticTheoryProperties_.lookup("equilibrium")),
|
equilibrium_(kineticTheoryProperties_.lookup("equilibrium")),
|
||||||
|
|
||||||
viscosityModel_
|
viscosityModel_
|
||||||
(
|
(
|
||||||
kineticTheoryModels::viscosityModel::New
|
kineticTheoryModels::viscosityModel::New
|
||||||
@ -192,24 +193,19 @@ Foam::kineticTheoryModel::~kineticTheoryModel()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::kineticTheoryModel::solve()
|
void Foam::kineticTheoryModel::solve(const volTensorField& gradUat)
|
||||||
{
|
{
|
||||||
if (!kineticTheory_)
|
if (!kineticTheory_)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
word scheme("div(phi,Theta)");
|
|
||||||
|
|
||||||
volScalarField alpha = alpha_;
|
|
||||||
alpha.max(1.0e-6);
|
|
||||||
const scalar sqrtPi = sqrt(constant::mathematical::pi);
|
const scalar sqrtPi = sqrt(constant::mathematical::pi);
|
||||||
|
|
||||||
surfaceScalarField phi = 1.5*rhoa_*phia_*fvc::interpolate(alpha_);
|
surfaceScalarField phi = 1.5*rhoa_*phia_*fvc::interpolate(alpha_);
|
||||||
|
|
||||||
volTensorField dU = fvc::grad(Ua_);
|
volTensorField dU = gradUat.T();//fvc::grad(Ua_);
|
||||||
volTensorField dUT = dU.T();
|
volSymmTensorField D = symm(dU);
|
||||||
volTensorField D = 0.5*(dU + dUT);
|
|
||||||
|
|
||||||
// NB, drag = K*alpha*beta,
|
// NB, drag = K*alpha*beta,
|
||||||
// (the alpha and beta has been extracted from the drag function for
|
// (the alpha and beta has been extracted from the drag function for
|
||||||
@ -220,11 +216,26 @@ void Foam::kineticTheoryModel::solve()
|
|||||||
// Calculating the radial distribution function (solid volume fraction is
|
// Calculating the radial distribution function (solid volume fraction is
|
||||||
// limited close to the packing limit, but this needs improvements)
|
// limited close to the packing limit, but this needs improvements)
|
||||||
// The solution is higly unstable close to the packing limit.
|
// The solution is higly unstable close to the packing limit.
|
||||||
gs0_ = radialModel_->g0(min(alpha, alphaMax_-1.0e-2), alphaMax_);
|
gs0_ = radialModel_->g0
|
||||||
|
(
|
||||||
|
min(max(alpha_, 1e-6), alphaMax_ - 0.01),
|
||||||
|
alphaMax_
|
||||||
|
);
|
||||||
|
|
||||||
// particle pressure - coefficient in front of Theta (Eq. 3.22, p. 45)
|
// particle pressure - coefficient in front of Theta (Eq. 3.22, p. 45)
|
||||||
volScalarField PsCoeff =
|
volScalarField PsCoeff = granularPressureModel_->granularPressureCoeff
|
||||||
granularPressureModel_->granularPressureCoeff(alpha_,gs0_,rhoa_,e_ );
|
(
|
||||||
|
alpha_,
|
||||||
|
gs0_,
|
||||||
|
rhoa_,
|
||||||
|
e_
|
||||||
|
);
|
||||||
|
|
||||||
|
// 'thermal' conductivity (Table 3.3, p. 49)
|
||||||
|
kappa_ = conductivityModel_->kappa(alpha_, Theta_, gs0_, rhoa_, da_, e_);
|
||||||
|
|
||||||
|
// particle viscosity (Table 3.2, p.47)
|
||||||
|
mua_ = viscosityModel_->mua(alpha_, Theta_, gs0_, rhoa_, da_, e_);
|
||||||
|
|
||||||
dimensionedScalar Tsmall
|
dimensionedScalar Tsmall
|
||||||
(
|
(
|
||||||
@ -236,29 +247,21 @@ void Foam::kineticTheoryModel::solve()
|
|||||||
dimensionedScalar TsmallSqrt = sqrt(Tsmall);
|
dimensionedScalar TsmallSqrt = sqrt(Tsmall);
|
||||||
volScalarField ThetaSqrt = sqrt(Theta_);
|
volScalarField ThetaSqrt = sqrt(Theta_);
|
||||||
|
|
||||||
// 'thermal' conductivity (Table 3.3, p. 49)
|
|
||||||
kappa_ = conductivityModel_->kappa(alpha, Theta_, gs0_, rhoa_, da_, e_);
|
|
||||||
|
|
||||||
// particle viscosity (Table 3.2, p.47)
|
|
||||||
mua_ = viscosityModel_->mua(alpha, Theta_, gs0_, rhoa_, da_, e_);
|
|
||||||
|
|
||||||
// dissipation (Eq. 3.24, p.50)
|
// dissipation (Eq. 3.24, p.50)
|
||||||
volScalarField gammaCoeff =
|
volScalarField gammaCoeff =
|
||||||
12.0*(1.0 - e_*e_)*sqr(alpha)*rhoa_*gs0_*(1.0/da_)
|
12.0*(1.0 - sqr(e_))*sqr(alpha_)*rhoa_*gs0_*(1.0/da_)*ThetaSqrt/sqrtPi;
|
||||||
*ThetaSqrt/sqrtPi;
|
|
||||||
|
|
||||||
// Eq. 3.25, p. 50 Js = J1 - J2
|
// Eq. 3.25, p. 50 Js = J1 - J2
|
||||||
volScalarField J1 = 3.0*betaPrim;
|
volScalarField J1 = 3.0*betaPrim;
|
||||||
volScalarField J2 =
|
volScalarField J2 =
|
||||||
0.25*sqr(betaPrim)*da_*sqr(Ur)
|
0.25*sqr(betaPrim)*da_*sqr(Ur)
|
||||||
/(alpha*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt));
|
/(max(alpha_, 1e-6)*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt));
|
||||||
|
|
||||||
// bulk viscosity p. 45 (Lun et al. 1984).
|
// bulk viscosity p. 45 (Lun et al. 1984).
|
||||||
lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0+e_)*ThetaSqrt/sqrtPi;
|
lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0+e_)*ThetaSqrt/sqrtPi;
|
||||||
|
|
||||||
|
|
||||||
// stress tensor, Definitions, Table 3.1, p. 43
|
// stress tensor, Definitions, Table 3.1, p. 43
|
||||||
volTensorField tau = 2.0*mua_*D + (lambda_ - (2.0/3.0)*mua_)*tr(D)*I;
|
volSymmTensorField tau = 2.0*mua_*D + (lambda_ - (2.0/3.0)*mua_)*tr(D)*I;
|
||||||
|
|
||||||
if (!equilibrium_)
|
if (!equilibrium_)
|
||||||
{
|
{
|
||||||
@ -268,8 +271,8 @@ void Foam::kineticTheoryModel::solve()
|
|||||||
// wrong sign infront of laplacian
|
// wrong sign infront of laplacian
|
||||||
fvScalarMatrix ThetaEqn
|
fvScalarMatrix ThetaEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(1.5*alpha*rhoa_, Theta_)
|
fvm::ddt(1.5*alpha_*rhoa_, Theta_)
|
||||||
+ fvm::div(phi, Theta_, scheme)
|
+ fvm::div(phi, Theta_, "div(phi,Theta)")
|
||||||
==
|
==
|
||||||
fvm::SuSp(-((PsCoeff*I) && dU), Theta_)
|
fvm::SuSp(-((PsCoeff*I) && dU), Theta_)
|
||||||
+ (tau && dU)
|
+ (tau && dU)
|
||||||
@ -290,33 +293,31 @@ void Foam::kineticTheoryModel::solve()
|
|||||||
volScalarField K3 = 0.5*da_*rhoa_*
|
volScalarField K3 = 0.5*da_*rhoa_*
|
||||||
(
|
(
|
||||||
(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_*rhoa_*(1.0 + e_)*alpha*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0;
|
4.0*da_*rhoa_*(1.0 + e_)*alpha_*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0;
|
||||||
|
|
||||||
volScalarField K4 = 12.0*(1.0 - e_*e_)*rhoa_*gs0_/(da_*sqrtPi);
|
volScalarField K4 = 12.0*(1.0 - sqr(e_))*rhoa_*gs0_/(da_*sqrtPi);
|
||||||
|
|
||||||
volScalarField trD = tr(D);
|
volScalarField trD = tr(D);
|
||||||
volTensorField D2 = D & D;
|
volScalarField tr2D = sqr(trD);
|
||||||
volScalarField tr2D = trD*trD;
|
volScalarField trD2 = tr(D & D);
|
||||||
volScalarField trD2 = tr(D2);
|
|
||||||
|
|
||||||
volScalarField t1 = K1*alpha + rhoa_;
|
volScalarField t1 = K1*alpha_ + rhoa_;
|
||||||
volScalarField l1 = -t1*trD;
|
volScalarField l1 = -t1*trD;
|
||||||
volScalarField l2 = sqr(t1)*tr2D;
|
volScalarField l2 = sqr(t1)*tr2D;
|
||||||
volScalarField l3 = 4.0*K4*alpha*(2.0*K3*trD2 + K2*tr2D);
|
volScalarField l3 = 4.0*K4*max(alpha_, 1e-6)*(2.0*K3*trD2 + K2*tr2D);
|
||||||
|
|
||||||
Theta_ = sqr((l1 + sqrt(l2 + l3))/(2.0*(alpha + 1.0e-4)*K4));
|
Theta_ = sqr((l1 + sqrt(l2 + l3))/(2.0*(alpha_ + 1.0e-4)*K4));
|
||||||
}
|
}
|
||||||
|
|
||||||
Theta_.max(1.0e-15);
|
Theta_.max(1.0e-15);
|
||||||
Theta_.min(1.0e+3);
|
Theta_.min(1.0e+3);
|
||||||
|
|
||||||
volScalarField pf =
|
volScalarField pf = frictionalStressModel_->frictionalPressure
|
||||||
frictionalStressModel_->frictionalPressure
|
|
||||||
(
|
(
|
||||||
alpha_,
|
alpha_,
|
||||||
alphaMinFriction_,
|
alphaMinFriction_,
|
||||||
@ -344,13 +345,11 @@ void Foam::kineticTheoryModel::solve()
|
|||||||
phi_
|
phi_
|
||||||
);
|
);
|
||||||
|
|
||||||
// add frictional stress for alpha > alphaMinFriction
|
// add frictional stress
|
||||||
mua_ = viscosityModel_->mua(alpha, Theta_, gs0_, rhoa_, da_, e_) + muf;
|
mua_ += muf;
|
||||||
mua_.min(1.0e+2);
|
mua_.min(1.0e+2);
|
||||||
mua_.max(0.0);
|
mua_.max(0.0);
|
||||||
|
|
||||||
lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0 + e_)*ThetaSqrt/sqrtPi;
|
|
||||||
|
|
||||||
Info<< "kinTheory: max(Theta) = " << max(Theta_).value() << endl;
|
Info<< "kinTheory: max(Theta) = " << max(Theta_).value() << endl;
|
||||||
|
|
||||||
volScalarField ktn = mua_/rhoa_;
|
volScalarField ktn = mua_/rhoa_;
|
||||||
|
|||||||
@ -156,7 +156,7 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
void solve();
|
void solve(const volTensorField& gradUat);
|
||||||
|
|
||||||
bool on() const
|
bool on() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,6 +5,9 @@
|
|||||||
volScalarField rUaA = 1.0/UaEqn.A();
|
volScalarField rUaA = 1.0/UaEqn.A();
|
||||||
volScalarField rUbA = 1.0/UbEqn.A();
|
volScalarField rUbA = 1.0/UbEqn.A();
|
||||||
|
|
||||||
|
phia == (fvc::interpolate(Ua) & mesh.Sf());
|
||||||
|
phib == (fvc::interpolate(Ub) & mesh.Sf());
|
||||||
|
|
||||||
rUaAf = fvc::interpolate(rUaA);
|
rUaAf = fvc::interpolate(rUaA);
|
||||||
surfaceScalarField rUbAf = fvc::interpolate(rUbA);
|
surfaceScalarField rUbAf = fvc::interpolate(rUbA);
|
||||||
|
|
||||||
@ -47,8 +50,7 @@
|
|||||||
|
|
||||||
surfaceScalarField Dp
|
surfaceScalarField Dp
|
||||||
(
|
(
|
||||||
"(rho*(1|A(U)))",
|
"(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob
|
||||||
alphaf*rUaAf/rhoa + betaf*rUbAf/rhob
|
|
||||||
);
|
);
|
||||||
|
|
||||||
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
|
|||||||
@ -92,11 +92,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "kEpsilon.H"
|
#include "kEpsilon.H"
|
||||||
|
|
||||||
if (kineticTheory.on())
|
|
||||||
{
|
|
||||||
kineticTheory.solve();
|
|
||||||
nuEffa += kineticTheory.mua()/rhoa;
|
|
||||||
}
|
|
||||||
#include "write.H"
|
#include "write.H"
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
|
surfaceMeshWriter.C
|
||||||
|
|
||||||
foamToVTK.C
|
foamToVTK.C
|
||||||
internalWriter.C
|
internalWriter.C
|
||||||
lagrangianWriter.C
|
lagrangianWriter.C
|
||||||
patchWriter.C
|
patchWriter.C
|
||||||
writeFuns.C
|
writeFuns.C
|
||||||
writePatchGeom.C
|
|
||||||
writeFaceSet.C
|
writeFaceSet.C
|
||||||
writePointSet.C
|
writePointSet.C
|
||||||
writeSurfFields.C
|
writeSurfFields.C
|
||||||
|
|||||||
@ -157,7 +157,7 @@ Note
|
|||||||
|
|
||||||
#include "writeFaceSet.H"
|
#include "writeFaceSet.H"
|
||||||
#include "writePointSet.H"
|
#include "writePointSet.H"
|
||||||
#include "writePatchGeom.H"
|
#include "surfaceMeshWriter.H"
|
||||||
#include "writeSurfFields.H"
|
#include "writeSurfFields.H"
|
||||||
|
|
||||||
|
|
||||||
@ -963,20 +963,42 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (doFaceZones)
|
if (doFaceZones)
|
||||||
{
|
{
|
||||||
|
PtrList<surfaceScalarField> ssf;
|
||||||
|
readFields
|
||||||
|
(
|
||||||
|
vMesh,
|
||||||
|
vMesh.baseMesh(),
|
||||||
|
objects,
|
||||||
|
selectedFields,
|
||||||
|
ssf
|
||||||
|
);
|
||||||
|
print(" surfScalarFields :", Info, ssf);
|
||||||
|
|
||||||
|
PtrList<surfaceVectorField> svf;
|
||||||
|
readFields
|
||||||
|
(
|
||||||
|
vMesh,
|
||||||
|
vMesh.baseMesh(),
|
||||||
|
objects,
|
||||||
|
selectedFields,
|
||||||
|
svf
|
||||||
|
);
|
||||||
|
print(" surfVectorFields :", Info, svf);
|
||||||
|
|
||||||
const faceZoneMesh& zones = mesh.faceZones();
|
const faceZoneMesh& zones = mesh.faceZones();
|
||||||
|
|
||||||
forAll(zones, zoneI)
|
forAll(zones, zoneI)
|
||||||
{
|
{
|
||||||
const faceZone& pp = zones[zoneI];
|
const faceZone& fz = zones[zoneI];
|
||||||
|
|
||||||
mkDir(fvPath/pp.name());
|
mkDir(fvPath/fz.name());
|
||||||
|
|
||||||
fileName patchFileName;
|
fileName patchFileName;
|
||||||
|
|
||||||
if (vMesh.useSubMesh())
|
if (vMesh.useSubMesh())
|
||||||
{
|
{
|
||||||
patchFileName =
|
patchFileName =
|
||||||
fvPath/pp.name()/cellSetName
|
fvPath/fz.name()/cellSetName
|
||||||
+ "_"
|
+ "_"
|
||||||
+ timeDesc
|
+ timeDesc
|
||||||
+ ".vtk";
|
+ ".vtk";
|
||||||
@ -984,7 +1006,7 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
patchFileName =
|
patchFileName =
|
||||||
fvPath/pp.name()/pp.name()
|
fvPath/fz.name()/fz.name()
|
||||||
+ "_"
|
+ "_"
|
||||||
+ timeDesc
|
+ timeDesc
|
||||||
+ ".vtk";
|
+ ".vtk";
|
||||||
@ -992,18 +1014,31 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< " FaceZone : " << patchFileName << endl;
|
Info<< " FaceZone : " << patchFileName << endl;
|
||||||
|
|
||||||
std::ofstream ostr(patchFileName.c_str());
|
indirectPrimitivePatch pp
|
||||||
|
|
||||||
writeFuns::writeHeader(ostr, binary, pp.name());
|
|
||||||
ostr<< "DATASET POLYDATA" << std::endl;
|
|
||||||
|
|
||||||
writePatchGeom
|
|
||||||
(
|
(
|
||||||
binary,
|
IndirectList<face>(mesh.faces(), fz),
|
||||||
pp().localFaces(),
|
mesh.points()
|
||||||
pp().localPoints(),
|
|
||||||
ostr
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
surfaceMeshWriter writer
|
||||||
|
(
|
||||||
|
vMesh,
|
||||||
|
binary,
|
||||||
|
pp,
|
||||||
|
fz.name(),
|
||||||
|
patchFileName
|
||||||
|
);
|
||||||
|
|
||||||
|
// Number of fields
|
||||||
|
writeFuns::writeCellDataHeader
|
||||||
|
(
|
||||||
|
writer.os(),
|
||||||
|
pp.size(),
|
||||||
|
ssf.size()+svf.size()
|
||||||
|
);
|
||||||
|
|
||||||
|
writer.write(ssf);
|
||||||
|
writer.write(svf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,85 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "surfaceMeshWriter.H"
|
||||||
|
#include "writeFuns.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::surfaceMeshWriter::surfaceMeshWriter
|
||||||
|
(
|
||||||
|
const vtkMesh& vMesh,
|
||||||
|
const bool binary,
|
||||||
|
const indirectPrimitivePatch& pp,
|
||||||
|
const word& name,
|
||||||
|
const fileName& fName
|
||||||
|
)
|
||||||
|
:
|
||||||
|
vMesh_(vMesh),
|
||||||
|
binary_(binary),
|
||||||
|
pp_(pp),
|
||||||
|
fName_(fName),
|
||||||
|
os_(fName.c_str())
|
||||||
|
{
|
||||||
|
// Write header
|
||||||
|
writeFuns::writeHeader(os_, binary_, name);
|
||||||
|
|
||||||
|
os_ << "DATASET POLYDATA" << std::endl;
|
||||||
|
|
||||||
|
// Write topology
|
||||||
|
label nFaceVerts = 0;
|
||||||
|
|
||||||
|
forAll(pp, faceI)
|
||||||
|
{
|
||||||
|
nFaceVerts += pp[faceI].size() + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
os_ << "POINTS " << pp.nPoints() << " float" << std::endl;
|
||||||
|
|
||||||
|
DynamicList<floatScalar> ptField(3*pp.nPoints());
|
||||||
|
writeFuns::insert(pp.localPoints(), ptField);
|
||||||
|
writeFuns::write(os_, binary, ptField);
|
||||||
|
|
||||||
|
|
||||||
|
os_ << "POLYGONS " << pp.size() << ' ' << nFaceVerts << std::endl;
|
||||||
|
|
||||||
|
DynamicList<label> vertLabels(nFaceVerts);
|
||||||
|
|
||||||
|
forAll(pp, faceI)
|
||||||
|
{
|
||||||
|
const face& f = pp.localFaces()[faceI];
|
||||||
|
|
||||||
|
vertLabels.append(f.size());
|
||||||
|
writeFuns::insert(f, vertLabels);
|
||||||
|
}
|
||||||
|
writeFuns::write(os_, binary_, vertLabels);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,141 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::surfaceMeshWriter
|
||||||
|
|
||||||
|
Description
|
||||||
|
Write faces with fields
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
surfaceMeshWriter.C
|
||||||
|
surfaceMeshWriterTemplates.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef surfaceMeshWriter_H
|
||||||
|
#define surfaceMeshWriter_H
|
||||||
|
|
||||||
|
#include "pointMesh.H"
|
||||||
|
#include "OFstream.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "surfaceFields.H"
|
||||||
|
#include "vtkMesh.H"
|
||||||
|
#include "indirectPrimitivePatch.H"
|
||||||
|
|
||||||
|
using namespace Foam;
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
class volPointInterpolation;
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class surfaceMeshWriter Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class surfaceMeshWriter
|
||||||
|
{
|
||||||
|
const vtkMesh& vMesh_;
|
||||||
|
|
||||||
|
const bool binary_;
|
||||||
|
|
||||||
|
const indirectPrimitivePatch& pp_;
|
||||||
|
|
||||||
|
const fileName fName_;
|
||||||
|
|
||||||
|
std::ofstream os_;
|
||||||
|
|
||||||
|
// label nPoints_;
|
||||||
|
//
|
||||||
|
// label nFaces_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
surfaceMeshWriter
|
||||||
|
(
|
||||||
|
const vtkMesh&,
|
||||||
|
const bool binary,
|
||||||
|
const indirectPrimitivePatch& pp,
|
||||||
|
const word& name,
|
||||||
|
const fileName&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
std::ofstream& os()
|
||||||
|
{
|
||||||
|
return os_;
|
||||||
|
}
|
||||||
|
|
||||||
|
// label nPoints() const
|
||||||
|
// {
|
||||||
|
// return nPoints_;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// label nFaces() const
|
||||||
|
// {
|
||||||
|
// return nFaces_;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //- Write cellIDs
|
||||||
|
// void writePatchIDs();
|
||||||
|
|
||||||
|
//- Extract face data
|
||||||
|
template<class Type>
|
||||||
|
tmp<Field<Type> > getFaceField
|
||||||
|
(
|
||||||
|
const GeometricField<Type, fvsPatchField, surfaceMesh>&
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Write surfaceFields
|
||||||
|
template<class Type>
|
||||||
|
void write
|
||||||
|
(
|
||||||
|
const PtrList<GeometricField<Type, fvsPatchField, surfaceMesh> >&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "surfaceMeshWriterTemplates.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "surfaceMeshWriter.H"
|
||||||
|
#include "writeFuns.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::tmp<Field<Type> > Foam::surfaceMeshWriter::getFaceField
|
||||||
|
(
|
||||||
|
const GeometricField<Type, fvsPatchField, surfaceMesh>& sfld
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const polyBoundaryMesh& patches = sfld.mesh().boundaryMesh();
|
||||||
|
|
||||||
|
tmp<Field<Type> > tfld(new Field<Type>(pp_.size()));
|
||||||
|
Field<Type>& fld = tfld();
|
||||||
|
|
||||||
|
forAll(pp_.addressing(), i)
|
||||||
|
{
|
||||||
|
label faceI = pp_.addressing()[i];
|
||||||
|
|
||||||
|
label patchI = patches.whichPatch(faceI);
|
||||||
|
|
||||||
|
if (patchI == -1)
|
||||||
|
{
|
||||||
|
fld[i] = sfld[faceI];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
label localFaceI = faceI - patches[patchI].start();
|
||||||
|
fld[i] = sfld.boundaryField()[patchI][localFaceI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tfld;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::surfaceMeshWriter::write
|
||||||
|
(
|
||||||
|
const PtrList<GeometricField<Type, fvsPatchField, surfaceMesh> >& sflds
|
||||||
|
)
|
||||||
|
{
|
||||||
|
forAll(sflds, fieldI)
|
||||||
|
{
|
||||||
|
const GeometricField<Type, fvsPatchField, surfaceMesh>& fld =
|
||||||
|
sflds[fieldI];
|
||||||
|
|
||||||
|
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
|
||||||
|
<< pp_.size() << " float" << std::endl;
|
||||||
|
|
||||||
|
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*pp_.size());
|
||||||
|
writeFuns::insert(getFaceField(fld)(), fField);
|
||||||
|
writeFuns::write(os_, binary_, fField);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -7,9 +7,9 @@ then
|
|||||||
case "$ParaView_VERSION" in
|
case "$ParaView_VERSION" in
|
||||||
3* | git)
|
3* | git)
|
||||||
|
|
||||||
if [ ! -d "${PV_PLUGIN_PATH}" ]
|
if [ ! -n "${PV_PLUGIN_PATH}" ]
|
||||||
then
|
then
|
||||||
echo "$0 : PV_PLUGIN_PATH not a valid directory."
|
echo "$0 : PV_PLUGIN_PATH not a valid."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@ -620,6 +620,11 @@ double* Foam::vtkPV3Foam::findTimes(int& nTimeSteps)
|
|||||||
|
|
||||||
void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
|
void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
|
||||||
{
|
{
|
||||||
|
if (!meshPtr_)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// always remove old actors first
|
// always remove old actors first
|
||||||
|
|
||||||
forAll(patchTextActorsPtrs_, patchI)
|
forAll(patchTextActorsPtrs_, patchI)
|
||||||
|
|||||||
@ -804,7 +804,11 @@ Foam::Time& Foam::Time::operator++()
|
|||||||
|
|
||||||
case wcCpuTime:
|
case wcCpuTime:
|
||||||
{
|
{
|
||||||
label outputIndex = label(elapsedCpuTime()/writeInterval_);
|
label outputIndex = label
|
||||||
|
(
|
||||||
|
returnReduce(elapsedCpuTime(), maxOp<double>())
|
||||||
|
/ writeInterval_
|
||||||
|
);
|
||||||
if (outputIndex > outputTimeIndex_)
|
if (outputIndex > outputTimeIndex_)
|
||||||
{
|
{
|
||||||
outputTime_ = true;
|
outputTime_ = true;
|
||||||
@ -819,7 +823,11 @@ Foam::Time& Foam::Time::operator++()
|
|||||||
|
|
||||||
case wcClockTime:
|
case wcClockTime:
|
||||||
{
|
{
|
||||||
label outputIndex = label(elapsedClockTime()/writeInterval_);
|
label outputIndex = label
|
||||||
|
(
|
||||||
|
returnReduce(label(elapsedClockTime()), maxOp<label>())
|
||||||
|
/ writeInterval_
|
||||||
|
);
|
||||||
if (outputIndex > outputTimeIndex_)
|
if (outputIndex > outputTimeIndex_)
|
||||||
{
|
{
|
||||||
outputTime_ = true;
|
outputTime_ = true;
|
||||||
|
|||||||
@ -126,8 +126,6 @@ BINARY_FUNCTION(min)
|
|||||||
BINARY_FUNCTION(cmptMultiply)
|
BINARY_FUNCTION(cmptMultiply)
|
||||||
BINARY_FUNCTION(cmptDivide)
|
BINARY_FUNCTION(cmptDivide)
|
||||||
|
|
||||||
#undef BINARY_FUNCTION
|
|
||||||
|
|
||||||
|
|
||||||
/* * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * */
|
/* * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * */
|
||||||
|
|
||||||
@ -143,10 +141,7 @@ inline void opFunc \
|
|||||||
|
|
||||||
UNARY_OPERATOR(-, negate)
|
UNARY_OPERATOR(-, negate)
|
||||||
|
|
||||||
#undef UNARY_OPERATOR
|
#define BINARY_OPERATOR(Type1, Type2, op, opFunc) \
|
||||||
|
|
||||||
|
|
||||||
#define BINARY_OPERATOR_FF(Type1, Type2, op, opFunc) \
|
|
||||||
\
|
\
|
||||||
template<class Type> \
|
template<class Type> \
|
||||||
inline void opFunc \
|
inline void opFunc \
|
||||||
@ -157,25 +152,11 @@ inline void opFunc \
|
|||||||
) \
|
) \
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#define BINARY_OPERATOR_R(Type1, Type2, op, opFunc) \
|
BINARY_OPERATOR(scalar, Type, *, multiply)
|
||||||
BINARY_OPERATOR_FF(Type1, Type2, op, opFunc)
|
BINARY_OPERATOR(Type, scalar, *, multiply)
|
||||||
|
BINARY_OPERATOR(Type, scalar, /, divide)
|
||||||
|
|
||||||
BINARY_OPERATOR_R(Type, Type, +, add)
|
#define BINARY_TYPE_OPERATOR_SF(TYPE, op, opFunc) \
|
||||||
BINARY_OPERATOR_R(Type, Type, -, subtract)
|
|
||||||
BINARY_OPERATOR_FF(scalar, Type, *, multiply)
|
|
||||||
BINARY_OPERATOR_FF(Type, scalar, /, divide)
|
|
||||||
|
|
||||||
#undef BINARY_OPERATOR_R
|
|
||||||
#undef BINARY_OPERATOR_FF
|
|
||||||
#undef BINARY_OPERATOR_FTR
|
|
||||||
#undef BINARY_OPERATOR_TF
|
|
||||||
#undef BINARY_OPERATOR_TTR
|
|
||||||
#undef BINARY_OPERATOR_FT
|
|
||||||
#undef BINARY_OPERATOR_TRF
|
|
||||||
#undef BINARY_OPERATOR_TRT
|
|
||||||
|
|
||||||
|
|
||||||
#define BINARY_TYPE_OPERATOR_TF(TYPE, op, opFunc) \
|
|
||||||
\
|
\
|
||||||
template<class Type> \
|
template<class Type> \
|
||||||
inline void opFunc \
|
inline void opFunc \
|
||||||
@ -187,7 +168,7 @@ inline void opFunc \
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
#define BINARY_TYPE_OPERATOR_FT(TYPE, op, opFunc) \
|
#define BINARY_TYPE_OPERATOR_FS(TYPE, op, opFunc) \
|
||||||
\
|
\
|
||||||
template<class Type> \
|
template<class Type> \
|
||||||
inline void opFunc \
|
inline void opFunc \
|
||||||
@ -199,19 +180,9 @@ inline void opFunc \
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
#define BINARY_TYPE_OPERATOR(TYPE, op, opFunc) \
|
BINARY_TYPE_OPERATOR_SF(scalar, *, multiply)
|
||||||
BINARY_TYPE_OPERATOR_TF(TYPE, op, opFunc) \
|
BINARY_TYPE_OPERATOR_FS(scalar, *, multiply)
|
||||||
BINARY_TYPE_OPERATOR_FT(TYPE, op, opFunc)
|
BINARY_TYPE_OPERATOR_FS(scalar, /, divide)
|
||||||
|
|
||||||
BINARY_TYPE_OPERATOR(Type, +, add)
|
|
||||||
BINARY_TYPE_OPERATOR(Type, -, subtract)
|
|
||||||
|
|
||||||
BINARY_TYPE_OPERATOR(scalar, *, multiply)
|
|
||||||
BINARY_TYPE_OPERATOR_FT(scalar, /, divide)
|
|
||||||
|
|
||||||
#undef BINARY_TYPE_OPERATOR
|
|
||||||
#undef BINARY_TYPE_OPERATOR_TF
|
|
||||||
#undef BINARY_TYPE_OPERATOR_FT
|
|
||||||
|
|
||||||
|
|
||||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||||
@ -262,6 +233,9 @@ inline void opFunc \
|
|||||||
) \
|
) \
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
PRODUCT_OPERATOR(typeOfSum, +, add)
|
||||||
|
PRODUCT_OPERATOR(typeOfSum, -, subtract)
|
||||||
|
|
||||||
PRODUCT_OPERATOR(outerProduct, *, outer)
|
PRODUCT_OPERATOR(outerProduct, *, outer)
|
||||||
PRODUCT_OPERATOR(crossProduct, ^, cross)
|
PRODUCT_OPERATOR(crossProduct, ^, cross)
|
||||||
PRODUCT_OPERATOR(innerProduct, &, dot)
|
PRODUCT_OPERATOR(innerProduct, &, dot)
|
||||||
@ -367,3 +341,7 @@ inline void eigenVectors
|
|||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "undefFieldFunctionsM.H"
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -127,7 +127,10 @@ bool Foam::solidBodyMotionFunctions::tabulated6DoFMotion::read
|
|||||||
|
|
||||||
// If the timeDataFileName has changed read the file
|
// If the timeDataFileName has changed read the file
|
||||||
|
|
||||||
fileName newTimeDataFileName(SBMFCoeffs_.lookup("timeDataFileName"));
|
fileName newTimeDataFileName
|
||||||
|
(
|
||||||
|
fileName(SBMFCoeffs_.lookup("timeDataFileName")).expand()
|
||||||
|
);
|
||||||
|
|
||||||
if (newTimeDataFileName != timeDataFileName_)
|
if (newTimeDataFileName != timeDataFileName_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -158,6 +158,7 @@ $(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
|
|||||||
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
|
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
|
||||||
$(derivedFvPatchFields)/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
|
||||||
$(derivedFvPatchFields)/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
|
||||||
|
$(derivedFvPatchFields)/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.C
|
||||||
|
|
||||||
|
|
||||||
fvsPatchFields = fields/fvsPatchFields
|
fvsPatchFields = fields/fvsPatchFields
|
||||||
|
|||||||
@ -0,0 +1,190 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "outletMappedUniformInletFvPatchField.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "surfaceFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
outletMappedUniformInletFvPatchField<Type>::
|
||||||
|
outletMappedUniformInletFvPatchField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<Type>(p, iF),
|
||||||
|
outletPatchName_(),
|
||||||
|
phiName_("phi")
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
outletMappedUniformInletFvPatchField<Type>::
|
||||||
|
outletMappedUniformInletFvPatchField
|
||||||
|
(
|
||||||
|
const outletMappedUniformInletFvPatchField<Type>& ptf,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, volMesh>& iF,
|
||||||
|
const fvPatchFieldMapper& mapper
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
||||||
|
outletPatchName_(ptf.outletPatchName_),
|
||||||
|
phiName_(ptf.phiName_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
outletMappedUniformInletFvPatchField<Type>::
|
||||||
|
outletMappedUniformInletFvPatchField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, volMesh>& iF,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<Type>(p, iF, dict),
|
||||||
|
outletPatchName_(dict.lookup("outletPatchName")),
|
||||||
|
phiName_(dict.lookupOrDefault<word>("phi", "phi"))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
outletMappedUniformInletFvPatchField<Type>::
|
||||||
|
outletMappedUniformInletFvPatchField
|
||||||
|
(
|
||||||
|
const outletMappedUniformInletFvPatchField<Type>& ptf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<Type>(ptf),
|
||||||
|
outletPatchName_(ptf.outletPatchName_),
|
||||||
|
phiName_(ptf.phiName_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
outletMappedUniformInletFvPatchField<Type>::
|
||||||
|
outletMappedUniformInletFvPatchField
|
||||||
|
(
|
||||||
|
const outletMappedUniformInletFvPatchField<Type>& ptf,
|
||||||
|
const DimensionedField<Type, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<Type>(ptf, iF),
|
||||||
|
outletPatchName_(ptf.outletPatchName_),
|
||||||
|
phiName_(ptf.phiName_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void outletMappedUniformInletFvPatchField<Type>::updateCoeffs()
|
||||||
|
{
|
||||||
|
if (this->updated())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const GeometricField<Type, fvPatchField, volMesh>& f
|
||||||
|
(
|
||||||
|
dynamic_cast<const GeometricField<Type, fvPatchField, volMesh>&>
|
||||||
|
(
|
||||||
|
this->dimensionedInternalField()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
const fvPatch& p = this->patch();
|
||||||
|
label outletPatchID =
|
||||||
|
p.patch().boundaryMesh().findPatchID(outletPatchName_);
|
||||||
|
|
||||||
|
if (outletPatchID < 0)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"void outletMappedUniformInletFvPatchField<Type>::updateCoeffs()"
|
||||||
|
) << "Unable to find outlet patch " << outletPatchName_
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
const fvPatch& outletPatch = p.boundaryMesh()[outletPatchID];
|
||||||
|
|
||||||
|
const fvPatchField<Type>& outletPatchField =
|
||||||
|
f.boundaryField()[outletPatchID];
|
||||||
|
|
||||||
|
const surfaceScalarField& phi =
|
||||||
|
this->db().objectRegistry::lookupObject<surfaceScalarField>(phiName_);
|
||||||
|
const scalarField& outletPatchPhi = phi.boundaryField()[outletPatchID];
|
||||||
|
scalar sumOutletPatchPhi = gSum(outletPatchPhi);
|
||||||
|
|
||||||
|
if (sumOutletPatchPhi > SMALL)
|
||||||
|
{
|
||||||
|
Type averageOutletField =
|
||||||
|
gSum(outletPatchPhi*outletPatchField)
|
||||||
|
/sumOutletPatchPhi;
|
||||||
|
|
||||||
|
this->operator==(averageOutletField);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Type averageOutletField =
|
||||||
|
gSum(outletPatch.magSf()*outletPatchField)
|
||||||
|
/gSum(outletPatch.magSf());
|
||||||
|
|
||||||
|
this->operator==(averageOutletField);
|
||||||
|
}
|
||||||
|
|
||||||
|
fixedValueFvPatchField<Type>::updateCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void outletMappedUniformInletFvPatchField<Type>::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
fvPatchField<Type>::write(os);
|
||||||
|
os.writeKeyword("outletPatchName")
|
||||||
|
<< outletPatchName_ << token::END_STATEMENT << nl;
|
||||||
|
if (phiName_ != "phi")
|
||||||
|
{
|
||||||
|
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
this->writeEntry("value", os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,169 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::outletMappedUniformInletFvPatchField
|
||||||
|
|
||||||
|
Description
|
||||||
|
Averages the field over the "outlet" patch specified by name
|
||||||
|
"outletPatchName" and applies this as the uniform value of the field
|
||||||
|
over this patch.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
outletMappedUniformInletFvPatchField.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef outletMappedUniformInletFvPatchField_H
|
||||||
|
#define outletMappedUniformInletFvPatchField_H
|
||||||
|
|
||||||
|
#include "fixedValueFvPatchFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class outletMappedUniformInletFvPatch Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
class outletMappedUniformInletFvPatchField
|
||||||
|
:
|
||||||
|
public fixedValueFvPatchField<Type>
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Name of the outlet patch to be mapped
|
||||||
|
word outletPatchName_;
|
||||||
|
|
||||||
|
//- Name of the flux transporting the field
|
||||||
|
word phiName_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("outletMappedUniformInlet");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from patch and internal field
|
||||||
|
outletMappedUniformInletFvPatchField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from patch, internal field and dictionary
|
||||||
|
outletMappedUniformInletFvPatchField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, volMesh>&,
|
||||||
|
const dictionary&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct by mapping given outletMappedUniformInletFvPatchField
|
||||||
|
// onto a new patch
|
||||||
|
outletMappedUniformInletFvPatchField
|
||||||
|
(
|
||||||
|
const outletMappedUniformInletFvPatchField<Type>&,
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, volMesh>&,
|
||||||
|
const fvPatchFieldMapper&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct as copy
|
||||||
|
outletMappedUniformInletFvPatchField
|
||||||
|
(
|
||||||
|
const outletMappedUniformInletFvPatchField<Type>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual tmp<fvPatchField<Type> > clone() const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchField<Type> >
|
||||||
|
(
|
||||||
|
new outletMappedUniformInletFvPatchField<Type>(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Construct as copy setting internal field reference
|
||||||
|
outletMappedUniformInletFvPatchField
|
||||||
|
(
|
||||||
|
const outletMappedUniformInletFvPatchField<Type>&,
|
||||||
|
const DimensionedField<Type, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone setting internal field reference
|
||||||
|
virtual tmp<fvPatchField<Type> > clone
|
||||||
|
(
|
||||||
|
const DimensionedField<Type, volMesh>& iF
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchField<Type> >
|
||||||
|
(
|
||||||
|
new outletMappedUniformInletFvPatchField<Type>(*this, iF)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Name of the outlet patch to be mapped
|
||||||
|
const word& outletPatchName() const
|
||||||
|
{
|
||||||
|
return outletPatchName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Evaluation functions
|
||||||
|
|
||||||
|
//- Update the coefficients associated with the patch field
|
||||||
|
virtual void updateCoeffs();
|
||||||
|
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "outletMappedUniformInletFvPatchField.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -21,42 +21,23 @@ License
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
InClass
|
|
||||||
Foam::writePatchGeom
|
|
||||||
|
|
||||||
Description
|
|
||||||
Write patch geometry to stream
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
writePatchGeom.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef writePatchGeom_H
|
#include "outletMappedUniformInletFvPatchFields.H"
|
||||||
#define writePatchGeom_H
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "volFields.H"
|
||||||
#include "faceList.H"
|
|
||||||
#include "pointField.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Write patch geometry
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
void writePatchGeom
|
|
||||||
(
|
|
||||||
const bool binary,
|
|
||||||
const faceList& faces,
|
|
||||||
const pointField& points,
|
|
||||||
std::ofstream&
|
|
||||||
);
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
|
makePatchFields(outletMappedUniformInlet);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
} // End namespace Foam
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef outletMappedUniformInletFvPatchFields_H
|
||||||
|
#define outletMappedUniformInletFvPatchFields_H
|
||||||
|
|
||||||
|
#include "outletMappedUniformInletFvPatchField.H"
|
||||||
|
#include "fieldTypes.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
makePatchTypeFieldTypedefs(outletMappedUniformInlet)
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -23,60 +23,28 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "writePatchGeom.H"
|
#ifndef outletMappedUniformInletFvPatchFieldsFwd_H
|
||||||
#include "OFstream.H"
|
#define outletMappedUniformInletFvPatchFieldsFwd_H
|
||||||
#include "floatScalar.H"
|
|
||||||
#include "writeFuns.H"
|
#include "fieldTypes.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void writePatchGeom
|
template<class Type> class outletMappedUniformInletFvPatchField;
|
||||||
(
|
|
||||||
const bool binary,
|
|
||||||
const faceList& faces,
|
|
||||||
const pointField& points,
|
|
||||||
std::ofstream& ostr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ostr<< "POINTS " << points.size() << " float" << std::endl;
|
|
||||||
|
|
||||||
DynamicList<floatScalar> ptField(3*points.size());
|
|
||||||
|
|
||||||
writeFuns::insert(points, ptField);
|
|
||||||
|
|
||||||
writeFuns::write(ostr, binary, ptField);
|
|
||||||
|
|
||||||
|
|
||||||
label nFaceVerts = 0;
|
|
||||||
|
|
||||||
forAll(faces, faceI)
|
|
||||||
{
|
|
||||||
nFaceVerts += faces[faceI].size() + 1;
|
|
||||||
}
|
|
||||||
ostr<< "POLYGONS " << faces.size() << ' ' << nFaceVerts << std::endl;
|
|
||||||
|
|
||||||
|
|
||||||
DynamicList<label> vertLabels(nFaceVerts);
|
|
||||||
|
|
||||||
forAll(faces, faceI)
|
|
||||||
{
|
|
||||||
const face& f = faces[faceI];
|
|
||||||
|
|
||||||
vertLabels.append(f.size());
|
|
||||||
|
|
||||||
writeFuns::insert(f, vertLabels);
|
|
||||||
}
|
|
||||||
writeFuns::write(ostr, binary, vertLabels);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
makePatchTypeFieldTypedefs(outletMappedUniformInlet)
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -1,3 +1,3 @@
|
|||||||
300-04-16 T-junction with baffles and fan.
|
2010-04-16 T-junction with baffles and fan.
|
||||||
Inlet on left, one outlet at bottom, one at top.
|
Inlet on left, one outlet at bottom, one at top.
|
||||||
To test multiple outlets.
|
To test multiple outlets.
|
||||||
|
|||||||
Reference in New Issue
Block a user