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

User defined bc

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 6, 2008, 13:12
Default HI All, ...urs kind attenti
  #21
New Member
 
Bhuvnesh verma
Join Date: Mar 2009
Location: Bangalore, Karnataka, India
Posts: 12
Rep Power: 17
bhuve is on a distinguished road
HI All,
...urs kind attention is required, actully my problem is calculation at boundary. so its similar to Anja Stretz's problem .his prob. is..


Here it is:
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/turbulenceModel/turbulenceModel.H"

int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
# include "initContinuityErrs.H"

Info<< "\nStarting time loop\n" << endl;

// Change bc:

// Get index of patch
label inletPatchID = mesh.boundaryMesh().findPatchID("inlet");
// Get reference to boundary field value
fvPatchVectorField& inletu = U.boundaryField()[inletPatchID];
// get coordinate for cell centres
const fvPatchVectorField& centre = mesh.C().boundaryField()[inletPatchID];

scalarField x = centre.component(vector::X);
scalarField y = centre.component(vector::Y);
scalarField z = centre.component(vector::Z);

scalar n_1 = 0.159159;
scalar n_2 = -0.030791;

dimensionedScalar a
(
"a",
dimensionSet(0, -1, -1, 0, 0, 0, 0),
scalar(0.826871257),
);

dimensionedScalar s
(
"s",
dimensionSet(0, 1, -1, 0, 0, 0, 0),
scalar(4),
);

vector Cp = vector::zero;

dimensionedScalar d
(
"d",
dimensionSet(0, 1, 0, 0, 0, 0, 0),
scalarField(mag(mesh.C() - Cp)),
);

scalarField Ux = sqrt((s-d*d*a)*(s-d*d*a)/(n_1*n_1 + n_2*n_2))* n_1;
scalarField Uy = sqrt((s-d*d*a)*(s-d*d*a)/(n_1*n_1 + n_2*n_2))* n_2;
scalar Uz = 0.0;

inletu = vector(Ux, Uy, Uz);

U.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n\n" << endl;


Info<< "End\n" << endl;

return(0);
} .......in my case it is preesue , temperatures also ,...its error on inletu=vector(..);..i commented it. but even values are not updating of inletp for pressure ,and inlett for temperature which are scalars...someone tried such problem?..thanks
bhuve 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
User defined function hari FLUENT 0 October 9, 2007 04:24
User-Defined Fan Socrate FLUENT 0 March 28, 2007 11:25
User Defined GUI Frederik FLUENT 0 June 23, 2006 17:12
user defined viscosity solomon FLUENT 0 July 13, 2003 22:09
User Defined Scalar Sebeci FLUENT 0 April 9, 2003 02:51


All times are GMT -4. The time now is 17:01.