View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003478 | OpenFOAM | Patch | public | 2020-04-08 13:53 | 2020-04-10 09:37 |
Reporter | tniemi | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | dev | ||||
Fixed in Version | dev | ||||
Summary | 0003478: copiedFixedValue, fixedMultiPhaseHeatFlux: added missing clone and mapping functions | ||||
Description | I have attached a patch which adds missing clone functions to copiedFixedValue and fixedMultiPhaseHeatFlux. Due to missing functions, if user is loading libraries in controlDict which include these BCs, the missing clone-functions cause issues. For example reconstructed fields will became fixedValue. The patch also adds rmap and automap functions to fixedMultiPhaseHeatFlux because it has a scalarField member variable. | ||||
Tags | No tags attached. | ||||
|
patch.diff (5,464 bytes)
diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H index 39da7c5..d6d0d6c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.H @@ -99,6 +99,15 @@ public: const copiedFixedValueFvPatchScalarField& ); + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new copiedFixedValueFvPatchScalarField(*this) + ); + } + //- Copy constructor setting internal field reference copiedFixedValueFvPatchScalarField ( @@ -106,6 +115,18 @@ public: 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 copiedFixedValueFvPatchScalarField(*this, iF) + ); + } + // Member Functions diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C index 0eae0be..d617027 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.C @@ -167,6 +167,31 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs() } +void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + fixedValueFvPatchScalarField::autoMap(m); + m(q_, q_); +} + + +void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + fixedValueFvPatchScalarField::rmap(ptf, addr); + + const fixedMultiPhaseHeatFluxFvPatchScalarField& mptf = + refCast<const fixedMultiPhaseHeatFluxFvPatchScalarField>(ptf); + + q_.rmap(mptf.q_, addr); +} + + void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::write(Ostream& os) const { fvPatchField<scalar>::write(os); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H index 04e27f3..2c8c557 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleTurbulenceModels/derivedFvPatchFields/fixedMultiPhaseHeatFlux/fixedMultiPhaseHeatFluxFvPatchScalarField.H @@ -111,6 +111,15 @@ public: const fixedMultiPhaseHeatFluxFvPatchScalarField& ); + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new fixedMultiPhaseHeatFluxFvPatchScalarField(*this) + ); + } + //- Copy constructor setting internal field reference fixedMultiPhaseHeatFluxFvPatchScalarField ( @@ -118,9 +127,31 @@ public: 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 fixedMultiPhaseHeatFluxFvPatchScalarField(*this, iF) + ); + } + // Member Functions + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + // Used to update fields following mesh topology change + virtual void autoMap(const fvPatchFieldMapper&); + + //- Reverse map the given fvPatchField onto this fvPatchField + // Used to reconstruct fields + virtual void rmap(const fvPatchScalarField&, const labelList&); + // Evaluation functions //- Update the coefficients associated with the patch field |
|
Here is also a small patch for some completely random, unrelated typos. typos.diff (6,545 bytes)
diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.H b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.H index b02b2d3..df40c00 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleLoop/pimpleLoop.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,7 +99,7 @@ public: //- Maximum number of pimple correctors inline label nCorrPimple() const; - //- Flat to indicate any pimple iteration + //- Flag to indicate any pimple iteration inline bool anyPimpleIter() const; //- Flag to indicate the first pimple iteration diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pisoControl/pisoControl.H b/src/finiteVolume/cfdTools/general/solutionControl/pisoControl/pisoControl.H index 0e8d57c..9e6c9e8 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pisoControl/pisoControl.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/pisoControl/pisoControl.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -96,7 +96,7 @@ public: //- Maximum number of piso correctors inline label nCorrPiso() const; - //- Flat to indicate any piso iteration + //- Flag to indicate any piso iteration inline bool anyPisoIter() const; //- Flag to indicate the first piso iteration diff --git a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/nonOrthogonalSolutionControl/nonOrthogonalSolutionControl.H b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/nonOrthogonalSolutionControl/nonOrthogonalSolutionControl.H index 390028c..957fa17 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/nonOrthogonalSolutionControl/nonOrthogonalSolutionControl.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/nonOrthogonalSolutionControl/nonOrthogonalSolutionControl.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,7 +94,7 @@ public: //- Maximum number of non-orthogonal correctors inline label nCorrNonOrth() const; - //- Flat to indicate any non-orthogonal iteration + //- Flag to indicate any non-orthogonal iteration inline bool anyNonOrthogonalIter() const; //- Flag to indicate the first non-orthogonal iteration diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H index 47fa7b0..882eaba 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -86,7 +86,7 @@ class totalTemperatureFvPatchScalarField //- Heat capacity ratio scalar gamma_; - //- Total pressure + //- Reference temperature scalarField T0_; @@ -162,13 +162,13 @@ public: // Access - //- Return the total pressure + //- Return the reference temperature const scalarField& T0() const { return T0_; } - //- Return reference to the total pressure to allow adjustment + //- Return reference to the temperature to allow adjustment scalarField& T0() { return T0_; diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index 220bf2e..06e182f 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H @@ -216,15 +216,15 @@ public: // Member Functions - //- Return conat access to the interpolator for continuous + //- Return const access to the interpolator for continuous // phase density field inline const interpolation<scalar>& rhoInterp() const; - //- Return conat access to the interpolator for continuous + //- Return const access to the interpolator for continuous // phase velocity field inline const interpolation<vector>& UInterp() const; - //- Return conat access to the interpolator for continuous + //- Return const access to the interpolator for continuous // phase dynamic viscosity field inline const interpolation<scalar>& muInterp() const; |
|
Thanks Timo Resolved by commit 53ac3f223ad399df78ec40f72bc271776356c68d |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-04-08 13:53 | tniemi | New Issue | |
2020-04-08 13:53 | tniemi | File Added: patch.diff | |
2020-04-09 05:52 | tniemi | File Added: typos.diff | |
2020-04-09 05:52 | tniemi | Note Added: 0011283 | |
2020-04-10 09:37 | henry | Assigned To | => henry |
2020-04-10 09:37 | henry | Status | new => resolved |
2020-04-10 09:37 | henry | Resolution | open => fixed |
2020-04-10 09:37 | henry | Fixed in Version | => dev |
2020-04-10 09:37 | henry | Note Added: 0011285 |