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

Possible to use cellZone for manipulateField?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 2, 2013, 05:27
Default Possible to use cellZone for manipulateField?
  #1
New Member
 
Join Date: Aug 2013
Posts: 1
Rep Power: 0
waljoh is on a distinguished road
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;
}
Now I would like to use a cellZone instead of the term in the mask line. Is that possible in a similar way to a swakExpression?
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;
}
waljoh is offline   Reply With Quote

Old   May 27, 2014, 10:49
Exclamation manipulateField and cellZone <-> Really not possible?
  #2
Member
 
Andreas Ruopp
Join Date: Aug 2009
Location: Stuttgart / Germany
Posts: 31
Rep Power: 16
andyru is on a distinguished road
Hello,

I encountered the same problem.
Does anyone know the solution and wants to share it???

Many thanks in advance!
andyru is offline   Reply With Quote

Old   June 12, 2014, 08:15
Smile swak4foam: own manipulateField.C/H
  #3
Member
 
Andreas Ruopp
Join Date: Aug 2009
Location: Stuttgart / Germany
Posts: 31
Rep Power: 16
andyru is on a distinguished road
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")))
create an autoPtr conditionField:
Code:
autoPtr<volScalarField> conditionField_;
then
get the volScalarField with marked cells with the function call:
Code:
FieldValueExpressionDriver &driver=driver_();
        volScalarField &cField =conditionField_();
        cField = driver.makeCellZoneField(cellZoneExpression_);
since the function makeCellZoneField is already in FieldValueExpressionDriver

Hope, this helps for somebody who encounter the same problem.

Andy
andyru 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
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


All times are GMT -4. The time now is 17:46.