CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   stop lagrangian parcels in cell zone (https://www.cfd-online.com/Forums/openfoam-programming-development/138833-stop-lagrangian-parcels-cell-zone.html)

Chrisi1984 July 11, 2014 15:28

stop lagrangian parcels in cell zone
 
Hello all,

I would like to be able to stop lagrangian particles in a specified cell zone.

In the lagrangian folder "lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel" I can find the calculation of the particle velocity "this->U_" in the file "ReactingMultiphaseParcel.C".

How to implement there anything that I gain "this->U_=0" for all particles those are in a specified cell zone?

Is this the right environment to assign the velocity zero to all particles in the specified cell zone (if I will use parcels of the type ReactingMultiphaseParcel)?

Kind regards,
Chrisi

Chrisi1984 August 1, 2014 10:50

Hello,

it seems that nobody has an idea how one can stop parcels in a specified cell zone.

Due to the case that in a porous media the flow is orientated in one direction. It would also help me if I would be able to introduce an if clause that stops all parcels those are in a cell where the gas flow velocity is nearly zero in a given direction.

Does anybody of you has an idea how to do so?

Kind regards

Chrisi

Chrisi1984 August 3, 2014 04:40

Hello all,

related to the same topic I want to ask how should the code look like to make a query whether a cell belongs to a specified porous zone or not.

Thanks in advance and have a nice weekend!

Chrisi1984 August 20, 2014 14:35

Hi,

regarding my probleme it would help me to know, how I can make a query wheter the cell where the parcel is belongs to a specified cellZone or not.
I tried to do it with a loop over all cells. But that is too expansive.
Quote:

forAll(mesh.cellZones(), iZone) //loop over all cellZones
{
if ((mesh.cellZones()[iZone].name() == "porous"))

{

forAll(mesh.cellZones()[iZone], iCell) //loop over all cells in Zone
{

if (iCell=cellI)

{
Unew = vector(0, 0, 0);
}


else
{
Unew = Ures.value();
}



}

}

else
{
Unew = Ures.value();
}

}
Any ideas?

Kind regards
Chrisi


All times are GMT -4. The time now is 23:11.