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

Boundary condition based on cellZone values

Register Blogs Community New Posts Updated Threads Search

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

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:

Code:
    outlet
    {
        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, 12:57
Default
  #2
New Member
 
Join Date: Feb 2020
Posts: 5
Rep Power: 6
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:

Code:
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:

Code:
    initSwak
    {
        // 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

Reply

Tags
codedboundarycondition, swak4foam


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


All times are GMT -4. The time now is 07:24.