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

Initial conditions for simulation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2011, 09:47
Question Initial conditions for simulation
  #1
New Member
 
lazersos@gmail.com
Join Date: Apr 2011
Posts: 11
Rep Power: 14
lazersos is on a distinguished road
I'm working on a steady-state flow problem where there is a non-uniform (but constant) vector field (magnetic field). I'd like to implement this in the code but I'm running into issue finding the relevant examples. First, is the vector field defined at the center of the cells or at the edges. Second, I can already calculate the three cartesian components of the field given the cartesian coordinates of the point at which I want to know the field. How exactly should I go about implementing this?

I was thinking some code like:
Code:
label internalPatchID = mesh.??????
fvPatchVectorField& B=B.internalField()[internalPatchID];
const fvPatchVectorField& centre = mesh.C().internalField()[internalPatchID];
scalarField x = centre.component(vector::X);
scalarField y = centre.component(vector::Y);
scalarField z = centre.component(vector::Z);
Here's a third problem. How do I loop over the individual elements of x y and z. If I had a function which provided the field like:
Code:
B==func_bx(x,y,z)*vector(1,0,0)+func_by(x,y,z)*vector(0,1,0)+func_bz(x,y,z)*vector(0,0,1);
would that work?

Anyone have a good reference to this information?
lazersos is offline   Reply With Quote

Reply


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
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
Error while running rhoPisoFoam.. nileshjrane OpenFOAM Running, Solving & CFD 8 August 26, 2010 12:50
lift and drag on ship superstructures vaina74 OpenFOAM Running, Solving & CFD 3 June 8, 2010 12:30
Problems with simulating TurbFOAM barath.ezhilan OpenFOAM 13 July 16, 2009 05:55
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 11:16


All times are GMT -4. The time now is 11:59.