/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2013-2026 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 . \*---------------------------------------------------------------------------*/ #include "interstitialInletVelocityFvPatchVectorField.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" #include "fieldMapper.H" #include "surfaceFields.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::interstitialInletVelocityFvPatchVectorField:: interstitialInletVelocityFvPatchVectorField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict ) : fixedValueFvPatchVectorField(p, iF, dict), inletVelocity_("inletVelocity", dimensions::velocity, dict, p.size()), alphaName_(dict.lookupOrDefault("alpha", "alpha")) {} Foam::interstitialInletVelocityFvPatchVectorField:: interstitialInletVelocityFvPatchVectorField ( const interstitialInletVelocityFvPatchVectorField& ptf, const fvPatch& p, const DimensionedField& iF, const fieldMapper& mapper ) : fixedValueFvPatchVectorField(ptf, p, iF, mapper), inletVelocity_(mapper(ptf.inletVelocity_)), alphaName_(ptf.alphaName_) {} Foam::interstitialInletVelocityFvPatchVectorField:: interstitialInletVelocityFvPatchVectorField ( const interstitialInletVelocityFvPatchVectorField& ptf, const DimensionedField& iF ) : fixedValueFvPatchVectorField(ptf, iF), inletVelocity_(ptf.inletVelocity_), alphaName_(ptf.alphaName_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::interstitialInletVelocityFvPatchVectorField::map ( const fvPatchVectorField& ptf, const fieldMapper& mapper ) { fixedValueFvPatchVectorField::map(ptf, mapper); const interstitialInletVelocityFvPatchVectorField& tiptf = refCast(ptf); mapper(inletVelocity_, tiptf.inletVelocity_); } void Foam::interstitialInletVelocityFvPatchVectorField::reset ( const fvPatchVectorField& ptf ) { fixedValueFvPatchVectorField::reset(ptf); const interstitialInletVelocityFvPatchVectorField& tiptf = refCast(ptf); inletVelocity_.reset(tiptf.inletVelocity_); } void Foam::interstitialInletVelocityFvPatchVectorField::updateCoeffs() { if (updated()) { return; } const fvPatchField& alphap = patch().lookupPatchField(alphaName_); operator==(inletVelocity_/alphap); fixedValueFvPatchVectorField::updateCoeffs(); } void Foam::interstitialInletVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchField::write(os); writeEntryIfDifferent(os, "alpha", "alpha", alphaName_); writeEntry(os, "inletVelocity", inletVelocity_); writeEntry(os, "value", *this); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { makePatchTypeField ( fvPatchVectorField, interstitialInletVelocityFvPatchVectorField ); } // ************************************************************************* //