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

varied vector component boundary conditions

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

Like Tree1Likes
  • 1 Post By ziemowitzima

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 17, 2010, 14:22
Default varied vector component boundary conditions
  #1
Senior Member
 
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 145
Rep Power: 17
ziemowitzima is on a distinguished road
Hello,
Does anyone know if there is already a defined boundary conditions for vectors which allows you to assign different types/values for each vector component? For example:
Suppose vector U=(u,v,w), I would need to define:
du/dn=const
dv/dn=0
but
w=0

Thanks for ur help
ZM
ziemowitzima is offline   Reply With Quote

Old   March 5, 2012, 04:51
Smile hi dear
  #2
New Member
 
reza hemmat
Join Date: Jan 2012
Posts: 24
Rep Power: 14
rezahemmat1985 is on a distinguished road
hi dear
as we know the temperature of of engine cylinder temperature is different in each point and it is difficult to set a temperature to each point . I have got an Abacus CAD file of the studying engine and it includes the temperature values in each point . I wamma to know how can I set temperature to each point . for example for point (1,4,0) T1=100'C , (3,0,2) T2=102'C , ..... tnx in advance
tnx dear
i will appreciate alot I need your experience
rezahemmat1985 is offline   Reply With Quote

Old   March 5, 2012, 06:32
Default
  #3
Senior Member
 
calim_cfd's Avatar
 
mauricio
Join Date: Jun 2011
Posts: 172
Rep Power: 17
calim_cfd is on a distinguished road
hello!

reza, i guess your looking for sth like this

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

dimensions      [0 0 0 1 0 0 0];

internalField   nonuniform List<scalar> 
4000
(
350.064
350.062
350.065
350.071
350.071
350.071
350.076
350.076
350.073
...
);
thats for the volume value.. for patches is the same...
Code:
 ceiling
    {
        type            externalWallHeatFluxTemperature;
        refValue        uniform 0;
        refGradient     nonuniform List<scalar> 
400
(
12337.1
16255.5
17486.6
18193.3
20460.2
21914.4
23840.9
27023.1
29589.5
...
);
you only need to know the ordering rules in OpenFOAM and i guess you're done !

hope it helps!
__________________
Best Regards
/calim

"Elune will grant us the strength"
calim_cfd is offline   Reply With Quote

Old   March 5, 2012, 11:35
Default
  #4
Senior Member
 
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 145
Rep Power: 17
ziemowitzima is on a distinguished road
Hi,
But what do you mean exactly ?
Boundary Condition or some function (source term) ?
There is several way to do this.
I personally opt for modifying the original source code. There is easy way to set BC and any value or functions you want in the source code and the re-compile it again.
Some example is here:

/////////////added to chancge bc (in time, in space)
label inletPatchID = mesh.boundaryMesh().findPatchID("in");
const fvsPatchVectorField& centre = mesh.Cf().boundaryField()[inletPatchID];
const fvsPatchVectorField& normal = mesh.Sf().boundaryField()[inletPatchID];
fvPatchVectorField& uu = U.boundaryField()[inletPatchID];

deltaT=runTime.deltaT().value();
t=t+deltaT;

forAll(uu,faceI){
nx=normal[faceI].component(0);
ny=normal[faceI].component(1);
nz=normal[faceI].component(2);
magg=Foam::sqrt(nx*nx+ny*ny+nz*nz);
nx=nx/magg;ny=ny/magg;nz=nz/magg;
if (centre[faceI].component(2)>0.08){
uu[faceI].component(0)=-nx*(Foam::sin(2*3.14159*1.333*t)+0.3)*tt[faceI];
uu[faceI].component(1)=-ny*(Foam::sin(2*3.14159*1.333*t)+0.3)*tt[faceI];
uu[faceI].component(2)=-nz*(Foam::sin(2*3.14159*1.333*t)+0.3)*tt[faceI];
}
}

//////////END

This code make your BC on the patch "in" time and space dependent.
tt -- is some function of space.

In general you can read any data to your openFoam variables, the same way as you would do in C or C++.

But of course, there are some already done procedures in OF to do this, just check more carefully all examples which come with OF installation.

-Best
ZM
mm.abdollahzadeh likes this.
ziemowitzima is offline   Reply With Quote

Reply

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
Impinging Jet Boundary Conditions Anindya Main CFD Forum 25 February 27, 2016 13:58
[Netgen] boundary conditions and mesh exporting vaina74 OpenFOAM Meshing & Mesh Conversion 2 May 27, 2010 10:38
Pressure boundary conditions Lionel S. Main CFD Forum 1 August 24, 2007 19:03
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15
A problem about setting boundary conditions lyang Main CFD Forum 0 September 19, 1999 19:29


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