diff --git a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C index 15cd29904f..3fe7aad567 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.C @@ -179,7 +179,6 @@ Foam::mixedFvPatchField::valueInternalCoeffs ) const { return Type(pTraits::one)*(1.0 - valueFraction_); - } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index bdbcbfd421..14fc5b7f91 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -109,6 +109,7 @@ Foam::fvPatchField::fvPatchField ) : Field(p.size()), + libs_(ptf.libs_), patch_(p), internalField_(iF), updated_(false), @@ -134,6 +135,7 @@ Foam::fvPatchField::fvPatchField ) : Field(ptf), + libs_(ptf.libs_), patch_(ptf.patch_), internalField_(iF), updated_(false), @@ -248,6 +250,11 @@ void Foam::fvPatchField::write(Ostream& os) const { writeEntry(os, "patchType", patch().type()); } + + if (libs_.size()) + { + writeEntry(os, "libs", libs_); + } } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index a417e1c3ab..6d28094b21 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -46,6 +46,7 @@ SourceFiles #include "fvPatch.H" #include "DimensionedField.H" +#include "fileNameList.H" #include "fieldTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -87,6 +88,9 @@ class fvPatchField { // Private Data + //- Optional list of libraries required for this boundary condition + fileNameList libs_; + //- Reference to patch const fvPatch& patch_; diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C index 88b508e40e..a72a831ea4 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,6 +113,13 @@ Foam::tmp> Foam::fvPatchField::New << endl; } + libs.open + ( + dict, + "libs", + dictionaryConstructorTablePtr_ + ); + typename dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(patchFieldType); @@ -161,7 +168,14 @@ Foam::tmp> Foam::fvPatchField::New } } - return cstrIter()(p, iF, dict); + tmp> ptf(cstrIter()(p, iF, dict)); + + if (dict.found("libs")) + { + dict.lookup("libs") >> ptf.ref().libs_; + } + + return ptf; } diff --git a/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T b/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T index 87f1c2ee39..dabfd0945f 100644 --- a/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T +++ b/tutorials/modules/CHT/shellAndTubeHeatExchanger/0/solid/T @@ -29,11 +29,17 @@ boundaryField solid_to_shell { type coupledTemperature; + + libs ("libcoupledThermophysicalTransportModels.so"); + value $internalField; } solid_to_tube { type coupledTemperature; + + libs ("libcoupledThermophysicalTransportModels.so"); + value $internalField; } } diff --git a/tutorials/modules/CHT/shellAndTubeHeatExchanger/system/controlDict b/tutorials/modules/CHT/shellAndTubeHeatExchanger/system/controlDict index 362d162683..63fde8ca8a 100644 --- a/tutorials/modules/CHT/shellAndTubeHeatExchanger/system/controlDict +++ b/tutorials/modules/CHT/shellAndTubeHeatExchanger/system/controlDict @@ -23,8 +23,6 @@ regionSolvers tube fluid; } -libs ("libcoupledThermophysicalTransportModels.so"); - startFrom startTime; startTime 0;