From aa0a47bdfe8967404545ab6532796fdce13e0dc4 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 26 Oct 2012 14:59:34 +0100 Subject: [PATCH] ENH: Updates to jump BCs --- .../jumpCyclic/jumpCyclicFvPatchField.C | 18 ++++++++---------- .../derived/fan/fanFvPatchFields.C | 3 +-- .../derived/fixedJump/fixedJumpFvPatchField.C | 1 - .../uniformJump/uniformJumpFvPatchField.C | 5 ++--- .../uniformJumpAMIFvPatchField.C | 1 - 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C index 67bc7f96db..db6849d267 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C @@ -77,7 +77,6 @@ jumpCyclicFvPatchField::jumpCyclicFvPatchField const jumpCyclicFvPatchField& ptf ) : - cyclicLduInterfaceField(), cyclicFvPatchField(ptf) {} @@ -105,12 +104,11 @@ tmp > jumpCyclicFvPatchField::patchNeighbourField() const tmp > tpnf(new Field(this->size())); Field& pnf = tpnf(); - tmp > tjf = jump(); + Field jf(this->jump()); if (!this->cyclicPatch().owner()) { - tjf = -tjf; + jf *= -1.0; } - const Field& jf = tjf(); if (this->doTransform()) { @@ -152,12 +150,12 @@ void jumpCyclicFvPatchField::updateInterfaceMatrix // for AMG solve - only apply jump to finest level if (psiInternal.size() == this->internalField().size()) { - tmp > tjf = jump()().component(cmpt); + Field jf(this->jump()().component(cmpt)); + if (!this->cyclicPatch().owner()) { - tjf = -tjf; + jf *= -1.0; } - const Field& jf = tjf(); forAll(*this, facei) { @@ -201,12 +199,12 @@ void jumpCyclicFvPatchField::updateInterfaceMatrix // for AMG solve - only apply jump to finest level if (psiInternal.size() == this->internalField().size()) { - tmp > tjf = jump(); + Field jf(this->jump()); + if (!this->cyclicPatch().owner()) { - tjf = -tjf; + jf *= -1.0; } - const Field& jf = tjf(); forAll(*this, facei) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 1c8e934892..668d43483d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -95,11 +95,10 @@ Foam::fanFvPatchField::fanFvPatchField } else { - // Generic input constructed from dictionary + // Dummy jump table this->jumpTable_.reset(new DataEntry("jumpTable")); } - if (dict.found("value")) { fvPatchScalarField::operator= diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index eb997abf36..e58270ec63 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -72,7 +72,6 @@ Foam::fixedJumpFvPatchField::fixedJumpFvPatchField const fixedJumpFvPatchField& ptf ) : - cyclicLduInterfaceField(), jumpCyclicFvPatchField(ptf), jump_(ptf.jump_) {} diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C index 88e7578141..c4ee64eaa8 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C @@ -109,9 +109,9 @@ Foam::tmp > Foam::uniformJumpFvPatchField::jump() const { if (this->cyclicPatch().owner()) { - Type j = jumpTable_->value(this->db().time().value()); + const Type value = jumpTable_->value(this->db().time().value()); - return tmp >(new Field(this->size(), j)); + return tmp >(new Field(this->patch().size(), value)); } else { @@ -134,7 +134,6 @@ void Foam::uniformJumpFvPatchField::write(Ostream& os) const { jumpTable_->writeData(os); } - this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C index cb9ff6cd90..a3e1fe6591 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C @@ -132,7 +132,6 @@ void Foam::uniformJumpAMIFvPatchField::write(Ostream& os) const { jumpTable_->writeData(os); } - this->writeEntry("value", os); }