|
[Sponsors] |
January 13, 2023, 11:04 |
codedFixedValue
|
#1 |
New Member
Fab
Join Date: Apr 2019
Posts: 27
Rep Power: 7 |
Hello,
I'm looking for a way to use the scalar value given by a surfaceFieldValue function as a fixedValue boundary condition after each iteration. I guess I can use codedFixedValue but I don't know how to write the piece of code that would do that. As I don't know what to do, I'm trying to code a new BC that would be something like this : #include "fvCFD.H" #include "surfaceFields.H" class fixedSurfaceScalarFieldValue : public fixedValueFvPatchScalarField { const surfaceScalarFieldValue& surfaceFieldValue_; public: fixedSurfaceScalarFieldValue(const fvPatch& patch, const DimensionedField<scalar, volMesh>& iF, const dictionary& dict) : fixedValueFvPatchScalarField(patch, iF), surfaceFieldValue_(db().lookupObject<surfaceScalar FieldValue>(dict.lookup("functionObject"))) { // empty } scalar value() const { return surfaceFieldValue_.value()(patch().Cf(), patch().index()); } }; makePatchTypeField(fixedSurfaceScalarFieldValue); Last edited by Rotidpor; January 13, 2023 at 12:05. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
including parameter file in codedFixedValue | Loekatoni | OpenFOAM Running, Solving & CFD | 4 | November 9, 2023 17:56 |
Syntax of codedFixedValue | trailer | OpenFOAM Running, Solving & CFD | 1 | July 24, 2021 07:17 |
[sedFoam] codedFixedValue does not transport alpha fields | victor13165 | OpenFOAM Running, Solving & CFD | 0 | July 13, 2021 10:30 |
codedFixedValue: accessing other patch causes crash in parallel | RL-S | OpenFOAM Running, Solving & CFD | 2 | December 24, 2019 22:20 |
Using codedFixedvalue to apply totalPressure Boundary Condition | cdm | OpenFOAM Running, Solving & CFD | 2 | June 22, 2013 15:10 |