mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
fvPatchFields: Rationalized the construction of DataEntry values
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -60,9 +60,9 @@ cylindricalInletVelocityFvPatchVectorField
|
||||
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
|
||||
centre_(ptf.centre_),
|
||||
axis_(ptf.axis_),
|
||||
axialVelocity_(ptf.axialVelocity_().clone().ptr()),
|
||||
radialVelocity_(ptf.radialVelocity_().clone().ptr()),
|
||||
rpm_(ptf.rpm_().clone().ptr())
|
||||
axialVelocity_(ptf.axialVelocity_, false),
|
||||
radialVelocity_(ptf.radialVelocity_, false),
|
||||
rpm_(ptf.rpm_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -92,9 +92,9 @@ cylindricalInletVelocityFvPatchVectorField
|
||||
fixedValueFvPatchField<vector>(ptf),
|
||||
centre_(ptf.centre_),
|
||||
axis_(ptf.axis_),
|
||||
axialVelocity_(ptf.axialVelocity_().clone().ptr()),
|
||||
radialVelocity_(ptf.radialVelocity_().clone().ptr()),
|
||||
rpm_(ptf.rpm_().clone().ptr())
|
||||
axialVelocity_(ptf.axialVelocity_, false),
|
||||
radialVelocity_(ptf.radialVelocity_, false),
|
||||
rpm_(ptf.rpm_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -108,9 +108,9 @@ cylindricalInletVelocityFvPatchVectorField
|
||||
fixedValueFvPatchField<vector>(ptf, iF),
|
||||
centre_(ptf.centre_),
|
||||
axis_(ptf.axis_),
|
||||
axialVelocity_(ptf.axialVelocity_().clone().ptr()),
|
||||
radialVelocity_(ptf.radialVelocity_().clone().ptr()),
|
||||
rpm_(ptf.rpm_().clone().ptr())
|
||||
axialVelocity_(ptf.axialVelocity_, false),
|
||||
radialVelocity_(ptf.radialVelocity_, false),
|
||||
rpm_(ptf.rpm_, false)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -42,6 +42,32 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
||||
{}
|
||||
|
||||
|
||||
Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedGradientFvPatchScalarField(p, iF),
|
||||
curTimeIndex_(-1)
|
||||
{
|
||||
if (dict.found("value") && dict.found("gradient"))
|
||||
{
|
||||
fvPatchField<scalar>::operator=
|
||||
(
|
||||
scalarField("value", dict, p.size())
|
||||
);
|
||||
gradient() = scalarField("gradient", dict, p.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
fvPatchField<scalar>::operator=(patchInternalField());
|
||||
gradient() = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
||||
(
|
||||
const fixedFluxPressureFvPatchScalarField& ptf,
|
||||
@ -73,32 +99,6 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
||||
}
|
||||
|
||||
|
||||
Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedGradientFvPatchScalarField(p, iF),
|
||||
curTimeIndex_(-1)
|
||||
{
|
||||
if (dict.found("value") && dict.found("gradient"))
|
||||
{
|
||||
fvPatchField<scalar>::operator=
|
||||
(
|
||||
scalarField("value", dict, p.size())
|
||||
);
|
||||
gradient() = scalarField("gradient", dict, p.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
fvPatchField<scalar>::operator=(patchInternalField());
|
||||
gradient() = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
||||
(
|
||||
const fixedFluxPressureFvPatchScalarField& wbppsf
|
||||
|
||||
@ -56,7 +56,7 @@ flowRateInletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
|
||||
flowRate_(ptf.flowRate_().clone().ptr()),
|
||||
flowRate_(ptf.flowRate_, false),
|
||||
volumetric_(ptf.volumetric_),
|
||||
rhoName_(ptf.rhoName_),
|
||||
rhoInlet_(ptf.rhoInlet_)
|
||||
@ -117,7 +117,7 @@ flowRateInletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf),
|
||||
flowRate_(ptf.flowRate_().clone().ptr()),
|
||||
flowRate_(ptf.flowRate_, false),
|
||||
volumetric_(ptf.volumetric_),
|
||||
rhoName_(ptf.rhoName_),
|
||||
rhoInlet_(ptf.rhoInlet_)
|
||||
@ -132,7 +132,7 @@ flowRateInletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf, iF),
|
||||
flowRate_(ptf.flowRate_().clone().ptr()),
|
||||
flowRate_(ptf.flowRate_, false),
|
||||
volumetric_(ptf.volumetric_),
|
||||
rhoName_(ptf.rhoName_),
|
||||
rhoInlet_(ptf.rhoInlet_)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -74,8 +74,8 @@ oscillatingFixedValueFvPatchField<Type>::oscillatingFixedValueFvPatchField
|
||||
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
||||
refValue_(ptf.refValue_, mapper),
|
||||
offset_(ptf.offset_),
|
||||
amplitude_(ptf.amplitude_().clone().ptr()),
|
||||
frequency_(ptf.frequency_().clone().ptr()),
|
||||
amplitude_(ptf.amplitude_, false),
|
||||
frequency_(ptf.frequency_, false),
|
||||
curTimeIndex_(-1)
|
||||
{}
|
||||
|
||||
@ -122,8 +122,8 @@ oscillatingFixedValueFvPatchField<Type>::oscillatingFixedValueFvPatchField
|
||||
fixedValueFvPatchField<Type>(ptf),
|
||||
refValue_(ptf.refValue_),
|
||||
offset_(ptf.offset_),
|
||||
amplitude_(ptf.amplitude_().clone().ptr()),
|
||||
frequency_(ptf.frequency_().clone().ptr()),
|
||||
amplitude_(ptf.amplitude_, false),
|
||||
frequency_(ptf.frequency_, false),
|
||||
curTimeIndex_(-1)
|
||||
{}
|
||||
|
||||
@ -138,8 +138,8 @@ oscillatingFixedValueFvPatchField<Type>::oscillatingFixedValueFvPatchField
|
||||
fixedValueFvPatchField<Type>(ptf, iF),
|
||||
refValue_(ptf.refValue_),
|
||||
offset_(ptf.offset_),
|
||||
amplitude_(ptf.amplitude_().clone().ptr()),
|
||||
frequency_(ptf.frequency_().clone().ptr()),
|
||||
amplitude_(ptf.amplitude_, false),
|
||||
frequency_(ptf.frequency_, false),
|
||||
curTimeIndex_(-1)
|
||||
{}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -71,7 +71,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
pressureInletOutletVelocityFvPatchVectorField(ptf, p, iF, mapper),
|
||||
omega_(ptf.omega_().clone().ptr())
|
||||
omega_(ptf.omega_, false)
|
||||
{
|
||||
calcTangentialVelocity();
|
||||
}
|
||||
@ -99,7 +99,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
pressureInletOutletVelocityFvPatchVectorField(rppvf),
|
||||
omega_(rppvf.omega_().clone().ptr())
|
||||
omega_(rppvf.omega_, false)
|
||||
{
|
||||
calcTangentialVelocity();
|
||||
}
|
||||
@ -113,7 +113,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
pressureInletOutletVelocityFvPatchVectorField(rppvf, iF),
|
||||
omega_(rppvf.omega_().clone().ptr())
|
||||
omega_(rppvf.omega_, false)
|
||||
{
|
||||
calcTangentialVelocity();
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -53,7 +53,7 @@ rotatingTotalPressureFvPatchScalarField
|
||||
)
|
||||
:
|
||||
totalPressureFvPatchScalarField(ptf, p, iF, mapper),
|
||||
omega_(ptf.omega_().clone().ptr())
|
||||
omega_(ptf.omega_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ rotatingTotalPressureFvPatchScalarField
|
||||
)
|
||||
:
|
||||
totalPressureFvPatchScalarField(rtppsf),
|
||||
omega_(rtppsf.omega_().clone().ptr())
|
||||
omega_(rtppsf.omega_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ rotatingTotalPressureFvPatchScalarField
|
||||
)
|
||||
:
|
||||
totalPressureFvPatchScalarField(rtppsf, iF),
|
||||
omega_(rtppsf.omega_().clone().ptr())
|
||||
omega_(rtppsf.omega_, false)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -56,7 +56,7 @@ rotatingWallVelocityFvPatchVectorField
|
||||
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
|
||||
origin_(ptf.origin_),
|
||||
axis_(ptf.axis_),
|
||||
omega_(ptf.omega_().clone().ptr())
|
||||
omega_(ptf.omega_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ rotatingWallVelocityFvPatchVectorField
|
||||
fixedValueFvPatchField<vector>(rwvpvf),
|
||||
origin_(rwvpvf.origin_),
|
||||
axis_(rwvpvf.axis_),
|
||||
omega_(rwvpvf.omega_().clone().ptr())
|
||||
omega_(rwvpvf.omega_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ rotatingWallVelocityFvPatchVectorField
|
||||
fixedValueFvPatchField<vector>(rwvpvf, iF),
|
||||
origin_(rwvpvf.origin_),
|
||||
axis_(rwvpvf.axis_),
|
||||
omega_(rwvpvf.omega_().clone().ptr())
|
||||
omega_(rwvpvf.omega_, false)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -59,8 +59,8 @@ swirlFlowRateInletVelocityFvPatchVectorField
|
||||
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
|
||||
phiName_(ptf.phiName_),
|
||||
rhoName_(ptf.rhoName_),
|
||||
flowRate_(ptf.flowRate_().clone().ptr()),
|
||||
rpm_(ptf.rpm_().clone().ptr())
|
||||
flowRate_(ptf.flowRate_, false),
|
||||
rpm_(ptf.rpm_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -89,8 +89,8 @@ swirlFlowRateInletVelocityFvPatchVectorField
|
||||
fixedValueFvPatchField<vector>(ptf),
|
||||
phiName_(ptf.phiName_),
|
||||
rhoName_(ptf.rhoName_),
|
||||
flowRate_(ptf.flowRate_().clone().ptr()),
|
||||
rpm_(ptf.rpm_().clone().ptr())
|
||||
flowRate_(ptf.flowRate_, false),
|
||||
rpm_(ptf.rpm_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -104,8 +104,8 @@ swirlFlowRateInletVelocityFvPatchVectorField
|
||||
fixedValueFvPatchField<vector>(ptf, iF),
|
||||
phiName_(ptf.phiName_),
|
||||
rhoName_(ptf.rhoName_),
|
||||
flowRate_(ptf.flowRate_().clone().ptr()),
|
||||
rpm_(ptf.rpm_().clone().ptr())
|
||||
flowRate_(ptf.flowRate_, false),
|
||||
rpm_(ptf.rpm_, false)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -58,38 +58,6 @@ timeVaryingMappedFixedValueFvPatchField
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
timeVaryingMappedFixedValueFvPatchField<Type>::
|
||||
timeVaryingMappedFixedValueFvPatchField
|
||||
(
|
||||
const timeVaryingMappedFixedValueFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
||||
fieldTableName_(ptf.fieldTableName_),
|
||||
setAverage_(ptf.setAverage_),
|
||||
perturb_(ptf.perturb_),
|
||||
mapMethod_(ptf.mapMethod_),
|
||||
mapperPtr_(NULL),
|
||||
sampleTimes_(0),
|
||||
startSampleTime_(-1),
|
||||
startSampledValues_(0),
|
||||
startAverage_(pTraits<Type>::zero),
|
||||
endSampleTime_(-1),
|
||||
endSampledValues_(0),
|
||||
endAverage_(pTraits<Type>::zero),
|
||||
offset_
|
||||
(
|
||||
ptf.offset_.valid()
|
||||
? ptf.offset_().clone().ptr()
|
||||
: NULL
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
timeVaryingMappedFixedValueFvPatchField<Type>::
|
||||
timeVaryingMappedFixedValueFvPatchField
|
||||
@ -152,6 +120,33 @@ timeVaryingMappedFixedValueFvPatchField
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
timeVaryingMappedFixedValueFvPatchField<Type>::
|
||||
timeVaryingMappedFixedValueFvPatchField
|
||||
(
|
||||
const timeVaryingMappedFixedValueFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
||||
fieldTableName_(ptf.fieldTableName_),
|
||||
setAverage_(ptf.setAverage_),
|
||||
perturb_(ptf.perturb_),
|
||||
mapMethod_(ptf.mapMethod_),
|
||||
mapperPtr_(NULL),
|
||||
sampleTimes_(0),
|
||||
startSampleTime_(-1),
|
||||
startSampledValues_(0),
|
||||
startAverage_(pTraits<Type>::zero),
|
||||
endSampleTime_(-1),
|
||||
endSampledValues_(0),
|
||||
endAverage_(pTraits<Type>::zero),
|
||||
offset_(ptf.offset_, false)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
timeVaryingMappedFixedValueFvPatchField<Type>::
|
||||
timeVaryingMappedFixedValueFvPatchField
|
||||
@ -172,12 +167,7 @@ timeVaryingMappedFixedValueFvPatchField
|
||||
endSampleTime_(ptf.endSampleTime_),
|
||||
endSampledValues_(ptf.endSampledValues_),
|
||||
endAverage_(ptf.endAverage_),
|
||||
offset_
|
||||
(
|
||||
ptf.offset_.valid()
|
||||
? ptf.offset_().clone().ptr()
|
||||
: NULL
|
||||
)
|
||||
offset_(ptf.offset_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -202,12 +192,7 @@ timeVaryingMappedFixedValueFvPatchField
|
||||
endSampleTime_(ptf.endSampleTime_),
|
||||
endSampledValues_(ptf.endSampledValues_),
|
||||
endAverage_(ptf.endAverage_),
|
||||
offset_
|
||||
(
|
||||
ptf.offset_.valid()
|
||||
? ptf.offset_().clone().ptr()
|
||||
: NULL
|
||||
)
|
||||
offset_(ptf.offset_, false)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -52,24 +52,6 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
(
|
||||
const uniformFixedGradientFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedGradientFvPatchField<Type>(ptf, p, iF, mapper),
|
||||
uniformGradient_(ptf.uniformGradient_().clone().ptr())
|
||||
{
|
||||
// For safety re-evaluate
|
||||
const scalar t = this->db().time().timeOutputValue();
|
||||
this->gradient() = uniformGradient_->value(t);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
(
|
||||
@ -81,20 +63,24 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
fixedGradientFvPatchField<Type>(p, iF),
|
||||
uniformGradient_(DataEntry<Type>::New("uniformGradient", dict))
|
||||
{
|
||||
if (dict.found("gradient"))
|
||||
{
|
||||
this->gradient() = Field<Type>("gradient", dict, p.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
const scalar t = this->db().time().timeOutputValue();
|
||||
this->gradient() = uniformGradient_->value(t);
|
||||
}
|
||||
|
||||
fixedGradientFvPatchField<Type>::evaluate();
|
||||
this->evaluate();
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
(
|
||||
const uniformFixedGradientFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedGradientFvPatchField<Type>(ptf, p, iF, mapper),
|
||||
uniformGradient_(ptf.uniformGradient_, false)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
(
|
||||
@ -102,12 +88,7 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
)
|
||||
:
|
||||
fixedGradientFvPatchField<Type>(ptf),
|
||||
uniformGradient_
|
||||
(
|
||||
ptf.uniformGradient_.valid()
|
||||
? ptf.uniformGradient_().clone().ptr()
|
||||
: NULL
|
||||
)
|
||||
uniformGradient_(ptf.uniformGradient_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -119,19 +100,12 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
)
|
||||
:
|
||||
fixedGradientFvPatchField<Type>(ptf, iF),
|
||||
uniformGradient_
|
||||
(
|
||||
ptf.uniformGradient_.valid()
|
||||
? ptf.uniformGradient_().clone().ptr()
|
||||
: NULL
|
||||
)
|
||||
uniformGradient_(ptf.uniformGradient_, false)
|
||||
{
|
||||
// For safety re-evaluate
|
||||
const scalar t = this->db().time().timeOutputValue();
|
||||
|
||||
// Evaluate the profile if defined
|
||||
if (ptf.uniformGradient_.valid())
|
||||
{
|
||||
this->gradient() = uniformGradient_->value(t);
|
||||
this->evaluate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -164,12 +164,8 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
@ -52,24 +52,6 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
||||
(
|
||||
const uniformFixedValueFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(p, iF), // bypass mapper
|
||||
uniformValue_(ptf.uniformValue_().clone().ptr())
|
||||
{
|
||||
// Evaluate since value not mapped
|
||||
const scalar t = this->db().time().timeOutputValue();
|
||||
fvPatchField<Type>::operator==(uniformValue_->value(t));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
||||
(
|
||||
@ -81,8 +63,24 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
||||
fixedValueFvPatchField<Type>(p, iF),
|
||||
uniformValue_(DataEntry<Type>::New("uniformValue", dict))
|
||||
{
|
||||
const scalar t = this->db().time().timeOutputValue();
|
||||
fvPatchField<Type>::operator==(uniformValue_->value(t));
|
||||
this->evaluate();
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
||||
(
|
||||
const uniformFixedValueFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(p, iF), // Don't map
|
||||
uniformValue_(ptf.uniformValue_, false)
|
||||
{
|
||||
// Evaluate since value not mapped
|
||||
this->evaluate();
|
||||
}
|
||||
|
||||
|
||||
@ -93,12 +91,7 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(ptf),
|
||||
uniformValue_
|
||||
(
|
||||
ptf.uniformValue_.valid()
|
||||
? ptf.uniformValue_().clone().ptr()
|
||||
: NULL
|
||||
)
|
||||
uniformValue_(ptf.uniformValue_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -110,19 +103,12 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(ptf, iF),
|
||||
uniformValue_
|
||||
(
|
||||
ptf.uniformValue_.valid()
|
||||
? ptf.uniformValue_().clone().ptr()
|
||||
: NULL
|
||||
)
|
||||
uniformValue_(ptf.uniformValue_, false)
|
||||
{
|
||||
// For safety re-evaluate
|
||||
const scalar t = this->db().time().timeOutputValue();
|
||||
|
||||
// Evaluate the profile if defined
|
||||
if (ptf.uniformValue_.valid())
|
||||
{
|
||||
fvPatchField<Type>::operator==(uniformValue_->value(t));
|
||||
this->evaluate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -163,12 +163,8 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -43,37 +43,6 @@ Foam::uniformInletOutletFvPatchField<Type>::uniformInletOutletFvPatchField
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::uniformInletOutletFvPatchField<Type>::uniformInletOutletFvPatchField
|
||||
(
|
||||
const uniformInletOutletFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<Type>(p, iF),
|
||||
phiName_(ptf.phiName_),
|
||||
uniformInletValue_(ptf.uniformInletValue_, false)
|
||||
{
|
||||
this->patchType() = ptf.patchType();
|
||||
|
||||
// For safety re-evaluate
|
||||
const scalar t = this->db().time().timeOutputValue();
|
||||
this->refValue() = uniformInletValue_->value(t);
|
||||
this->refGrad() = pTraits<Type>::zero;
|
||||
this->valueFraction() = 0.0;
|
||||
|
||||
// Map value (unmapped get refValue)
|
||||
if (notNull(iF) && iF.size())
|
||||
{
|
||||
fvPatchField<Type>::operator=(this->refValue());
|
||||
}
|
||||
this->map(ptf, mapper);
|
||||
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::uniformInletOutletFvPatchField<Type>::uniformInletOutletFvPatchField
|
||||
(
|
||||
@ -106,6 +75,35 @@ Foam::uniformInletOutletFvPatchField<Type>::uniformInletOutletFvPatchField
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::uniformInletOutletFvPatchField<Type>::uniformInletOutletFvPatchField
|
||||
(
|
||||
const uniformInletOutletFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
mixedFvPatchField<Type>(p, iF), // Don't map
|
||||
phiName_(ptf.phiName_),
|
||||
uniformInletValue_(ptf.uniformInletValue_, false)
|
||||
{
|
||||
this->patchType() = ptf.patchType();
|
||||
|
||||
// Evaluate refValue since not mapped
|
||||
const scalar t = this->db().time().timeOutputValue();
|
||||
this->refValue() = uniformInletValue_->value(t);
|
||||
|
||||
this->refGrad() = pTraits<Type>::zero;
|
||||
this->valueFraction() = 0.0;
|
||||
|
||||
// Initialize the patch value to the refValue
|
||||
fvPatchField<Type>::operator=(this->refValue());
|
||||
|
||||
this->map(ptf, mapper);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::uniformInletOutletFvPatchField<Type>::uniformInletOutletFvPatchField
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -193,7 +193,6 @@ public:
|
||||
// Member operators
|
||||
|
||||
virtual void operator=(const fvPatchField<Type>& pvf);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -49,7 +49,7 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
|
||||
)
|
||||
:
|
||||
fixedJumpFvPatchField<Type>(ptf, p, iF, mapper),
|
||||
jumpTable_(ptf.jumpTable_().clone().ptr())
|
||||
jumpTable_(ptf.jumpTable_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
|
||||
)
|
||||
:
|
||||
fixedJumpFvPatchField<Type>(ptf),
|
||||
jumpTable_(ptf.jumpTable_().clone().ptr())
|
||||
jumpTable_(ptf.jumpTable_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
|
||||
)
|
||||
:
|
||||
fixedJumpFvPatchField<Type>(ptf, iF),
|
||||
jumpTable_(ptf.jumpTable_().clone().ptr())
|
||||
jumpTable_(ptf.jumpTable_, false)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -49,7 +49,7 @@ Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
|
||||
)
|
||||
:
|
||||
fixedJumpAMIFvPatchField<Type>(ptf, p, iF, mapper),
|
||||
jumpTable_(ptf.jumpTable_().clone().ptr())
|
||||
jumpTable_(ptf.jumpTable_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
|
||||
)
|
||||
:
|
||||
fixedJumpAMIFvPatchField<Type>(ptf),
|
||||
jumpTable_(ptf.jumpTable_().clone().ptr())
|
||||
jumpTable_(ptf.jumpTable_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
|
||||
)
|
||||
:
|
||||
fixedJumpAMIFvPatchField<Type>(ptf, iF),
|
||||
jumpTable_(ptf.jumpTable_().clone().ptr())
|
||||
jumpTable_(ptf.jumpTable_, false)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -73,8 +73,8 @@ uniformTotalPressureFvPatchScalarField
|
||||
}
|
||||
else
|
||||
{
|
||||
scalar p0 = pressure_->value(this->db().time().timeOutputValue());
|
||||
fvPatchField<scalar>::operator=(p0);
|
||||
const scalar t = this->db().time().timeOutputValue();
|
||||
fvPatchScalarField::operator==(pressure_->value(t));
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,15 +88,18 @@ uniformTotalPressureFvPatchScalarField
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF), // bypass mapper
|
||||
fixedValueFvPatchScalarField(p, iF), // Don't map
|
||||
UName_(ptf.UName_),
|
||||
phiName_(ptf.phiName_),
|
||||
rhoName_(ptf.rhoName_),
|
||||
psiName_(ptf.psiName_),
|
||||
gamma_(ptf.gamma_),
|
||||
pressure_(ptf.pressure_().clone().ptr())
|
||||
pressure_(ptf.pressure_, false)
|
||||
{
|
||||
// Evaluate since value not mapped
|
||||
patchType() = ptf.patchType();
|
||||
|
||||
// Set the patch pressure to the current total pressure
|
||||
// This is not ideal but avoids problems with the creation of patch faces
|
||||
const scalar t = this->db().time().timeOutputValue();
|
||||
fvPatchScalarField::operator==(pressure_->value(t));
|
||||
}
|
||||
@ -114,12 +117,7 @@ uniformTotalPressureFvPatchScalarField
|
||||
rhoName_(ptf.rhoName_),
|
||||
psiName_(ptf.psiName_),
|
||||
gamma_(ptf.gamma_),
|
||||
pressure_
|
||||
(
|
||||
ptf.pressure_.valid()
|
||||
? ptf.pressure_().clone().ptr()
|
||||
: NULL
|
||||
)
|
||||
pressure_(ptf.pressure_, false)
|
||||
{}
|
||||
|
||||
|
||||
@ -136,12 +134,7 @@ uniformTotalPressureFvPatchScalarField
|
||||
rhoName_(ptf.rhoName_),
|
||||
psiName_(ptf.psiName_),
|
||||
gamma_(ptf.gamma_),
|
||||
pressure_
|
||||
(
|
||||
ptf.pressure_.valid()
|
||||
? ptf.pressure_().clone().ptr()
|
||||
: NULL
|
||||
)
|
||||
pressure_(ptf.pressure_, false)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user