Added evaluation of turbulence boundary conditions after topo change: attach/detach bug

This commit is contained in:
Hrvoje Jasak 2011-02-25 12:12:56 +00:00
parent 05a5894871
commit bcb7c3e5d9
25 changed files with 206 additions and 10 deletions

View file

@ -321,6 +321,14 @@ bool LRR::read()
void LRR::correct() void LRR::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
if (!turbulence_) if (!turbulence_)
{ {
// Re-calculate viscosity // Re-calculate viscosity
@ -339,7 +347,7 @@ void LRR::correct()
volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_));
volScalarField G("RASModel::G", 0.5*mag(tr(P))); volScalarField G("RASModel::G", 0.5*mag(tr(P)));
// Update espsilon and G at the wall // Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// Dissipation equation // Dissipation equation

View file

@ -354,6 +354,14 @@ bool LaunderGibsonRSTM::read()
void LaunderGibsonRSTM::correct() void LaunderGibsonRSTM::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
if (!turbulence_) if (!turbulence_)
{ {
// Re-calculate viscosity // Re-calculate viscosity
@ -377,7 +385,7 @@ void LaunderGibsonRSTM::correct()
volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_));
volScalarField G("RASModel::G", 0.5*mag(tr(P))); volScalarField G("RASModel::G", 0.5*mag(tr(P)));
// Update espsilon and G at the wall // Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// Dissipation equation // Dissipation equation

View file

@ -272,6 +272,14 @@ bool LaunderSharmaKE::read()
void LaunderSharmaKE::correct() void LaunderSharmaKE::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
if (!turbulence_) if (!turbulence_)
{ {
// Re-calculate viscosity // Re-calculate viscosity

View file

@ -273,6 +273,14 @@ bool RNGkEpsilon::read()
void RNGkEpsilon::correct() void RNGkEpsilon::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
if (!turbulence_) if (!turbulence_)
{ {
// Re-calculate viscosity // Re-calculate viscosity
@ -307,7 +315,7 @@ void RNGkEpsilon::correct()
volScalarField R = volScalarField R =
((eta*(-eta/eta0_ + scalar(1)))/(beta_*eta3 + scalar(1))); ((eta*(-eta/eta0_ + scalar(1)))/(beta_*eta3 + scalar(1)));
// Update espsilon and G at the wall // Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// Dissipation equation // Dissipation equation

View file

@ -328,6 +328,13 @@ bool SpalartAllmaras::read()
void SpalartAllmaras::correct() void SpalartAllmaras::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0));
}
if (!turbulence_) if (!turbulence_)
{ {
// Re-calculate viscosity // Re-calculate viscosity

View file

@ -254,6 +254,14 @@ bool kEpsilon::read()
void kEpsilon::correct() void kEpsilon::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
if (!turbulence_) if (!turbulence_)
{ {
// Re-calculate viscosity // Re-calculate viscosity
@ -280,7 +288,7 @@ void kEpsilon::correct()
volScalarField G("RASModel::G", mut_*(tgradU() && dev(twoSymm(tgradU())))); volScalarField G("RASModel::G", mut_*(tgradU() && dev(twoSymm(tgradU()))));
tgradU.clear(); tgradU.clear();
// Update espsilon and G at the wall // Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// Dissipation equation // Dissipation equation

View file

@ -358,6 +358,14 @@ bool kOmegaSST::read()
void kOmegaSST::correct() void kOmegaSST::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(omega_, omega0_);
}
if (!turbulence_) if (!turbulence_)
{ {
// Re-calculate viscosity // Re-calculate viscosity

View file

@ -378,6 +378,14 @@ bool kOmegaSST_LowRe::read()
void kOmegaSST_LowRe::correct() void kOmegaSST_LowRe::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(omega_, omega0_);
}
if (!turbulence_) if (!turbulence_)
{ {
// Re-calculate viscosity // Re-calculate viscosity

View file

@ -287,6 +287,14 @@ bool realizableKE::read()
void realizableKE::correct() void realizableKE::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
if (!turbulence_) if (!turbulence_)
{ {
// Re-calculate viscosity // Re-calculate viscosity
@ -318,7 +326,7 @@ void realizableKE::correct()
volScalarField G("RASModel::G", mut_*(gradU && dev(twoSymm(gradU)))); volScalarField G("RASModel::G", mut_*(gradU && dev(twoSymm(gradU))));
// Update espsilon and G at the wall // Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// Dissipation equation // Dissipation equation

View file

@ -289,6 +289,14 @@ bool LRR::read()
void LRR::correct() void LRR::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
R_.correctBoundaryConditions();
bound(epsilon_, epsilon0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)
@ -299,7 +307,7 @@ void LRR::correct()
volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_));
volScalarField G("RASModel::G", 0.5*mag(tr(P))); volScalarField G("RASModel::G", 0.5*mag(tr(P)));
// Update espsilon and G at the wall // Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// Dissipation equation // Dissipation equation

View file

@ -220,6 +220,14 @@ bool LamBremhorstKE::read()
void LamBremhorstKE::correct() void LamBremhorstKE::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)

View file

@ -325,6 +325,14 @@ bool LaunderGibsonRSTM::read()
void LaunderGibsonRSTM::correct() void LaunderGibsonRSTM::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
R_.correctBoundaryConditions();
bound(epsilon_, epsilon0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)
@ -340,7 +348,7 @@ void LaunderGibsonRSTM::correct()
volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_));
volScalarField G("RASModel::G", 0.5*mag(tr(P))); volScalarField G("RASModel::G", 0.5*mag(tr(P)));
// Update espsilon and G at the wall // Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// Dissipation equation // Dissipation equation

View file

@ -226,6 +226,14 @@ bool LaunderSharmaKE::read()
void LaunderSharmaKE::correct() void LaunderSharmaKE::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilonTilda_, epsilon0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)

View file

@ -313,6 +313,14 @@ bool LienCubicKE::read()
void LienCubicKE::correct() void LienCubicKE::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)
@ -331,7 +339,7 @@ void LienCubicKE::correct()
Cmu_*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_) Cmu_*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_)
); );
// Update espsilon and G at the wall // Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// Dissipation equation // Dissipation equation

View file

@ -384,6 +384,14 @@ bool LienCubicKELowRe::read()
void LienCubicKELowRe::correct() void LienCubicKELowRe::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)

View file

@ -270,6 +270,14 @@ bool LienLeschzinerLowRe::read()
void LienLeschzinerLowRe::correct() void LienLeschzinerLowRe::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)

View file

@ -306,6 +306,14 @@ bool NonlinearKEShih::read()
void NonlinearKEShih::correct() void NonlinearKEShih::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)

View file

@ -239,6 +239,14 @@ bool RNGkEpsilon::read()
void RNGkEpsilon::correct() void RNGkEpsilon::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)
@ -254,7 +262,7 @@ void RNGkEpsilon::correct()
volScalarField R = volScalarField R =
((eta*(scalar(1) - eta/eta0_))/(scalar(1) + beta_*eta*sqr(eta))); ((eta*(scalar(1) - eta/eta0_))/(scalar(1) + beta_*eta*sqr(eta)));
// Update espsilon and G at the wall // Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// Dissipation equation // Dissipation equation

View file

@ -348,6 +348,11 @@ bool SpalartAllmaras::read()
void SpalartAllmaras::correct() void SpalartAllmaras::correct()
{ {
if (mesh_.changing())
{
bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0));
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)

View file

@ -208,6 +208,14 @@ bool kEpsilon::read()
void kEpsilon::correct() void kEpsilon::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)
@ -217,7 +225,7 @@ void kEpsilon::correct()
volScalarField G("RASModel::G", nut_*2*magSqr(symm(fvc::grad(U_)))); volScalarField G("RASModel::G", nut_*2*magSqr(symm(fvc::grad(U_))));
// Update espsilon and G at the wall // Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// Dissipation equation // Dissipation equation

View file

@ -217,6 +217,14 @@ bool kOmega::read()
void kOmega::correct() void kOmega::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(omega_, omega0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)

View file

@ -325,6 +325,14 @@ bool kOmegaSST::read()
void kOmegaSST::correct() void kOmegaSST::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(omega_, omega0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)

View file

@ -346,6 +346,14 @@ bool kOmegaSST_LowRe::read()
void kOmegaSST_LowRe::correct() void kOmegaSST_LowRe::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(omega_, omega0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)

View file

@ -274,6 +274,14 @@ bool qZeta::read()
void qZeta::correct() void qZeta::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(q_, sqrt(k0_));
bound(zeta_, epsilon0_/(2*sqrt(k0_)));
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)

View file

@ -262,6 +262,14 @@ bool realizableKE::read()
void realizableKE::correct() void realizableKE::correct()
{ {
// Bound in case of topological change
// HJ, 22/Aug/2007
if (mesh_.changing())
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
}
RASModel::correct(); RASModel::correct();
if (!turbulence_) if (!turbulence_)