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

setExprBoundaryFields not reading condition expression

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 27, 2022, 05:26
Default setExprBoundaryFields not reading condition expression
  #1
Member
 
Luca
Join Date: Mar 2011
Location: Italy
Posts: 62
Rep Power: 15
marluc is on a distinguished road
Dear Foamers,


I am encountering a problem using setExprBoundaryField with OF-2106. Indeed, it seems that it cannot read the condition specified in the dictionary below.


Can someone explain me the reason?
Thank you in advance,
Luca



Code:
updateBCs
{
    field   T;

    nonUniformHeatFlux
    {
        target  value;
        variables
        (
            "zMin = 5"
            "zMax = 10"
        );
        condition
        #{
            (pos().z() > zMin && pos().z() < zMax)
        #};
        expression
        #{
            pos().z()
        #};
    }

    expressions
    (
        { $nonUniformHeatFlux; patch walls; }
    );
}
EDIT:
I have realized that the conditional statement works if inside the expression, as listed in the code below:
Code:
updateBCs
{
    field   T;

    nonUniformHeatFlux
    {
        target  value;
        variables
        (
            "zMin = 5"
            "zMax = 10"
        );
//        condition
//        #{
//            (pos().z() > zMin && pos().z() < zMax)
//        #};
        expression
        #{
            (pos().z() > zMin && pos().z() < zMax) ? pos().z() : 0
        #};
    }

    expressions
    (
        { $nonUniformHeatFlux; patch walls; }
    );
}
Anyway, I find quite strange that the first code works with setExprFields and not with setExprBoundaryFields, as should be the case according to the manual page https://www.openfoam.com/news/main-n...pre-processing

Last edited by marluc; March 27, 2022 at 13:15. Reason: workaround
marluc 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
[Commercial meshers] fluentMeshToFoam: "fluent patch type shadow not recognised" preibie OpenFOAM Meshing & Mesh Conversion 28 March 29, 2017 04:56
execFlowFunctionObjects - unknown field problem Toorop OpenFOAM Post-Processing 16 March 14, 2016 03:25
writing execFlowFunctionObjects immortality OpenFOAM Post-Processing 30 September 15, 2013 06:16
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 18:44
Lift, Drag Vs time chart,calculations Jamesd69climber CFX 8 February 17, 2005 17:23


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