varied vector component boundary conditions
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 |
hi dear
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 |
hello!
reza, i guess your looking for sth like this Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
ceiling hope it helps! |
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 |
All times are GMT -4. The time now is 11:31. |