CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] groovyBC lookup tables for Reynolds stress R tensor field

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 1 Post By rdbisme
  • 2 Post By Gerhard

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2017, 05:21
Default groovyBC lookup tables for Reynolds stress R tensor field
  #1
Senior Member
 
rdbisme's Avatar
 
Ruben Di Battista
Join Date: May 2013
Location: Paris
Posts: 137
Rep Power: 10
rdbisme is on a distinguished road
Hello,

I searched a bit on the forum and it seems that I'm one of the fewest lucky people that can afford to setup all the six Reynolds stress at the inlet from experimental data .
I'm doing a benchmark simulation to test the behavior of the several turbulence models in that specific case (divergent diffuser) and I would like to see how the RSM models behave.
It's the first time I use RSM models, sorry if I would result a bit unexperienced.

By the way I have experimental points for all the six (uu, uv, uw, vv, vw, ww) Reynolds stress components. In the case of scalar (or vectorial) fields what I do is:

Scalar
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 -1 0 0 0 0];

internalField   uniform 1;

boundaryField
{
    inlet
    {
        type            groovyBC;
        value           $internalField;
        lookuptables (
            {
                name expInlet;
                outOfBounds clamp;
                fileName    "$FOAM_CASE/inlet/omega.dat";
            }
        );
        valueExpression "expInlet(pos().y)";
    }
    outlet
    {
        type            zeroGradient;
    }

    walls
    {   type            omegaWallFunction;
        value           uniform 1e-6;
    }

    front
    {
        type            wedge;
    }
    
    back
    {   
        type            wedge;
    }

    axis
    {
        type            empty;
    }

// ************************************************************************* //
Vector
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 2);


boundaryField
{
    inlet
    {
        type            groovyBC;
        value           $internalField;
        lookuptables (
            {
                name expInlet;
                outOfBounds clamp;
                fileName    "$FOAM_CASE/inlet/u_14_ort.dat";
            }
        );
        valueExpression "-expInlet(pos().y)*normal()";
    }
    outlet
    {
        type            zeroGradient;
    }

    walls
    {   type            noSlip;
    }

    front
    {
        type            wedge;
    }
    
    back
    {   
        type            wedge;
    }

    axis
    {
        type            empty;
    }
}
// ************************************************************************* //
Can I achieve the same for the R tensor field?
Gerhard likes this.
rdbisme is offline   Reply With Quote

Old   November 10, 2018, 06:53
Default
  #2
New Member
 
Gerhard
Join Date: Mar 2017
Posts: 25
Rep Power: 6
Gerhard is on a distinguished road
I am also interested to test RSM models on the ERCOFTAC conical diffuser for which experimental data is available.

Please let me know whether you managed to figure this out.

Thanks
Gerhard is offline   Reply With Quote

Old   November 10, 2018, 10:59
Default
  #3
New Member
 
Gerhard
Join Date: Mar 2017
Posts: 25
Rep Power: 6
Gerhard is on a distinguished road
Hi

I think I might have figured it out.
Let me know what you think.

Tensor

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5                                     |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volSymmTensorField;
    object      R;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform (0 0 0 0 0 0);

boundaryField
{
	inlet
    {
	        type			groovyBC;
		value			uniform (0 0 0 0 0 0);

		lookuptables (
			{
				name		Ruu;
				file		"$FOAM_CASE/0/Ruu.data";
				outOfBounds	clamp;
			}
            {
                name		Rww;
                file		"$FOAM_CASE/0/Rww.data";
                outOfBounds	clamp;
            }
            {
                name		Rvv;
                file		"$FOAM_CASE/0/Rvv.data";
                outOfBounds	clamp;
            }
            {
                name		Ruw;
                file		"$FOAM_CASE/0/Ruw.data";
                outOfBounds	clamp;
            }
            {
                name		Ruv;
                file		"$FOAM_CASE/0/Ruv.data";
                outOfBounds	clamp;
            }
            {
                name		Rvw;
                file		"$FOAM_CASE/0/Rvw.data";
                outOfBounds	clamp;
            }
		);

		variables (
			"origin=vector(0,0,0.025);"  // Patch centre (vector)
			"rp=pos()-origin;"           // Radii from centre (vector)
			"r=mag(rp);"				 // Radii from centre (scalar)
			"vv=symmTensor(1,0,0,0,0,0);"
            "vw=symmTensor(0,1,0,0,0,0);"
            "uv=symmTensor(0,0,1,0,0,0);"
            "ww=symmTensor(0,0,0,1,0,0);"
            "uw=symmTensor(0,0,0,0,1,0);"
            "uu=symmTensor(0,0,0,0,0,1);"
            "xDir=vector(1,0,0);"
            "yDir=vector(0,1,0);"
            "zDir=vector(0,0,1);"
		);

        valueExpression "Rvv(r)*vv + Rww(r)*ww + Ruu(r)*uu + Rvw(r)*vw + Ruw(r)*uw + Ruv(r)*uv";
    }

	casing
    {
        type            kqRWallFunction;
        value           $internalField;
    }

    diffuser
    {
        type            kqRWallFunction;
        value           $internalField;
    }

    dump
    {
        type            zeroGradient;
    }

    outlet
    {
        type            zeroGradient;
    }

	axis
	{
		type			symmetryPlane;
	}

	front
	{
		type			wedge;
	}

	back
	{
		type			wedge;
	}
}

// ************************************************************************* //
rdbisme and godfatherBond like this.
Gerhard is offline   Reply With Quote

Old   July 19, 2021, 02:37
Default Applying temperature only at certain provided locations of x.
  #4
Member
 
sabrina carson
Join Date: Apr 2016
Posts: 54
Rep Power: 7
silviliril is on a distinguished road
I have been trying to simulate nucleate boiling in OpenFOAM. With present model in phaseChangeHeatFoam the wall constant wall temperature can be applied throughout the wall having fixed value. Which generates a thin vapor layer first and then it breaks into several nucleation sites due to density difference. (See bottom nucleation image file attached below)

Now, What I want to do is, apply random value of wall temperature only at certain provided locations (also randomly chosen locations) in lookup table (see posx image file attached below).

I want the nucleation to start only at certain locations and not from entire wall.

One such possibility is to use lookup table feature in groovyBC and another is codedFixedValue BC. But, I could not really figure out that how to use it for my specific purpose.
Attached Images
File Type: jpg botom nucleation.JPG (32.8 KB, 3 views)
File Type: jpg posx.JPG (22.9 KB, 2 views)
silviliril is offline   Reply With Quote

Reply

Tags
groovybc, lrr, reynolds stress model, ssg, swak4foam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
DPMFoam - Serious Error --particle-laden flow in simple geometric config benz25 OpenFOAM Running, Solving & CFD 27 December 19, 2017 20:47
[ANSYS Meshing] Error in Workbench "Unable to attach to geometry file" Jeremie84 ANSYS Meshing & Geometry 70 October 25, 2017 16:03
Lookup tables ali.m.1 OpenFOAM Running, Solving & CFD 2 May 13, 2016 07:11
[swak4Foam] groovyBC 2D lookup ecbmxer OpenFOAM Community Contributions 1 September 24, 2015 10:21
Convergence on anisotropic tetahedral meshes pbo OpenFOAM Running, Solving & CFD 12 December 14, 2010 11:59


All times are GMT -4. The time now is 04:37.