95Foam::fv::topOSource::topOSource
98 const word& modelType,
105 interpolationFieldName_(
word::null),
123 <<
"Adding Brinkman source to " << eqn.
psi().
name() <<
endl;
136 <<
"Adding Brinkman source to " << eqn.
psi().
name() <<
endl;
150 <<
"Adding Brinkman source to " << eqn.
psi().
name() <<
endl;
164 <<
"Adding Brinkman source to " << eqn.
psi().
name() <<
endl;
173 const word& fieldName,
174 const word& designVariablesName
177 const label fieldi = applyToField(fieldName);
185 <<
"Postprocessing Brinkman sensitivities for field "
186 << fieldName <<
endl;
205 fieldNames_ = coeffs_.get<
wordList>(
"names");
206 interpolationFieldName_ = coeffs_.get<
word>(
"interpolationField");
207 applied_.setSize(fieldNames_.size(),
false);
216 darcyFlow_ = coeffs_.getOrDefault<
bool>(
"darcyFlow",
false);
219 Da_.reset(
new scalar(coeffs_.getOrDefault<scalar>(
"Da", 1.e-5)));
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const DynamicField< Type > & field() const noexcept
Return const-reference to the primitive field values.
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Base abstract class for handling finite volume options (i.e. fvOption).
const word & name() const noexcept
Return const access to the source name.
List< bool > applied_
Applied flag list - corresponds to each fieldNames_ entry.
const fvMesh & mesh_
Reference to the mesh database.
static autoPtr< option > New(const word &name, const dictionary &dict, const fvMesh &mesh)
Return a reference to the selected fvOption model.
wordList fieldNames_
Field names to apply source to - populated by derived models.
option(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
virtual label applyToField(const word &fieldName) const
Return index of field name if found in fieldNames list.
virtual bool read(const dictionary &dict)
Read source dictionary.
dictionary coeffs_
Dictionary containing source coefficients.
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Implements Brinkman penalisation terms for topology optimisation. Looks up the indicator field (beta)...
word interpolationFieldName_
Interpolation field name.
bool darcyFlow_
Does this option apply to a Darcy flow model.
scalar betaMax_
Optional betaMax.
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual tmp< DimensionedField< scalar, volMesh > > getSource()
Compute the source term based on the indicator field.
autoPtr< scalar > Da_
Dimensionless Darcy number.
autoPtr< topOInterpolationFunction > interpolation_
Interpolation function.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Add implicit contribution to momentum equation.
virtual void postProcessSens(scalarField &sensField, const word &fieldName=word::null, const word &designValue=word::null)
Multiply sensitivities with the derivative of the interpolation function.
bool foundObject(const word &name, const bool recursive=false) const
Contains the named Type?
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
label nCells() const noexcept
Number of mesh cells.
A class for managing temporary objects.
Base class for all design variables related to topology optimisation (topO). Provides the lookup func...
virtual void sourceTerm(DimensionedField< scalar, volMesh > &field, const topOInterpolationFunction &interpolationFunc, const scalar betaMax, const word &interpolationFieldName="beta") const
Populate source terms for the flow equations.
scalar getBetaMax() const
Get betaMax value.
virtual void sourceTermSensitivities(scalarField &sens, const topOInterpolationFunction &interpolationFunc, const scalar betaMax, const word &designVariablesName, const word &interpolationFieldName="beta") const
Post-processing sensitivities due to interpolations based on the indicator fields.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Calculate the finiteVolume matrix for implicit and explicit sources.
#define DebugInfo
Report an information message using Foam::Info.
Namespace for finite-volume.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
List< word > wordList
List of word.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
const dimensionSet dimless
Dimensionless.
bool read(const char *buf, int32_t &val)
Same as readInt32.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.