CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

codedFixedValue

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 13, 2023, 10:04
Default codedFixedValue
  #1
New Member
 
Fab
Join Date: Apr 2019
Posts: 27
Rep Power: 6
Rotidpor is on a distinguished road
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 11:05.
Rotidpor is offline   Reply With Quote

Reply


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 14:53.