diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 656cc2f0ed040d5a772ac9d21732307c2fd37a45..6a3caf2ff0a785c88626f739cb2f5fdf44a1a19a 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -158,8 +158,6 @@ $(derivedFvPatchFields)/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVe $(derivedFvPatchFields)/syringePressure/syringePressureFvPatchScalarField.C $(derivedFvPatchFields)/timeVaryingMappedFixedValue/AverageIOFields.C $(derivedFvPatchFields)/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFields.C -$(derivedFvPatchFields)/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.C $(derivedFvPatchFields)/totalPressure/totalPressureFvPatchScalarField.C $(derivedFvPatchFields)/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C $(derivedFvPatchFields)/totalTemperature/totalTemperatureFvPatchScalarField.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index 226405b792a8d90e8f60adde47963c0323e63814..d4b2aa3df2fc5709492588490592a0d35366f49a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -31,8 +31,7 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam:: -flowRateInletVelocityFvPatchVectorField:: +Foam::flowRateInletVelocityFvPatchVectorField:: flowRateInletVelocityFvPatchVectorField ( const fvPatch& p, @@ -40,14 +39,13 @@ flowRateInletVelocityFvPatchVectorField ) : fixedValueFvPatchField<vector>(p, iF), - flowRate_(0), + flowRate_(), phiName_("phi"), rhoName_("rho") {} -Foam:: -flowRateInletVelocityFvPatchVectorField:: +Foam::flowRateInletVelocityFvPatchVectorField:: flowRateInletVelocityFvPatchVectorField ( const flowRateInletVelocityFvPatchVectorField& ptf, @@ -57,14 +55,13 @@ flowRateInletVelocityFvPatchVectorField ) : fixedValueFvPatchField<vector>(ptf, p, iF, mapper), - flowRate_(ptf.flowRate_), + flowRate_(ptf.flowRate_().clone().ptr()), phiName_(ptf.phiName_), rhoName_(ptf.rhoName_) {} -Foam:: -flowRateInletVelocityFvPatchVectorField:: +Foam::flowRateInletVelocityFvPatchVectorField:: flowRateInletVelocityFvPatchVectorField ( const fvPatch& p, @@ -73,28 +70,26 @@ flowRateInletVelocityFvPatchVectorField ) : fixedValueFvPatchField<vector>(p, iF, dict), - flowRate_(readScalar(dict.lookup("flowRate"))), + flowRate_(DataEntry<scalar>::New("flowRate", dict)), phiName_(dict.lookupOrDefault<word>("phi", "phi")), rhoName_(dict.lookupOrDefault<word>("rho", "rho")) {} -Foam:: -flowRateInletVelocityFvPatchVectorField:: +Foam::flowRateInletVelocityFvPatchVectorField:: flowRateInletVelocityFvPatchVectorField ( const flowRateInletVelocityFvPatchVectorField& ptf ) : fixedValueFvPatchField<vector>(ptf), - flowRate_(ptf.flowRate_), + flowRate_(ptf.flowRate_().clone().ptr()), phiName_(ptf.phiName_), rhoName_(ptf.rhoName_) {} -Foam:: -flowRateInletVelocityFvPatchVectorField:: +Foam::flowRateInletVelocityFvPatchVectorField:: flowRateInletVelocityFvPatchVectorField ( const flowRateInletVelocityFvPatchVectorField& ptf, @@ -102,7 +97,7 @@ flowRateInletVelocityFvPatchVectorField ) : fixedValueFvPatchField<vector>(ptf, iF), - flowRate_(ptf.flowRate_), + flowRate_(ptf.flowRate_().clone().ptr()), phiName_(ptf.phiName_), rhoName_(ptf.rhoName_) {} @@ -117,8 +112,10 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs() return; } + const scalar t = db().time().value(); + // a simpler way of doing this would be nice - const scalar avgU = -flowRate_/gSum(patch().magSf()); + const scalar avgU = -flowRate_->value(t)/gSum(patch().magSf()); tmp<vectorField> n = patch().nf(); @@ -157,7 +154,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs() void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchField<vector>::write(os); - os.writeKeyword("flowRate") << flowRate_ << token::END_STATEMENT << nl; + flowRate_->writeData(os); writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H index b00368a5a579ee63b37306254183a1b152a8ebed..f40674ea01c8387a6299e92242795192f8e94d84 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H @@ -57,6 +57,7 @@ SourceFiles #define flowRateInletVelocityFvPatchVectorField_H #include "fixedValueFvPatchFields.H" +#include "DataEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,7 +74,7 @@ class flowRateInletVelocityFvPatchVectorField // Private data //- Inlet integral flow rate - scalar flowRate_; + autoPtr<DataEntry<scalar> > flowRate_; //- Name of the flux transporting the field word phiName_; @@ -153,27 +154,11 @@ public: // Member functions - // Access - - //- Return the flux - scalar flowRate() const - { - return flowRate_; - } - - //- Return reference to the flux to allow adjustment - scalar& flowRate() - { - return flowRate_; - } - - //- Update the coefficients associated with the patch field virtual void updateCoeffs(); //- Write virtual void write(Ostream&) const; - }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C index 7ccd38a18b42920cd20dc500f562858f9c40ff1a..a382b65c8d668305e0e69ec0b7a5e6cb56e592b0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C @@ -33,10 +33,13 @@ License void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: calcTangentialVelocity() { - vector axisHat = omega_/mag(omega_); + const scalar t = this->db().time().value(); + vector om = omega_->value(t); + + vector axisHat = om/mag(om); const vectorField tangentialVelocity ( - (-omega_) ^ (patch().Cf() - axisHat*(axisHat & patch().Cf())) + (-om) ^ (patch().Cf() - axisHat*(axisHat & patch().Cf())) ); const vectorField n(patch().nf()); @@ -54,7 +57,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField ) : pressureInletOutletVelocityFvPatchVectorField(p, iF), - omega_(vector::zero) + omega_() {} @@ -68,7 +71,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField ) : pressureInletOutletVelocityFvPatchVectorField(ptf, p, iF, mapper), - omega_(ptf.omega_) + omega_(ptf.omega_().clone().ptr()) { calcTangentialVelocity(); } @@ -83,7 +86,7 @@ rotatingPressureInletOutletVelocityFvPatchVectorField ) : pressureInletOutletVelocityFvPatchVectorField(p, iF, dict), - omega_(dict.lookup("omega")) + omega_(DataEntry<vector>::New("omega", dict)) { calcTangentialVelocity(); } @@ -92,11 +95,11 @@ rotatingPressureInletOutletVelocityFvPatchVectorField Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: rotatingPressureInletOutletVelocityFvPatchVectorField ( - const rotatingPressureInletOutletVelocityFvPatchVectorField& pivpvf + const rotatingPressureInletOutletVelocityFvPatchVectorField& rppvf ) : - pressureInletOutletVelocityFvPatchVectorField(pivpvf), - omega_(pivpvf.omega_) + pressureInletOutletVelocityFvPatchVectorField(rppvf), + omega_(rppvf.omega_().clone().ptr()) { calcTangentialVelocity(); } @@ -105,12 +108,12 @@ rotatingPressureInletOutletVelocityFvPatchVectorField Foam::rotatingPressureInletOutletVelocityFvPatchVectorField:: rotatingPressureInletOutletVelocityFvPatchVectorField ( - const rotatingPressureInletOutletVelocityFvPatchVectorField& pivpvf, + const rotatingPressureInletOutletVelocityFvPatchVectorField& rppvf, const DimensionedField<vector, volMesh>& iF ) : - pressureInletOutletVelocityFvPatchVectorField(pivpvf, iF), - omega_(pivpvf.omega_) + pressureInletOutletVelocityFvPatchVectorField(rppvf, iF), + omega_(rppvf.omega_().clone().ptr()) { calcTangentialVelocity(); } @@ -125,7 +128,7 @@ void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::write { fvPatchVectorField::write(os); os.writeKeyword("phi") << phiName() << token::END_STATEMENT << nl; - os.writeKeyword("omega")<< omega_ << token::END_STATEMENT << nl; + omega_->writeData(os); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H index 3d2e3a7cc94f2f48d10e0af14078c36c7b5554d3..063585751876bca22fc4c63563017cbb6cf4bfd3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H @@ -40,6 +40,7 @@ SourceFiles #include "fvPatchFields.H" #include "pressureInletOutletVelocityFvPatchVectorField.H" +#include "DataEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,7 +48,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class rotatingPressureInletOutletVelocityFvPatch Declaration + Class rotatingPressureInletOutletVelocityFvPatch Declaration \*---------------------------------------------------------------------------*/ class rotatingPressureInletOutletVelocityFvPatchVectorField @@ -57,7 +58,7 @@ class rotatingPressureInletOutletVelocityFvPatchVectorField // Private data //- Angular velocity of the frame - vector omega_; + autoPtr<DataEntry<vector> > omega_; // Private Member Functions @@ -141,23 +142,6 @@ public: // Member functions - // Access - - //- Return the angular velocity of rotation - const vector& omega() const - { - return omega_; - } - - //- Reset the angular velocity of rotation - // and update the tangentialVelocity - void setOmega(const vector& omega) - { - omega_ = omega; - calcTangentialVelocity(); - } - - //- Write virtual void write(Ostream&) const; }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C index 249635c21b393c770adc9a5e0dee3c83e86d67ce..8bd52df99e3ca53d20e99868539c70e5c2e99be0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C @@ -39,7 +39,7 @@ rotatingTotalPressureFvPatchScalarField ) : totalPressureFvPatchScalarField(p, iF), - omega_(vector::zero) + omega_() {} @@ -53,7 +53,7 @@ rotatingTotalPressureFvPatchScalarField ) : totalPressureFvPatchScalarField(ptf, p, iF, mapper), - omega_(ptf.omega_) + omega_(ptf.omega_().clone().ptr()) {} @@ -66,30 +66,30 @@ rotatingTotalPressureFvPatchScalarField ) : totalPressureFvPatchScalarField(p, iF, dict), - omega_(dict.lookup("omega")) + omega_(DataEntry<vector>::New("omega", dict)) {} Foam::rotatingTotalPressureFvPatchScalarField:: rotatingTotalPressureFvPatchScalarField ( - const rotatingTotalPressureFvPatchScalarField& tppsf + const rotatingTotalPressureFvPatchScalarField& rtppsf ) : - totalPressureFvPatchScalarField(tppsf), - omega_(tppsf.omega_) + totalPressureFvPatchScalarField(rtppsf), + omega_(rtppsf.omega_().clone().ptr()) {} Foam::rotatingTotalPressureFvPatchScalarField:: rotatingTotalPressureFvPatchScalarField ( - const rotatingTotalPressureFvPatchScalarField& tppsf, + const rotatingTotalPressureFvPatchScalarField& rtppsf, const DimensionedField<scalar, volMesh>& iF ) : - totalPressureFvPatchScalarField(tppsf, iF), - omega_(tppsf.omega_) + totalPressureFvPatchScalarField(rtppsf, iF), + omega_(rtppsf.omega_().clone().ptr()) {} @@ -102,9 +102,12 @@ void Foam::rotatingTotalPressureFvPatchScalarField::updateCoeffs() return; } - vector axisHat = omega_/mag(omega_); + const scalar t = this->db().time().value(); + const vector om = omega_->value(t); + + vector axisHat = om/mag(om); tmp<vectorField> rotationVelocity = - omega_ ^ (patch().Cf() - axisHat*(axisHat & patch().Cf())); + om ^ (patch().Cf() - axisHat*(axisHat & patch().Cf())); const vectorField Up ( @@ -119,7 +122,7 @@ void Foam::rotatingTotalPressureFvPatchScalarField::updateCoeffs() void Foam::rotatingTotalPressureFvPatchScalarField::write(Ostream& os) const { totalPressureFvPatchScalarField::write(os); - os.writeKeyword("omega")<< omega_ << token::END_STATEMENT << nl; + omega_->writeData(os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H index d214d566272131381f939a4c75fe43e7fa118da7..68e1d19c8fd029ade7445e1c28c0b5532e625517 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.H @@ -36,6 +36,7 @@ SourceFiles #define rotatingTotalPressureFvPatchScalarField_H #include "totalPressureFvPatchScalarField.H" +#include "DataEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class rotatingTotalPressureFvPatch Declaration + Class rotatingTotalPressureFvPatch Declaration \*---------------------------------------------------------------------------*/ class rotatingTotalPressureFvPatchScalarField @@ -53,7 +54,7 @@ class rotatingTotalPressureFvPatchScalarField // Private data //- Angular velocity of the frame - vector omega_; + autoPtr<DataEntry<vector> > omega_; public: @@ -126,21 +127,6 @@ public: // Member functions - // Access - - //- Return the angular velocity of rotation - const vector& omega() const - { - return omega_; - } - - //- Return the angular velocity of rotation - vector& omega() - { - return omega_; - } - - // Evaluation functions //- Update the coefficients associated with the patch field diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C index 9ed9bb388d7913770bb799229101f54a829db8a4..b7a30a84883a895698e861cf322cf42a255ee089 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C @@ -38,7 +38,7 @@ rotatingWallVelocityFvPatchVectorField ) : fixedValueFvPatchField<vector>(p, iF), - origin_(vector::zero), + origin_(), axis_(vector::zero), omega_(0) {} @@ -56,7 +56,7 @@ rotatingWallVelocityFvPatchVectorField fixedValueFvPatchField<vector>(ptf, p, iF, mapper), origin_(ptf.origin_), axis_(ptf.axis_), - omega_(ptf.omega_) + omega_(ptf.omega_().clone().ptr()) {} @@ -71,7 +71,7 @@ rotatingWallVelocityFvPatchVectorField fixedValueFvPatchField<vector>(p, iF), origin_(dict.lookup("origin")), axis_(dict.lookup("axis")), - omega_(readScalar(dict.lookup("omega"))) + omega_(DataEntry<scalar>::New("omega", dict)) { // Evaluate the wall velocity updateCoeffs(); @@ -81,27 +81,27 @@ rotatingWallVelocityFvPatchVectorField Foam::rotatingWallVelocityFvPatchVectorField:: rotatingWallVelocityFvPatchVectorField ( - const rotatingWallVelocityFvPatchVectorField& pivpvf + const rotatingWallVelocityFvPatchVectorField& rwvpvf ) : - fixedValueFvPatchField<vector>(pivpvf), - origin_(pivpvf.origin_), - axis_(pivpvf.axis_), - omega_(pivpvf.omega_) + fixedValueFvPatchField<vector>(rwvpvf), + origin_(rwvpvf.origin_), + axis_(rwvpvf.axis_), + omega_(rwvpvf.omega_().clone().ptr()) {} Foam::rotatingWallVelocityFvPatchVectorField:: rotatingWallVelocityFvPatchVectorField ( - const rotatingWallVelocityFvPatchVectorField& pivpvf, + const rotatingWallVelocityFvPatchVectorField& rwvpvf, const DimensionedField<vector, volMesh>& iF ) : - fixedValueFvPatchField<vector>(pivpvf, iF), - origin_(pivpvf.origin_), - axis_(pivpvf.axis_), - omega_(pivpvf.omega_) + fixedValueFvPatchField<vector>(rwvpvf, iF), + origin_(rwvpvf.origin_), + axis_(rwvpvf.axis_), + omega_(rwvpvf.omega_().clone().ptr()) {} @@ -114,10 +114,13 @@ void Foam::rotatingWallVelocityFvPatchVectorField::updateCoeffs() return; } + const scalar t = this->db().time().value(); + scalar om = omega_->value(t); + // Calculate the rotating wall velocity from the specification of the motion const vectorField Up ( - (-omega_)*((patch().Cf() - origin_) ^ (axis_/mag(axis_))) + (-om)*((patch().Cf() - origin_) ^ (axis_/mag(axis_))) ); // Remove the component of Up normal to the wall @@ -134,7 +137,7 @@ void Foam::rotatingWallVelocityFvPatchVectorField::write(Ostream& os) const fvPatchVectorField::write(os); os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl; os.writeKeyword("axis") << axis_ << token::END_STATEMENT << nl; - os.writeKeyword("omega") << omega_ << token::END_STATEMENT << nl; + omega_->writeData(os); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H index ac18cda23f3ff57cefc192771434607e1cb913da..41f821c6d88a41f72126a5b54ade7408e82db07e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H @@ -36,6 +36,7 @@ SourceFiles #define rotatingWallVelocityFvPatchVectorField_H #include "fixedValueFvPatchFields.H" +#include "DataEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class rotatingWallVelocityFvPatch Declaration + Class rotatingWallVelocityFvPatch Declaration \*---------------------------------------------------------------------------*/ class rotatingWallVelocityFvPatchVectorField @@ -59,7 +60,7 @@ class rotatingWallVelocityFvPatchVectorField vector axis_; //- Rotational speed - scalar omega_; + autoPtr<DataEntry<scalar> > omega_; public: @@ -147,12 +148,6 @@ public: return axis_; } - //- Return the rotational speed - scalar omega() const - { - return omega_; - } - //- Return non-const access to the origin of the rotation vector& origin() { @@ -165,12 +160,6 @@ public: return axis_; } - //- Return non-const access to the rotational speed - scalar& omega() - { - return omega_; - } - //- Update the coefficients associated with the patch field virtual void updateCoeffs(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C deleted file mode 100644 index 7dd71eb8b64148c1dfd1e92ef6771bfa3b658633..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C +++ /dev/null @@ -1,132 +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 "timeVaryingFlowRateInletVelocityFvPatchVectorField.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "surfaceFields.H" -#include "Time.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::timeVaryingFlowRateInletVelocityFvPatchVectorField:: -timeVaryingFlowRateInletVelocityFvPatchVectorField -( - const fvPatch& p, - const DimensionedField<vector, volMesh>& iF -) -: - flowRateInletVelocityFvPatchVectorField(p, iF), - timeSeries_() -{} - - -Foam::timeVaryingFlowRateInletVelocityFvPatchVectorField:: -timeVaryingFlowRateInletVelocityFvPatchVectorField -( - const timeVaryingFlowRateInletVelocityFvPatchVectorField& ptf, - const fvPatch& p, - const DimensionedField<vector, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - flowRateInletVelocityFvPatchVectorField(ptf, p, iF, mapper), - timeSeries_(ptf.timeSeries_) -{} - - -Foam::timeVaryingFlowRateInletVelocityFvPatchVectorField:: -timeVaryingFlowRateInletVelocityFvPatchVectorField -( - const fvPatch& p, - const DimensionedField<vector, volMesh>& iF, - const dictionary& dict -) -: - flowRateInletVelocityFvPatchVectorField(p, iF, dict), - timeSeries_(dict) -{} - - -Foam::timeVaryingFlowRateInletVelocityFvPatchVectorField:: -timeVaryingFlowRateInletVelocityFvPatchVectorField -( - const timeVaryingFlowRateInletVelocityFvPatchVectorField& ptf -) -: - flowRateInletVelocityFvPatchVectorField(ptf), - timeSeries_(ptf.timeSeries_) -{} - - -Foam::timeVaryingFlowRateInletVelocityFvPatchVectorField:: -timeVaryingFlowRateInletVelocityFvPatchVectorField -( - const timeVaryingFlowRateInletVelocityFvPatchVectorField& ptf, - const DimensionedField<vector, volMesh>& iF -) -: - flowRateInletVelocityFvPatchVectorField(ptf, iF), - timeSeries_(ptf.timeSeries_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::timeVaryingFlowRateInletVelocityFvPatchVectorField:: -updateCoeffs() -{ - if (updated()) - { - return; - } - - flowRate() = timeSeries_(this->db().time().timeOutputValue()); - flowRateInletVelocityFvPatchVectorField::updateCoeffs(); -} - - -void Foam::timeVaryingFlowRateInletVelocityFvPatchVectorField:: -write(Ostream& os) const -{ - flowRateInletVelocityFvPatchVectorField::write(os); - timeSeries_.write(os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePatchTypeField - ( - fvPatchVectorField, - timeVaryingFlowRateInletVelocityFvPatchVectorField - ); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.H deleted file mode 100644 index 0ba11a655db7fad811b6900c7357200ceb1e8799..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.H +++ /dev/null @@ -1,182 +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::timeVaryingFlowRateInletVelocityFvPatchVectorField - -Description - A time-varying form of a flow normal vector boundary condition. The - variation is specified as an interpolationTable (see - Foam::interpolationTable). - - Example of the boundary condition specification: - \verbatim - inlet - { - type timeVaryingFlowRateInletVelocity; - flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s] - value uniform (0 0 0); // placeholder - fileName "$FOAM_CASE/time-series"; - outOfBounds repeat; // (error|warn|clamp|repeat) - } - \endverbatim - -Note - - The value is positive inwards - - may not work correctly for transonic inlets! - - strange behaviour with potentialFoam since the U equation is not solved - -See Also - Foam::interpolationTable and Foam::flowRateInletVelocityFvPatchVectorField - -SourceFiles - timeVaryingFlowRateInletVelocityFvPatchVectorField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef timeVaryingFlowRateInletVelocityFvPatchVectorField_H -#define timeVaryingFlowRateInletVelocityFvPatchVectorField_H - -#include "flowRateInletVelocityFvPatchVectorField.H" -#include "interpolationTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -/*---------------------------------------------------------------------------*\ - Class timeVaryingFlowRateInletVelocityFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class timeVaryingFlowRateInletVelocityFvPatchVectorField -: - public flowRateInletVelocityFvPatchVectorField -{ - // Private data - - //- the time series being used, including the bounding treatment - interpolationTable<scalar> timeSeries_; - - -public: - - //- Runtime type information - TypeName("timeVaryingFlowRateInletVelocity"); - - - // Constructors - - //- Construct from patch and internal field - timeVaryingFlowRateInletVelocityFvPatchVectorField - ( - const fvPatch&, - const DimensionedField<vector, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - timeVaryingFlowRateInletVelocityFvPatchVectorField - ( - const fvPatch&, - const DimensionedField<vector, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given patch field onto a new patch - timeVaryingFlowRateInletVelocityFvPatchVectorField - ( - const timeVaryingFlowRateInletVelocityFvPatchVectorField&, - const fvPatch&, - const DimensionedField<vector, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - timeVaryingFlowRateInletVelocityFvPatchVectorField - ( - const timeVaryingFlowRateInletVelocityFvPatchVectorField& - ); - - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new timeVaryingFlowRateInletVelocityFvPatchVectorField(*this) - ); - } - - //- Construct as copy setting internal field reference - timeVaryingFlowRateInletVelocityFvPatchVectorField - ( - const timeVaryingFlowRateInletVelocityFvPatchVectorField&, - const DimensionedField<vector, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone - ( - const DimensionedField<vector, volMesh>& iF - ) const - { - return tmp<fvPatchVectorField> - ( - new timeVaryingFlowRateInletVelocityFvPatchVectorField - ( - *this, - iF - ) - ); - } - - - // Member functions - - // Access - - //- Return the time series used - const interpolationTable<scalar>& timeSeries() const - { - return timeSeries_; - } - - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchField.C deleted file mode 100644 index 9ea28b4567e6f2ac308343133cfd915a320434dd..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchField.C +++ /dev/null @@ -1,137 +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 "timeVaryingUniformFixedValueFvPatchField.H" -#include "Time.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class Type> -Foam::timeVaryingUniformFixedValueFvPatchField<Type>:: -timeVaryingUniformFixedValueFvPatchField -( - const fvPatch& p, - const DimensionedField<Type, volMesh>& iF -) -: - fixedValueFvPatchField<Type>(p, iF), - timeSeries_() -{} - - -template<class Type> -Foam::timeVaryingUniformFixedValueFvPatchField<Type>:: -timeVaryingUniformFixedValueFvPatchField -( - const fvPatch& p, - const DimensionedField<Type, volMesh>& iF, - const dictionary& dict -) -: - fixedValueFvPatchField<Type>(p, iF), - timeSeries_(dict) -{ - if (dict.found("value")) - { - fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size())); - } - else - { - updateCoeffs(); - } -} - - -template<class Type> -Foam::timeVaryingUniformFixedValueFvPatchField<Type>:: -timeVaryingUniformFixedValueFvPatchField -( - const timeVaryingUniformFixedValueFvPatchField<Type>& ptf, - const fvPatch& p, - const DimensionedField<Type, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchField<Type>(ptf, p, iF, mapper), - timeSeries_(ptf.timeSeries_) -{} - - -template<class Type> -Foam::timeVaryingUniformFixedValueFvPatchField<Type>:: -timeVaryingUniformFixedValueFvPatchField -( - const timeVaryingUniformFixedValueFvPatchField<Type>& ptf -) -: - fixedValueFvPatchField<Type>(ptf), - timeSeries_(ptf.timeSeries_) -{} - - -template<class Type> -Foam::timeVaryingUniformFixedValueFvPatchField<Type>:: -timeVaryingUniformFixedValueFvPatchField -( - const timeVaryingUniformFixedValueFvPatchField<Type>& ptf, - const DimensionedField<Type, volMesh>& iF -) -: - fixedValueFvPatchField<Type>(ptf, iF), - timeSeries_(ptf.timeSeries_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class Type> -void Foam::timeVaryingUniformFixedValueFvPatchField<Type>::updateCoeffs() -{ - if (this->updated()) - { - return; - } - - fvPatchField<Type>::operator== - ( - timeSeries_(this->db().time().timeOutputValue()) - ); - fixedValueFvPatchField<Type>::updateCoeffs(); -} - - -template<class Type> -void Foam::timeVaryingUniformFixedValueFvPatchField<Type>::write -( - Ostream& os -) const -{ - fvPatchField<Type>::write(os); - timeSeries_.write(os); - this->writeEntry("value", os); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchField.H deleted file mode 100644 index 2d1f6d97add2f05166e6485ad5febb01f7050ea1..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchField.H +++ /dev/null @@ -1,183 +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::timeVaryingUniformFixedValueFvPatchField - -Description - A time-varying form of a uniform fixed value boundary condition. The - variation is specified as an interpolationTable (see - Foam::interpolationTable for read options). - - Example of the boundary condition specification: - \verbatim - inlet - { - type timeVaryingUniformFixedValue; - fileName "$FOAM_CASE/time-series"; - outOfBounds clamp; // (error|warn|clamp|repeat) - } - \endverbatim - -Note - This class is derived directly from a fixedValue patch rather than from - a uniformFixedValue patch. - -See Also - Foam::interpolationTable and Foam::fixedValueFvPatchField - -SourceFiles - timeVaryingUniformFixedValueFvPatchField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef timeVaryingUniformFixedValueFvPatchField_H -#define timeVaryingUniformFixedValueFvPatchField_H - -#include "fixedValueFvPatchField.H" -#include "interpolationTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class timeVaryingUniformFixedValueFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -template<class Type> -class timeVaryingUniformFixedValueFvPatchField -: - public fixedValueFvPatchField<Type> -{ - // Private data - - //- The time series being used, including the bounding treatment - interpolationTable<Type> timeSeries_; - - -public: - - //- Runtime type information - TypeName("timeVaryingUniformFixedValue"); - - - // Constructors - - //- Construct from patch and internal field - timeVaryingUniformFixedValueFvPatchField - ( - const fvPatch&, - const DimensionedField<Type, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - timeVaryingUniformFixedValueFvPatchField - ( - const fvPatch&, - const DimensionedField<Type, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given patch field onto a new patch - timeVaryingUniformFixedValueFvPatchField - ( - const timeVaryingUniformFixedValueFvPatchField<Type>&, - const fvPatch&, - const DimensionedField<Type, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - timeVaryingUniformFixedValueFvPatchField - ( - const timeVaryingUniformFixedValueFvPatchField<Type>& - ); - - //- Construct and return a clone - virtual tmp<fvPatchField<Type> > clone() const - { - return tmp<fvPatchField<Type> > - ( - new timeVaryingUniformFixedValueFvPatchField<Type>(*this) - ); - } - - //- Construct as copy setting internal field reference - timeVaryingUniformFixedValueFvPatchField - ( - const timeVaryingUniformFixedValueFvPatchField<Type>&, - const DimensionedField<Type, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchField<Type> > clone - ( - const DimensionedField<Type, volMesh>& iF - ) const - { - return tmp<fvPatchField<Type> > - ( - new timeVaryingUniformFixedValueFvPatchField<Type>(*this, iF) - ); - } - - - // Member functions - - // Access - - //- Return the time series used - const interpolationTable<Type>& timeSeries() const - { - return timeSeries_; - } - - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "timeVaryingUniformFixedValueFvPatchField.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.C deleted file mode 100644 index 78b31de35dbeec55730e085ffb369a5e99ee7cb7..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.C +++ /dev/null @@ -1,43 +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 "timeVaryingUniformFixedValueFvPatchFields.H" -#include "addToRunTimeSelectionTable.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makePatchFields(timeVaryingUniformFixedValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.H deleted file mode 100644 index ecd444cd0ade02c33c6c3ffdeb464e82bdb0e2f8..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFields.H +++ /dev/null @@ -1,49 +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/>. - -\*---------------------------------------------------------------------------*/ - -#ifndef timeVaryingUniformFixedValueFvPatchFields_H -#define timeVaryingUniformFixedValueFvPatchFields_H - -#include "timeVaryingUniformFixedValueFvPatchField.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeFieldTypedefs(timeVaryingUniformFixedValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFieldsFwd.H deleted file mode 100644 index 5907a7ccf2a8944f4a1cd0bf33903fcd710d38d0..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFvPatchFieldsFwd.H +++ /dev/null @@ -1,50 +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/>. - -\*---------------------------------------------------------------------------*/ - -#ifndef timeVaryingUniformFixedValueFvPatchFieldsFwd_H -#define timeVaryingUniformFixedValueFvPatchFieldsFwd_H - -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template<class Type> class timeVaryingUniformFixedValueFvPatchField; - -makePatchTypeFieldTypedefs(timeVaryingUniformFixedValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C index 622ac8959b9a77f94d6fe7698e7d116a019f35df..2770460e0de90cc352120e1231191f5113ce73d4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.C @@ -40,7 +40,7 @@ uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField ) : fixedValueFvPatchField<Type>(p, iF), - uniformValue_(pTraits<Type>::zero) + uniformValue_() {} @@ -54,9 +54,10 @@ uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField ) : fixedValueFvPatchField<Type>(p, iF), - uniformValue_(ptf.uniformValue_) + uniformValue_(ptf.uniformValue_().clone().ptr()) { - fvPatchField<Type>::operator==(uniformValue_); + const scalar t = this->db().time().value(); + fvPatchField<Type>::operator==(uniformValue_->value(t)); } @@ -69,9 +70,10 @@ uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField ) : fixedValueFvPatchField<Type>(p, iF), - uniformValue_(pTraits<Type>(dict.lookup("uniformValue"))) + uniformValue_(DataEntry<Type>::New("uniformValue", dict)) { - fvPatchField<Type>::operator==(uniformValue_); + const scalar t = this->db().time().value(); + fvPatchField<Type>::operator==(uniformValue_->value(t)); } @@ -82,9 +84,10 @@ uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField ) : fixedValueFvPatchField<Type>(ptf), - uniformValue_(ptf.uniformValue_) + uniformValue_(ptf.uniformValue_().clone().ptr()) { - fvPatchField<Type>::operator==(uniformValue_); + const scalar t = this->db().time().value(); + fvPatchField<Type>::operator==(uniformValue_->value(t)); } @@ -96,9 +99,10 @@ uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField ) : fixedValueFvPatchField<Type>(ptf, iF), - uniformValue_(ptf.uniformValue_) + uniformValue_(ptf.uniformValue_().clone().ptr()) { - fvPatchField<Type>::operator==(uniformValue_); + const scalar t = this->db().time().value(); + fvPatchField<Type>::operator==(uniformValue_->value(t)); } @@ -111,7 +115,8 @@ void uniformFixedValueFvPatchField<Type>::autoMap ) { this->setSize(m.size()); - fvPatchField<Type>::operator==(uniformValue_); + const scalar t = this->db().time().value(); + fvPatchField<Type>::operator==(uniformValue_->value(t)); } @@ -119,8 +124,7 @@ template<class Type> void uniformFixedValueFvPatchField<Type>::write(Ostream& os) const { fvPatchField<Type>::write(os); - os.writeKeyword("uniformValue") - << uniformValue_ << token::END_STATEMENT << nl; + uniformValue_->writeData(os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H index 0c7b8e82e0b92fedddd5c0692a91cae9927705e9..1b9da9ca7bf6b15621883e5eeba6904107bfbee3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H @@ -37,6 +37,7 @@ SourceFiles #include "Random.H" #include "fixedValueFvPatchFields.H" +#include "DataEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,7 +45,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class uniformFixedValueFvPatch Declaration + Class uniformFixedValueFvPatch Declaration \*---------------------------------------------------------------------------*/ template<class Type> @@ -54,7 +55,7 @@ class uniformFixedValueFvPatchField { // Private data - Type uniformValue_; + autoPtr<DataEntry<Type> > uniformValue_; public: @@ -127,21 +128,6 @@ public: // Member functions - // Access - - //- Return the fluctuation scale - const Type& uniformValue() const - { - return uniformValue_; - } - - //- Return reference to the fluctuation scale to allow adjustment - Type& uniformValue() - { - return uniformValue_; - } - - // Mapping functions //- Map (and resize as needed) from self given a mapping object