multiphaseEulerFoam: further updates to the MRF functionality

This commit is contained in:
Henry
2011-09-16 19:18:19 +01:00
parent 41339f7550
commit 72a2f9b45c
9 changed files with 16 additions and 353 deletions

View File

@ -1,3 +1,4 @@
multiphaseEulerFoam.C multiphaseEulerFoam.C
multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C
EXE = $(FOAM_APPBIN)/multiphaseEulerFoam EXE = $(FOAM_APPBIN)/multiphaseEulerFoam

View File

@ -1,6 +1,7 @@
EXE_INC = \ EXE_INC = \
-IphaseModel/lnInclude \ -IphaseModel/lnInclude \
-ImultiphaseSystem/lnInclude \ -ImultiphaseSystem/lnInclude \
-ImultiphaseFixedFluxPressure \
/*-IkineticTheoryModels/lnInclude*/ \ /*-IkineticTheoryModels/lnInclude*/ \
-IinterfacialModels/lnInclude \ -IinterfacialModels/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \

View File

@ -1,2 +1,8 @@
MRFZones mrfZones(mesh); MRFZones mrfZones(mesh);
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
{
mrfZones.correctBoundaryVelocity(iter().U());
}
mrfZones.correctBoundaryVelocity(U); mrfZones.correctBoundaryVelocity(U);

View File

@ -53,12 +53,12 @@
phase.U() = rAUs[phasei]*UEqns[phasei].H(); phase.U() = rAUs[phasei]*UEqns[phasei].H();
mrfZones.absoluteFlux(phase.phi());
phase.phi() = phase.phi() =
( (
(fvc::interpolate(phase.U()) & mesh.Sf()) (fvc::interpolate(phase.U()) & mesh.Sf())
+ fvc::ddtPhiCorr(rAUs[phasei], alpha, phase.U(), phase.phi()) + fvc::ddtPhiCorr(rAUs[phasei], alpha, phase.U(), phase.phi())
); );
mrfZones.relativeFlux(phase.phi()); mrfZones.relativeFlux(phase.phi());
phase.phi() += rAlphaAUfs[phasei]*(g & mesh.Sf()); phase.phi() += rAlphaAUfs[phasei]*(g & mesh.Sf());
@ -241,7 +241,6 @@
} }
} }
phase.U() = fvc::reconstruct(phase.phi());
phase.U().correctBoundaryConditions(); phase.U().correctBoundaryConditions();
U += alpha*phase.U(); U += alpha*phase.U();

View File

@ -127,7 +127,6 @@ $(derivedFvPatchFields)/fan/fanFvPatchFields.C
$(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C $(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C
$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C $(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C $(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C $(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C
$(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C $(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C

View File

@ -1,177 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 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 "multiphaseFixedFluxPressureFvPatchScalarField.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
multiphaseFixedFluxPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(p, iF),
UName_("U"),
phiName_("phi"),
rhoName_("rho")
{}
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
multiphaseFixedFluxPressureFvPatchScalarField
(
const multiphaseFixedFluxPressureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
UName_(ptf.UName_),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_)
{}
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
multiphaseFixedFluxPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedGradientFvPatchScalarField(p, iF),
UName_(dict.lookupOrDefault<word>("U", "U")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{
if (dict.found("gradient"))
{
gradient() = scalarField("gradient", dict, p.size());
fixedGradientFvPatchScalarField::updateCoeffs();
fixedGradientFvPatchScalarField::evaluate();
}
else
{
fvPatchField<scalar>::operator=(patchInternalField());
gradient() = 0.0;
}
}
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
multiphaseFixedFluxPressureFvPatchScalarField
(
const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf
)
:
fixedGradientFvPatchScalarField(wbppsf),
UName_(wbppsf.UName_),
phiName_(wbppsf.phiName_),
rhoName_(wbppsf.rhoName_)
{}
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
multiphaseFixedFluxPressureFvPatchScalarField
(
const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(wbppsf, iF),
UName_(wbppsf.UName_),
phiName_(wbppsf.phiName_),
rhoName_(wbppsf.rhoName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::multiphaseFixedFluxPressureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const fvPatchField<vector>& Up =
patch().lookupPatchField<volVectorField, vector>(UName_);
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
fvsPatchField<scalar> phip =
patch().patchField<surfaceScalarField, scalar>(phi);
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
phip /= rhop;
}
const fvsPatchField<scalar>& Dpp =
patch().lookupPatchField<surfaceScalarField, scalar>("Dp");
gradient() = (phip - (patch().Sf() & Up))/patch().magSf()/Dpp;
fixedGradientFvPatchScalarField::updateCoeffs();
}
void Foam::multiphaseFixedFluxPressureFvPatchScalarField::write
(
Ostream& os
) const
{
fvPatchScalarField::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
gradient().writeEntry("gradient", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
multiphaseFixedFluxPressureFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -1,154 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 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/>.
Class
Foam::multiphaseFixedFluxPressureFvPatchScalarField
Description
Foam::multiphaseFixedFluxPressureFvPatchScalarField
SourceFiles
multiphaseFixedFluxPressureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef multiphaseFixedFluxPressureFvPatchScalarFields_H
#define multiphaseFixedFluxPressureFvPatchScalarFields_H
#include "fvPatchFields.H"
#include "fixedGradientFvPatchFields.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class multiphaseFixedFluxPressureFvPatch Declaration
\*---------------------------------------------------------------------------*/
class multiphaseFixedFluxPressureFvPatchScalarField
:
public fixedGradientFvPatchScalarField
{
// Private data
//- Name of the velocity field
word UName_;
//- Name of the flux transporting the field
word phiName_;
//- Name of the density field used to normalise the mass flux
// if neccessary
word rhoName_;
public:
//- Runtime type information
TypeName("multiphaseFixedFluxPressure");
// Constructors
//- Construct from patch and internal field
multiphaseFixedFluxPressureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
multiphaseFixedFluxPressureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// multiphaseFixedFluxPressureFvPatchScalarField onto a new patch
multiphaseFixedFluxPressureFvPatchScalarField
(
const multiphaseFixedFluxPressureFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
multiphaseFixedFluxPressureFvPatchScalarField
(
const multiphaseFixedFluxPressureFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new multiphaseFixedFluxPressureFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
multiphaseFixedFluxPressureFvPatchScalarField
(
const multiphaseFixedFluxPressureFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new multiphaseFixedFluxPressureFvPatchScalarField(*this, iF)
);
}
// Member functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -97,18 +97,12 @@ PIMPLE
relaxationFactors relaxationFactors
{ {
fields "U.*" 1;
{ "T.*" 1;
} "alpha.*" 1;
equations "Theta.*" 1;
{ "k.*" 1;
"U.*" 1; "epsilon.*" 1;
"T.*" 1;
"alpha.*" 1;
"Theta.*" 1;
"k.*" 1;
"epsilon.*" 1;
}
} }

View File

@ -88,13 +88,7 @@ PIMPLE
relaxationFactors relaxationFactors
{ {
fields "U.*" 1;
{
}
equations
{
"U.*" 1;
}
} }
// ************************************************************************* // // ************************************************************************* //