Skip to content
Snippets Groups Projects
Commit 26d6f801 authored by andy's avatar andy
Browse files

ENH: Updated fixedJump BCs to enable general types (was only for scalar)

parent f582fab6
Branches
Tags
No related merge requests found
......@@ -122,6 +122,7 @@ $(derivedFvPatchFields)/fan/fanFvPatchFields.C
$(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/fixedJump/fixedJumpFvPatchFields.C
$(derivedFvPatchFields)/fixedJumpAMI/fixedJumpAMIFvPatchFields.C
$(derivedFvPatchFields)/fixedMean/fixedMeanFvPatchFields.C
$(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C
......
......@@ -105,12 +105,12 @@ tmp<Field<Type> > jumpCyclicFvPatchField<Type>::patchNeighbourField() const
tmp<Field<Type> > tpnf(new Field<Type>(this->size()));
Field<Type>& pnf = tpnf();
tmp<Field<scalar> > tjf = jump();
tmp<Field<Type> > tjf = jump();
if (!this->cyclicPatch().owner())
{
tjf = -tjf;
}
const Field<scalar>& jf = tjf();
const Field<Type>& jf = tjf();
if (this->doTransform())
{
......@@ -149,7 +149,8 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
const labelUList& nbrFaceCells =
this->cyclicPatch().neighbFvPatch().faceCells();
if (&psiInternal == &this->internalField())
// for AMG solve - only apply jump to finest level
if (psiInternal.size() == this->internalField().size())
{
tmp<Field<scalar> > tjf = jump()().component(cmpt);
if (!this->cyclicPatch().owner())
......@@ -197,7 +198,8 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
const labelUList& nbrFaceCells =
this->cyclicPatch().neighbFvPatch().faceCells();
if (&psiInternal == &this->internalField())
// for AMG solve - only apply jump to finest level
if (psiInternal.size() == this->internalField().size())
{
tmp<Field<Type> > tjf = jump();
if (!this->cyclicPatch().owner())
......
......@@ -72,6 +72,9 @@ protected:
public:
//- Runtime type information
TypeName("fixedJump");
// Constructors
//- Construct from patch and internal field
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "fixedJumpFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(fixedJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpFvPatchFields_H
#define fixedJumpFvPatchFields_H
#include "fixedJumpFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(fixedJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpFvPatchFieldsFwd_H
#define fixedJumpFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class fixedJumpFvPatchField;
makePatchTypeFieldTypedefs(fixedJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment