|
[Sponsors] |
April 23, 2011, 12:23 |
volScalarField question
|
#1 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
Hi all,
I am trying to define a new volScalarField mu. I want to use it as a diffusivity in the transport equation. Now since this field is to be calculated, and not solved for, I cannot specify boundary conditions for it. But how do I make sure that the boundary fields also get updated? This would be important in my mind, as the value might need to be interpolated to call faces during use. It would be very helpful if some one could come up with an answer. Thanks. |
|
April 26, 2011, 10:16 |
|
#2 |
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19 |
You can specify boundary conditions for any field. Normally a diffusivity would have zeroGradient boundary conditions but you could also just make them fixedValue and then update the fixedValue boundaries appropriately.
After updating the field, do a: Code:
mu.correctBoundaryConditions(); |
|
April 26, 2011, 11:02 |
|
#3 | |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
Quote:
Thanks. |
||
April 26, 2011, 11:28 |
|
#4 | |
Senior Member
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19 |
Quote:
Code:
label wall = mesh.boundaryMesh().findPatchID("INSERT_PATCH_NAME_HERE"); Info << mu.boundaryField()[wall][0] << endl; mu.correctBoundaryFields(); Info << mu.boundaryField()[wall][0] << endl; I did find this post though: http://www.cfd-online.com/Forums/ope...perations.html which implies it may not work in parallel...but I haven't verified this and it's quite an old post. |
||
January 22, 2013, 08:41 |
correcting internalfield of a not-solving volscalarfield in each time step
|
#5 | |
Member
|
Quote:
I have a the following variable: Code:
volScalarField diffus ( IOobject ( "diffus", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), lambda/cp ); How can I correct "diffus" before using it? Thanks, Mohammad |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problems with creating a volScalarField | georlade | OpenFOAM Programming & Development | 4 | December 4, 2016 13:31 |
Syntax question relating volScalarField | sabin.ceuca | OpenFOAM Programming & Development | 3 | April 2, 2015 05:05 |
Calculate volume average of volScalarField | tangd | OpenFOAM Running, Solving & CFD | 3 | May 1, 2013 14:37 |
A question about the source code of realizableKE.C | yuhai | OpenFOAM Programming & Development | 1 | June 26, 2009 09:05 |
question | K.L.Huang | Siemens | 1 | March 29, 2000 05:57 |