CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM


Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   January 13, 2023, 10:04
Default codedFixedValue
New Member
Join Date: Apr 2019
Posts: 27
Rep Power: 7
Rotidpor is on a distinguished road

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_;

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());


Last edited by Rotidpor; January 13, 2023 at 11:05.
Rotidpor is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
including parameter file in codedFixedValue Loekatoni OpenFOAM Running, Solving & CFD 4 November 9, 2023 16:56
Syntax of codedFixedValue trailer OpenFOAM Running, Solving & CFD 1 July 24, 2021 06:17
[sedFoam] codedFixedValue does not transport alpha fields victor13165 OpenFOAM Running, Solving & CFD 0 July 13, 2021 09:30
codedFixedValue: accessing other patch causes crash in parallel RL-S OpenFOAM Running, Solving & CFD 2 December 24, 2019 21:20
Using codedFixedvalue to apply totalPressure Boundary Condition cdm OpenFOAM Running, Solving & CFD 2 June 22, 2013 14:10

All times are GMT -4. The time now is 08:57.