CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Boundary condition based on cellZone values

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

LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2020, 09:23
Default Boundary condition based on cellZone values
New Member
Join Date: Feb 2020
Posts: 5
Rep Power: 5
dygu is on a distinguished road

I'd like to specify an inlet/outlet boundary condition for velocity using something like the flowRateInletVelocity condition where the massFlowRate is specified based on the mass flow rate measured at a cellZone elsewhere in the domain. I tried to achieve this using swak4Foam:

        type            flowRateInletVelocity;
        flowRateExpression "0";
        flowRate        swak
                        variables               ( "mass_in{cellZone'pump_zone}=sum(rhoPhi);" );
                        expression              "mass_in*-1";
                        valueType               patch;
                        patchName               outlet;
                        independentVariableName t;
        massFlowRate    $flowRate;
        value           uniform (0 0 0);
but I get an error that rhoPhi is not in memory or on disc. If I instead use some patch in place of the cellZone, the simulation works.

Can swak4Foam access cellZone data for specifying boundary conditions? If that is not the case, would a coded BC help? Or is it possible to have an internal patch in place of the cellZone that is transparent to the flow and yet can measure the mass flow rate through it so that I can use that patch in the swak expression?

Thank you for any hints!
dygu is offline   Reply With Quote

Old   February 5, 2020, 13:57
New Member
Join Date: Feb 2020
Posts: 5
Rep Power: 5
dygu is on a distinguished road
I now realize that a cellZone does not have access to rhoPhi as that is a face-based value. I switched to a faceZone to resolve this problem:

variables               ( "mass_in{faceZone'f0}=sum(rhoPhi);" );
When using a dynamic mesh, I got an error "initSwakFunctionObject::movePoints isn't properly implemented". I am testing my luck by suppressing this as suggested by the message with the following in the controlDict:

        // needed to allow DataEntry to work
        type initSwakFunctionObject;
        region region0;
        ignore_unimplemented_initSwakFunctionObject::movePoints true;
Assuming that this works on a dynamic mesh, I wonder if I can recreate this functionality without swak4Foam to minimize the number of add-ons to install on remote compute nodes?

Thank you
dygu is offline   Reply With Quote


codedboundarycondition, swak4foam

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
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 09:44
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 05:39
Low Mixing time Problem Mavier CFX 5 April 29, 2013 01:00
Storing Boundary Condition Values for Later Use Fransje OpenFOAM Programming & Development 9 December 9, 2011 12:00

All times are GMT -4. The time now is 01:21.