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

Fixed Value BC with operations with fields

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 31, 2021, 08:10
Post Fixed Value BC with operations with fields
  #1
New Member
 
Join Date: May 2021
Posts: 3
Rep Power: 5
elb31 is on a distinguished road
Hello everybody

I am a newbie in OpenFOAM trying to develop a boundary condition derived from fixedValue. I would like to impose a value for a field, let's say D, such as each face of the boundary patch assumes the value:
Code:
D[faceI] = D.oldTime()[faceI] + DD[faceI]
Where DD is the field representing the increment of D over the past time-step.

Have you got any suggestions on how I can approach this simple problem?

Thank you for any help/suggestion !
- elb

Edit:

To be more precise in my request, what I've tried to do is modifying the updateCoeffs() function from one of the existing derived BC from fixedValue in the following way:
Code:
void calculateTotalField::updateCoeffs()
{
    if (this->updated())
    {
        return;
    }   

    const volVectorField& Dold =
            db().lookupObject<volVectorField>("D").oldTime();

    const volVectorField& DD =
            db().lookupObject<volVectorField>("DD");
    
    vectorField disp;
    disp = Dold.boundaryField()[patch().index()] + DD.boundaryField()[patch().index()];

    fvPatchField<vector>::operator==(disp);

    fixedValueFvPatchVectorField::updateCoeffs();
}
Is this a valid solution?

Thanks!
-elb

Last edited by elb31; June 1, 2021 at 04:48. Reason: Increased level of detail in the posed question.
elb31 is offline   Reply With Quote

Reply

Tags
boundary condition, fixedvalue, incremental, openfoam

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
Accessing PtrList of fields from boundary condition Diro7 OpenFOAM Programming & Development 4 April 8, 2020 12:58
Setting U fixed value at the outlet? greg.cfd OpenFOAM Running, Solving & CFD 0 April 23, 2015 08:02
several fields modified by single boundary condition schröder OpenFOAM Programming & Development 3 April 21, 2015 05:09
Fan Boundary Condition OR Fixed Values or Source Terms SolarX FLUENT 1 June 9, 2011 04:13
Has the pressure to be fixed at one node? Steve Song Main CFD Forum 5 February 9, 2003 13:14


All times are GMT -4. The time now is 13:45.