|
[Sponsors] |
Possible to use cellZone for manipulateField? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 2, 2013, 05:27 |
Possible to use cellZone for manipulateField?
|
#1 |
New Member
Join Date: Aug 2013
Posts: 1
Rep Power: 0 |
Hello everybody,
I am working on a problem where I have to modify a field (drag) during run time. I already figured out that this is possible with manipulateField (swak4foam) and have a test case which is running in the right way: Code:
test { type manipulateField; mask "pos().x>5 && pos().x<6 && pos().y>0.5 && pos().y<0.7"; expression "0.087+0.2*time()/100"; fieldName drag; outputControl timeStep; outputInterval 1; writeManipulated true; } Code:
testenergy { type swakExpression; valueType cellZone; zoneName testCellZone; variables "rho=1000;acell=20"; expression "rho/2*drag*mag(U)*mag(U)*mag(U)*acell"; accumulations ( sum ); verbose true; autoInterpolate true; warnAutoInterpolate false; } |
|
May 27, 2014, 10:49 |
manipulateField and cellZone <-> Really not possible?
|
#2 |
Member
Andreas Ruopp
Join Date: Aug 2009
Location: Stuttgart / Germany
Posts: 31
Rep Power: 16 |
Hello,
I encountered the same problem. Does anyone know the solution and wants to share it??? Many thanks in advance! |
|
June 12, 2014, 08:15 |
swak4foam: own manipulateField.C/H
|
#3 |
Member
Andreas Ruopp
Join Date: Aug 2009
Location: Stuttgart / Germany
Posts: 31
Rep Power: 16 |
Hello,
I looked into swak4Foam and it is not so difficult to use cellZones. Since manipulateField.C is marking cells with value 1 which have to be manipulated and all other cells are marked with value 0. one can programm it's own mymanipulateField.C/H and do the following. Read in your cellZone Code:
cellZoneExpression_(word(dict.lookup("zoneName"))) Code:
autoPtr<volScalarField> conditionField_; get the volScalarField with marked cells with the function call: Code:
FieldValueExpressionDriver &driver=driver_(); volScalarField &cField =conditionField_(); cField = driver.makeCellZoneField(cellZoneExpression_); Hope, this helps for somebody who encounter the same problem. Andy |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pimpleDyMFoam - more than one cellZone | bephi | OpenFOAM Running, Solving & CFD | 1 | May 23, 2013 08:44 |
how to set concentric cylinder zones by cellZone option? | sachinlb | OpenFOAM Pre-Processing | 1 | September 28, 2012 03:20 |
porous media (cellzone) | thisisit | FLUENT | 1 | November 24, 2011 03:32 |
How to compute cellZone volume | vinz | OpenFOAM Programming & Development | 11 | August 2, 2010 17:38 |
[snappyHexMesh] How can I put snappy layers in a separate cellzone? | overkligheten | OpenFOAM Meshing & Mesh Conversion | 1 | April 5, 2010 09:18 |