CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   boundary conditions for simpleFoam calculation (https://www.cfd-online.com/Forums/openfoam-solving/72832-boundary-conditions-simplefoam-calculation.html)

foam_noob February 19, 2010 03:49

boundary conditions for simpleFoam calculation
 
1 Attachment(s)
Hello everyone,

I am currently simulating the airflow over a car. I know what the results should look like, but after changing the boundary condition numerous times I am still unable to get realistic results (tried with both kepsilon model and komega model). I posted a picture of my simulation below (blended out some walls) as well as added the boundary conditions.

fvSchemes and fvSolution were taken from either the motorbike tutorial (for k omega model) or pitzDaily tutorial (k epsilon model). I am calculating with simpleFoam. R, omega and k were also taken from these tutorials.

Appreciate the help :).

Patrick


P.S Which model (k epsilon / k omega model) is better for this calculation?

epsilon:

Code:


 
dimensions      [0 2 -3 0 0 0 0];
 
internalField  uniform 14.855;
 
boundaryField
{
 
“car_.*”
{
    type            epsilonWallFunction;
    value          uniform 14.855;
}
 
road_noslip
{
    type            epsilonWallFunction;
    value          uniform 14.855;
}
symmetry
{
    type            symmetryPlane;
}
topwall
{
    type            slip;
}
sidewall
{
    type            slip;
}
inlet
{
    type            fixedValue;
    value          uniform 14.855;
}
outlet
{
    type            zeroGradient;
}
roadslip
{
    type            slip;
}
}

nut:

Code:

dimensions      [0 2 -1 0 0 0 0];
 
internalField  uniform 0;
 
boundaryField
{
 
“car_.*”
{
    type            nutWallFunction;
    value          uniform 0;
}
road_noslip
{
    type            nutWallFunction;
    value          uniform 0;
}
symmetry
{
    type            symmetryPlane;
}
topwall
{
    type            calculated;
    value          uniform 0;
}
sidewall
{
    type            calculated;
    value          uniform 0;
}
inlet
{
    type            calculated;
    value          uniform 0;
}
outlet
{
    type            calculated;
    value          uniform 0;
}
roadslip
{
    type            calculated;
    value          uniform 0;
}
}

p:

Code:

dimensions      [0 2 -2 0 0 0 0];
 
internalField  uniform 0;
 
boundaryField
{
 
“car_.*”
{
    type            zeroGradient;
}
 
road_noslip
{
    type            zeroGradient;
}
symmetry
{
    type            symmetryPlane;
}
topwall
{
    type            slip;
}
sidewall
{
    type            slip;
}
inlet
{
    type            zeroGradient;
}
outlet
{
    type            fixedValue;
    value          uniform 0;
}
roadslip
{
    type            slip;
}
}

U:

Code:

dimensions      [0 1 -1 0 0 0 0];
 
internalField  uniform (27.77 0 0);
 
boundaryField
{
“car_.*”
{
    type            fixedValue;
    value          uniform (0 0 0);
}
 
road_noslip
{
    type            fixedValue;
    value          uniform (0 0 0);
}
symmetry
{
    type            symmetryPlane;
}
topwall
{
    type            slip;
}
sidewall
{
    type            slip;
}
inlet
{
    type            fixedValue;
    value          uniform (27.77 0 0);
}
outlet
{
    type            zeroGradient;
}
roadslip
{
    type            slip;
}
}

k:

Code:

dimensions      [0 2 -2 0 0 0 0];
 
internalField  uniform 0.24;
 
boundaryField
{
“car_.*”
{
    type            kqRWallFunction;
    value          uniform 0.24;
}
road_noslip
{
    type            kqRWallFunction;
    value          uniform 0.24;
}
symmetry
{
    type            symmetryPlane;
}
topwall
{
    type            slip;
}
sidewall
{
    type            slip;
}
inlet
{
    type            fixedValue;
    value          uniform 0.24;
}
outlet
{
    type            inletOutlet;
    inletValue      uniform 0.24;
    value          uniform 0.24;
}
roadslip
{
    type            slip;
}
}

omega:

Code:

dimensions      [0 0 -1 0 0 0 0];
 
internalField  uniform 1.78;
 
boundaryField
{
“car_.*”
{
    type            omegaWallFunction;
    value          uniform 1.78;
}
road_noslip
{
    type            omegaWallFunction;
    value          uniform 1.78;
}
symmetry
{
    type            symmetryPlane;
}
topwall
{
    type            slip;
}
sidewall
{
    type            slip;
}
inlet
{
    type            fixedValue;
    value          uniform 1.78;
}
outlet
{
    type            fixedValue;
    value          uniform 1.78;
}
roadslip
{
    type            slip;
}
}

R:

Code:

dimensions      [0 2 -2 0 0 0 0];
 
internalField  uniform (0 0 0 0 0 0);
 
boundaryField
{
“car_.*”
{
    type            zeroGradient;
}
road_noslip
{
    type            zeroGradient;
}
symmetry
{
    type            symmetryPlane;
}
topwall
{
    type            slip;
}
sidewall
{
    type            slip;
}
inlet
{
    type            fixedValue;
    value          uniform (0 0 0 0 0 0);
}
outlet
{
    type            zeroGradient;
}
roadslip
{
    type            slip;
}
}


foam_noob February 26, 2010 02:03

problem solved

bjr March 2, 2010 04:04

Do you like your drag results?

foam_noob March 2, 2010 07:03

I haven't had the chance to implement liftDrag from OF 1.2. I have to do that when I have time. If you know a different way to calculate the drag coefficient with OF please share :).

bjr March 2, 2010 14:37

functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so");
outputControl timeStep;
outputInterval 1;

patches (OBJECT_OBJECT);
pName p;
Uname U;
log true;
rhoName rhoInf;
rhoInf 1.17;
magUInf 0.0045;
CofR (1.25 0 4);
}

forceCoeffs
{
type forceCoeffs;
functionObjectLibs ("libforces.so");
outputControl timeStep;
outputInterval 1;

patches (OBJECT_OBJECT);
pName p;
Uname U;
log true;
rhoName rhoInf;
rhoInf 1.17;
magUInf 0.0045;
CofR (1.25 0 4);

liftDir (0.0 1.0 0.0);
dragDir (1.0 0.0 0.0);
pitchAxis (0 0 0);

lRef 0.5;
Aref 12.56;

}


I use something like this in my /system/controlDict file. You must alter for your case, but this is a start. I'm not sure in which version that a forces function object (vocabulary?) was introduced off-hand.

Regards,
Ben Racine

bjr March 2, 2010 14:50

The following thread is the reference for the above statements.
http://www.cfd-online.com/Forums/ope...es-v1-6-a.html

foam_noob March 3, 2010 06:10

Hey Ben,

Thanks for the code. I tried it and it worked without any problems.

I have a couple of question regarding this code.

1. Which patches should I use for my simulation? Do I use every patch that defines the vehicle (I split the car into multiple parts: wheels, windshields and so on)?

2. And what is lRef? How do I calculate it?

3. Do you know a method for calculating Aref?

Appreciate the help :)

Patrick Wang

bjr March 3, 2010 20:17

1. Which patches should I use for my simulation? Do I use every patch that defines the vehicle (I split the car into multiple parts: wheels, windshields and so on)? Yes

2. And what is lRef? How do I calculate it?
I believe it's the the length-scale used for finding Re number.

3. Do you know a method for calculating Aref?
Aref is probably best done by doing a 2D frontal area projection of your surface model in some CAD package... as I believe it's typical to use frontal area in vehicle aerodynamics when calculating drag coefficients.

Hope this helps and someone can correct if I'm wrong anywhere.
Ben

baklanton July 1, 2015 08:07

baklanton
 
Hi Patrick,

I am also experiencing an issue which is similar to the one you explained in your first post. Could you please explain how you solved it?

Thank you!


All times are GMT -4. The time now is 07:08.