|
[Sponsors] |
August 17, 2010, 14:22 |
varied vector component boundary conditions
|
#1 |
Senior Member
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 145
Rep Power: 17 |
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 |
|
March 5, 2012, 04:51 |
hi dear
|
#2 |
New Member
reza hemmat
Join Date: Jan 2012
Posts: 24
Rep Power: 14 |
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 |
|
March 5, 2012, 06:32 |
|
#3 |
Senior Member
mauricio
Join Date: Jun 2011
Posts: 172
Rep Power: 18 |
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 ... ); 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 ... ); hope it helps!
__________________
Best Regards /calim "Elune will grant us the strength" |
|
March 5, 2012, 11:35 |
|
#4 |
Senior Member
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 145
Rep Power: 17 |
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 |
|
|
|
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 |