Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry
2012-09-13 11:26:06 +01:00
2 changed files with 20 additions and 44 deletions

View File

@ -307,9 +307,7 @@ void Foam::MRFZone::addCoriolis
vectorField& ddtUc = ddtU.internalField(); vectorField& ddtUc = ddtU.internalField();
const vectorField& Uc = U.internalField(); const vectorField& Uc = U.internalField();
const scalar t = mesh_.time().timeOutputValue(); const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const vector& Omega = omega_->value(t)*axis_;
forAll(cells, i) forAll(cells, i)
{ {
@ -331,9 +329,7 @@ void Foam::MRFZone::addCoriolis(fvVectorMatrix& UEqn) const
vectorField& Usource = UEqn.source(); vectorField& Usource = UEqn.source();
const vectorField& U = UEqn.psi(); const vectorField& U = UEqn.psi();
const scalar t = mesh_.time().timeOutputValue(); const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const vector& Omega = omega_->value(t)*axis_;
forAll(cells, i) forAll(cells, i)
{ {
@ -359,9 +355,7 @@ void Foam::MRFZone::addCoriolis
vectorField& Usource = UEqn.source(); vectorField& Usource = UEqn.source();
const vectorField& U = UEqn.psi(); const vectorField& U = UEqn.psi();
const scalar t = mesh_.time().timeOutputValue(); const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const vector& Omega = omega_->value(t)*axis_;
forAll(cells, i) forAll(cells, i)
{ {
@ -375,18 +369,14 @@ void Foam::MRFZone::relativeVelocity(volVectorField& U) const
{ {
const volVectorField& C = mesh_.C(); const volVectorField& C = mesh_.C();
const vector& origin = origin_; const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const scalar t = mesh_.time().timeOutputValue();
const vector& Omega = omega_->value(t)*axis_;
const labelList& cells = mesh_.cellZones()[cellZoneID_]; const labelList& cells = mesh_.cellZones()[cellZoneID_];
forAll(cells, i) forAll(cells, i)
{ {
label celli = cells[i]; label celli = cells[i];
U[celli] -= (Omega ^ (C[celli] - origin)); U[celli] -= (Omega ^ (C[celli] - origin_));
} }
// Included patches // Included patches
@ -407,7 +397,7 @@ void Foam::MRFZone::relativeVelocity(volVectorField& U) const
label patchFacei = excludedFaces_[patchi][i]; label patchFacei = excludedFaces_[patchi][i];
U.boundaryField()[patchi][patchFacei] -= U.boundaryField()[patchi][patchFacei] -=
(Omega (Omega
^ (C.boundaryField()[patchi][patchFacei] - origin)); ^ (C.boundaryField()[patchi][patchFacei] - origin_));
} }
} }
} }
@ -417,18 +407,14 @@ void Foam::MRFZone::absoluteVelocity(volVectorField& U) const
{ {
const volVectorField& C = mesh_.C(); const volVectorField& C = mesh_.C();
const vector& origin = origin_; const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const scalar t = mesh_.time().timeOutputValue();
const vector& Omega = omega_->value(t)*axis_;
const labelList& cells = mesh_.cellZones()[cellZoneID_]; const labelList& cells = mesh_.cellZones()[cellZoneID_];
forAll(cells, i) forAll(cells, i)
{ {
label celli = cells[i]; label celli = cells[i];
U[celli] += (Omega ^ (C[celli] - origin)); U[celli] += (Omega ^ (C[celli] - origin_));
} }
// Included patches // Included patches
@ -438,7 +424,7 @@ void Foam::MRFZone::absoluteVelocity(volVectorField& U) const
{ {
label patchFacei = includedFaces_[patchi][i]; label patchFacei = includedFaces_[patchi][i];
U.boundaryField()[patchi][patchFacei] = U.boundaryField()[patchi][patchFacei] =
(Omega ^ (C.boundaryField()[patchi][patchFacei] - origin)); (Omega ^ (C.boundaryField()[patchi][patchFacei] - origin_));
} }
} }
@ -449,7 +435,7 @@ void Foam::MRFZone::absoluteVelocity(volVectorField& U) const
{ {
label patchFacei = excludedFaces_[patchi][i]; label patchFacei = excludedFaces_[patchi][i];
U.boundaryField()[patchi][patchFacei] += U.boundaryField()[patchi][patchFacei] +=
(Omega ^ (C.boundaryField()[patchi][patchFacei] - origin)); (Omega ^ (C.boundaryField()[patchi][patchFacei] - origin_));
} }
} }
} }
@ -489,11 +475,7 @@ void Foam::MRFZone::absoluteFlux
void Foam::MRFZone::correctBoundaryVelocity(volVectorField& U) const void Foam::MRFZone::correctBoundaryVelocity(volVectorField& U) const
{ {
const vector& origin = origin_; const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const scalar t = mesh_.time().timeOutputValue();
const vector& Omega = omega_->value(t)*axis_;
// Included patches // Included patches
@ -507,7 +489,7 @@ void Foam::MRFZone::correctBoundaryVelocity(volVectorField& U) const
{ {
label patchFacei = includedFaces_[patchi][i]; label patchFacei = includedFaces_[patchi][i];
pfld[patchFacei] = (Omega ^ (patchC[patchFacei] - origin)); pfld[patchFacei] = (Omega ^ (patchC[patchFacei] - origin_));
} }
U.boundaryField()[patchi] == pfld; U.boundaryField()[patchi] == pfld;

View File

@ -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-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -41,10 +41,7 @@ void Foam::MRFZone::relativeRhoFlux
const surfaceVectorField& Cf = mesh_.Cf(); const surfaceVectorField& Cf = mesh_.Cf();
const surfaceVectorField& Sf = mesh_.Sf(); const surfaceVectorField& Sf = mesh_.Sf();
const vector& origin = origin_; const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const scalar t = mesh_.time().timeOutputValue();
const vector& Omega = omega_->value(t)*axis_;
const vectorField& Cfi = Cf.internalField(); const vectorField& Cfi = Cf.internalField();
const vectorField& Sfi = Sf.internalField(); const vectorField& Sfi = Sf.internalField();
@ -54,7 +51,7 @@ void Foam::MRFZone::relativeRhoFlux
forAll(internalFaces_, i) forAll(internalFaces_, i)
{ {
label facei = internalFaces_[i]; label facei = internalFaces_[i];
phii[facei] -= rho[facei]*(Omega ^ (Cfi[facei] - origin)) & Sfi[facei]; phii[facei] -= rho[facei]*(Omega ^ (Cfi[facei] - origin_)) & Sfi[facei];
} }
// Included patches // Included patches
@ -77,7 +74,7 @@ void Foam::MRFZone::relativeRhoFlux
phi.boundaryField()[patchi][patchFacei] -= phi.boundaryField()[patchi][patchFacei] -=
rho.boundaryField()[patchi][patchFacei] rho.boundaryField()[patchi][patchFacei]
* (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin)) * (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin_))
& Sf.boundaryField()[patchi][patchFacei]; & Sf.boundaryField()[patchi][patchFacei];
} }
} }
@ -94,10 +91,7 @@ void Foam::MRFZone::absoluteRhoFlux
const surfaceVectorField& Cf = mesh_.Cf(); const surfaceVectorField& Cf = mesh_.Cf();
const surfaceVectorField& Sf = mesh_.Sf(); const surfaceVectorField& Sf = mesh_.Sf();
const vector& origin = origin_; const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
const scalar t = mesh_.time().timeOutputValue();
const vector& Omega = omega_->value(t)*axis_;
const vectorField& Cfi = Cf.internalField(); const vectorField& Cfi = Cf.internalField();
const vectorField& Sfi = Sf.internalField(); const vectorField& Sfi = Sf.internalField();
@ -107,7 +101,7 @@ void Foam::MRFZone::absoluteRhoFlux
forAll(internalFaces_, i) forAll(internalFaces_, i)
{ {
label facei = internalFaces_[i]; label facei = internalFaces_[i];
phii[facei] += rho[facei]*(Omega ^ (Cfi[facei] - origin)) & Sfi[facei]; phii[facei] += rho[facei]*(Omega ^ (Cfi[facei] - origin_)) & Sfi[facei];
} }
// Included patches // Included patches
@ -119,7 +113,7 @@ void Foam::MRFZone::absoluteRhoFlux
phi.boundaryField()[patchi][patchFacei] += phi.boundaryField()[patchi][patchFacei] +=
rho.boundaryField()[patchi][patchFacei] rho.boundaryField()[patchi][patchFacei]
* (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin)) * (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin_))
& Sf.boundaryField()[patchi][patchFacei]; & Sf.boundaryField()[patchi][patchFacei];
} }
} }
@ -133,7 +127,7 @@ void Foam::MRFZone::absoluteRhoFlux
phi.boundaryField()[patchi][patchFacei] += phi.boundaryField()[patchi][patchFacei] +=
rho.boundaryField()[patchi][patchFacei] rho.boundaryField()[patchi][patchFacei]
* (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin)) * (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin_))
& Sf.boundaryField()[patchi][patchFacei]; & Sf.boundaryField()[patchi][patchFacei];
} }
} }