|
[Sponsors] |
[swak4Foam] swakExpression on faceZone returns empty field for non-empty zone |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 21, 2018, 12:51 |
[swak4Foam] swakExpression on faceZone returns empty field for non-empty zone
|
#1 |
Member
James Gross
Join Date: Nov 2017
Posts: 77
Rep Power: 9 |
Hi everybody,
I am trying to use swakExpression to calculate a desired quantity on a faceZone. Before I begin creating the faceZone for the actual region of interest, I thought I would test out the utility on an already defined faceZone that is being already defined from a patch. Ultimately, I would create the faceZone at the desired location, but I thought it would be good to test this out first. However, every time I run the case, there is a FOAM warning about it being an empty field: Code:
Expression cavImpeller1 : --> FOAM Warning : From function Field<T> *SubsetValueExpressionDriver::getFieldInternalAndInterpolate(const word &name,const Subset &sub) in file SubsetValueExpressionDriverI.H at line 264 Going to interpolate p --> FOAM Warning : From function gAverage(const UList<Type>&) in file /home/jg847/foam/foam-extend-4.0/src/foam/lnInclude/FieldFunctions.C at line 541 empty field, returning zero. average=0 Code:
GGI_EXT_ZONE { type faceZone; faceLabels List<label> 169 Code:
cavImpeller1 { type swakExpression; valueType faceZone; zoneName GGI_EXT_ZONE; outputControl timeStep; outputControlMode timeStep; outputInterval 1; enabled true; autoInterpolate true; expression "sum(phi*2*(p+101-3.169))/sum(phi)"; verbose true; allowCoupled true; accumulations ( average ); } Anyone have any ideas as to why this might be the case? James |
|
July 7, 2022, 12:28 |
|
#2 |
Senior Member
Julio Pieri
Join Date: Sep 2017
Posts: 109
Rep Power: 9 |
I know this is an old thread, but just to help future foammers:
To write for a faceZone, you need to declare a "variables" entry before, where you specify the variable name with "{faceZone'facezonename}" indicating the faceZone. The syntax is something like this: Code:
cavImpeller1 { type swakExpression; valueType faceZone; zoneName GGI_EXT_ZONE; outputControl timeStep; outputControlMode timeStep; outputInterval 1; enabled true; autoInterpolate true; variables "dummyVariable{faceZone'zone_name}=sum(phi*2*(p+101-3.169))/sum(phi);" expression "dummyVariable"; verbose true; allowCoupled true; accumulations ( average ); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Foam::error::PrintStack | almir | OpenFOAM Running, Solving & CFD | 92 | May 21, 2024 08:56 |
problems after decomposing for running | alessio.nz | OpenFOAM | 7 | March 5, 2021 05:49 |
Cht tutorial in 15 | braennstroem | OpenFOAM Running, Solving & CFD | 197 | June 10, 2015 04:02 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |