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

Notes for OpenFOAM!

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

In this blog, quick reference notes about OpenFOAM are posted in a form of a summary to address a specific topic per post, which I think could be helpful as a reminder for my Alzheimer condition
Old

OpenFOAM Installation for Multiple Users

Posted March 9, 2013 at 09:26 by Hisham (Notes for OpenFOAM!)
Updated March 10, 2013 at 10:47 by Hisham

If OpenFOAM was installed on a single user account using the OpenCFD binaries then for another user to have access to it is very simple. All one needs to do is to add an alias of the installation in the new user's .bashrc file

Code:
OFver='source /opt/openfoamver/etc/bashrc'
If, on the other hand, OpenFOAM (or OpenFOAM-ext) was compiled on a user account (say the user name is MrX) and a new user (MrY) wants to use the same installation, then:

1. MrX must make sure...
Hisham's Avatar
Senior Member
Posted in Uncategorized
Views 826 Comments 2 Hisham is offline Edit Tags
Old

Set (Initial) Internal Fields Using #codeStream

Posted April 23, 2012 at 13:55 by Hisham (Notes for OpenFOAM!)

To set up (initial) internal fields of variables according to an expression, one can use the #codeStream feature as:
Code:
internalField  #codeStream
{
    code
    #{
        const IOdictionary& d = static_cast<const IOdictionary&>(dict);
        const fvMesh& mesh = refCast<const fvMesh>(d.db());
        scalarField fld(mesh.nCells(), 12.34);// uniform value of the field as 12.34 or just fld(mesh.nCells())
...
Hisham's Avatar
Senior Member
Posted in Uncategorized
Views 894 Comments 1 Hisham is offline Edit Tags
Old

codedFixedValue Boundary Condition

Posted April 11, 2012 at 16:57 by Hisham (Notes for OpenFOAM!)

This is an example of using codedFixedValue boundary condition to input expressions that are time and position dependent.

Code:
    PatchName
    {
      type               codedFixedValue; 
      value              uniform (0 0 0); //$internalField;
      redirectType    BC_Given_Name; 
      code 
	#{ 
	     fixedValueFvPatchVectorField myPatch (*this);
	     forAll(myPatch, celli)
	       {
	         myPatch[celli]
...
Hisham's Avatar
Senior Member
Posted in Uncategorized
Views 1137 Comments 0 Hisham is offline Edit Tags

All times are GMT -4. The time now is 09:53.