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

Applying a retarding shear in a row of cells for incompressible flows

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 20, 2023, 04:56
Default Applying a retarding shear in a row of cells for incompressible flows
  #1
Member
 
Marķa Rosales
Join Date: Mar 2023
Location: Spain
Posts: 48
Rep Power: 3
MMRC is on a distinguished road
Hello community,
Can you please give me your opinion in this implementation of 'retarding shear stress' proposed by Richard & Hoxey (1993) in the row of cells adyacent to wall that helps to minimize the over production of TKE and so the peak of TKE when plotting against vertical profile: shear = rho * (u_friction)²
I'm running simpleFoam, must I remove or keep rho (density) in the calculation of the source?
By using topoSetDict we can catch the first row of cells adyacent to ground patch (wall): first patchToFace and then setToCellZone.

Then, by using fvOptions codedVectorSource:
PHP Code:
retardingShear{    type            vectorCodedSource;    selectionMode   cellZone;    cellZone        areaSet;  // name of my cellZone    fields          (U);    writeToFile     true;    name            retardingShear;        codeCorrect        #{        #};    codeConstrain    #{    #};        codeInclude        #{        #};    codeAddSup            #{                vectorField& retardingShear = eqn.source();  // will asign calculation to source side of fvMatrix         vector Ufriction (-0.57 0 0); // is the friction velocity near wall         vector diskRetardingShear (-1 0 0); // is the direction opposite to normal wind flow                const labelList& cellIDs = cells();                forAll(cellIDs, i)                {                    label cellI = cellIDs[i];                            retardingShear[cellI] += mag(Ufriction)*diskRetardingShear; // the left side with += is thought to be 'a sink', AND the right side is the value of shear with its current direction                }} 
Is it good practice to combine '+=' (sink assigment) with the current direction of this retarding shear ?
I've seen that some user multiplies the sources term by cell volumes, when is this needed?
I apologize but I lost the original code and this code is what I remember that I could run.
Any ideas are welcome

Last edited by MMRC; November 20, 2023 at 06:13.
MMRC is offline   Reply With Quote

Old   November 22, 2023, 11:28
Default
  #2
Member
 
Marķa Rosales
Join Date: Mar 2023
Location: Spain
Posts: 48
Rep Power: 3
MMRC is on a distinguished road
Hello community,

Here is my code, in fact, it helped to lower the effect of over production of TKE


codedSource
{
type vectorCodedSource;
selectionMode cellSet;
cellSet groundCellSet;

fields (U);
name retardingshear;
codeInclude
#{
#};

codeCorrect
#{

#};
codeAddSup
#{

vectorField& Usource = eqn.source();
const scalarField& V = mesh_.V();
vector dir(-1,0,0);
// Apply the source
forAll(V, i)
{
// cell volume specific source
Usource[i] -= (0.1*V[i])*dir;
};

#};
codeConstrain
#{

#};
}


The value I used was thinking that I should have input of it without density , because I'll be using density. The use of volume of the cell is something that I copy someone used for their sources on other fields, maybe this is not correct.


Please share your comments, this supposed to be a 'retarding shear stress' applied to the cell adjacent to ground patch
MMRC is offline   Reply With Quote

Reply

Tags
fvoption, shear stress, sources


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
Calculating source term total cell-zone volume parallel computation RobV Fluent UDF and Scheme Programming 2 May 30, 2022 04:46
[snappyHexMesh] snappyHexMesh does not detect highly skewed faces? ptpacheco OpenFOAM Meshing & Mesh Conversion 1 January 4, 2022 13:37
cellZone not taking all the cells inside rahulksoni OpenFOAM Running, Solving & CFD 6 January 25, 2019 01:11
cellZone not taking all the cells inside rahulksoni OpenFOAM 0 January 16, 2019 02:16
shear force applying Danial1992 FLUENT 0 May 23, 2017 04:19


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