mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: Partial revert of commit 8ae9569
This commit is contained in:
@ -3,8 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
wmake libso phaseModel
|
wmake libso phaseModel
|
||||||
wmake libso multiphaseSystem
|
|
||||||
wmake libso interfacialModels
|
wmake libso interfacialModels
|
||||||
|
wmake libso multiphaseSystem
|
||||||
wmake libso kineticTheoryModels
|
wmake libso kineticTheoryModels
|
||||||
wmake
|
wmake
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
multiphaseEulerFoam.C
|
multiphaseEulerFoam.C
|
||||||
multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/multiphaseEulerFoam
|
EXE = $(FOAM_APPBIN)/multiphaseEulerFoam
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
EXE_INC = -ggdb3 \
|
EXE_INC = \
|
||||||
-IphaseModel/lnInclude \
|
-IphaseModel/lnInclude \
|
||||||
-ImultiphaseSystem/lnInclude \
|
-ImultiphaseSystem/lnInclude \
|
||||||
/*-IkineticTheoryModels/lnInclude*/ \
|
/*-IkineticTheoryModels/lnInclude*/ \
|
||||||
|
|||||||
@ -33,7 +33,7 @@ forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
|
|||||||
+ (alpha/phase.rho())*fluid.Svm(phase)
|
+ (alpha/phase.rho())*fluid.Svm(phase)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
mrfZones.addCoriolis(UEqns[phasei]);
|
mrfZones.addCoriolis(alpha, UEqns[phasei]);
|
||||||
UEqns[phasei].relax();
|
UEqns[phasei].relax();
|
||||||
|
|
||||||
phasei++;
|
phasei++;
|
||||||
|
|||||||
@ -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
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -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
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
EXE_INC = -ggdb3 \
|
EXE_INC = \
|
||||||
-I../phaseModel/lnInclude \
|
-I../phaseModel/lnInclude \
|
||||||
-I../interfacialModels/lnInclude \
|
-I../interfacialModels/lnInclude \
|
||||||
-IalphaContactAngle \
|
-IalphaContactAngle \
|
||||||
|
|||||||
@ -56,9 +56,6 @@ void Foam::multiphaseSystem::calcAlphas()
|
|||||||
|
|
||||||
void Foam::multiphaseSystem::solveAlphas()
|
void Foam::multiphaseSystem::solveAlphas()
|
||||||
{
|
{
|
||||||
word alphaScheme("div(phi,alpha)");
|
|
||||||
word alpharScheme("div(phirb,alpha)");
|
|
||||||
|
|
||||||
surfaceScalarField phic(mag(phi_/mesh_.magSf()));
|
surfaceScalarField phic(mag(phi_/mesh_.magSf()));
|
||||||
|
|
||||||
PtrList<surfaceScalarField> phiAlphaCorrs(phases_.size());
|
PtrList<surfaceScalarField> phiAlphaCorrs(phases_.size());
|
||||||
@ -67,6 +64,7 @@ void Foam::multiphaseSystem::solveAlphas()
|
|||||||
forAllIter(PtrDictionary<phaseModel>, phases_, iter)
|
forAllIter(PtrDictionary<phaseModel>, phases_, iter)
|
||||||
{
|
{
|
||||||
phaseModel& phase1 = iter();
|
phaseModel& phase1 = iter();
|
||||||
|
volScalarField& alpha1 = phase1;
|
||||||
|
|
||||||
phase1.phiAlpha() =
|
phase1.phiAlpha() =
|
||||||
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0);
|
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0);
|
||||||
@ -80,7 +78,7 @@ void Foam::multiphaseSystem::solveAlphas()
|
|||||||
(
|
(
|
||||||
phi_,
|
phi_,
|
||||||
phase1,
|
phase1,
|
||||||
alphaScheme
|
"div(phi," + alpha1.name() + ')'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -90,6 +88,7 @@ void Foam::multiphaseSystem::solveAlphas()
|
|||||||
forAllIter(PtrDictionary<phaseModel>, phases_, iter2)
|
forAllIter(PtrDictionary<phaseModel>, phases_, iter2)
|
||||||
{
|
{
|
||||||
phaseModel& phase2 = iter2();
|
phaseModel& phase2 = iter2();
|
||||||
|
volScalarField& alpha2 = phase2;
|
||||||
|
|
||||||
if (&phase2 == &phase1) continue;
|
if (&phase2 == &phase1) continue;
|
||||||
|
|
||||||
@ -100,11 +99,16 @@ void Foam::multiphaseSystem::solveAlphas()
|
|||||||
*nHatf(phase1, phase2)
|
*nHatf(phase1, phase2)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
word phirScheme
|
||||||
|
(
|
||||||
|
"div(phir," + alpha2.name() + ',' + alpha1.name() + ')'
|
||||||
|
);
|
||||||
|
|
||||||
phiAlphaCorr += fvc::flux
|
phiAlphaCorr += fvc::flux
|
||||||
(
|
(
|
||||||
-fvc::flux(-phir, phase2, alpharScheme),
|
-fvc::flux(-phir, phase2, phirScheme),
|
||||||
phase1,
|
phase1,
|
||||||
alpharScheme
|
phirScheme
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user