|
[Sponsors] |
January 5, 2012, 11:19 |
how to change a volScalarField in bc?
|
#1 |
New Member
Kathrin
Join Date: Nov 2011
Posts: 15
Rep Power: 14 |
I need to add a source term in the time loop, which is calculated in one of my boundary conditions.
First I defined the following field in createFields.H: Code:
Info<< "Creating field sourceH\n" << endl; volScalarField sourceH ( IOobject ( "sourceH", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), Hclip/dim_s*0 ); But how can I change the values of the field in the bc??? I tried the following: Code:
scalarField sourceH = patch().lookupPatchField<volScalarField, scalar>("sourceH").patchInternalField(); scalar groundArea = 1.0; scalarField srcH = (HU.boundaryField()[patchNr]&n)/groundArea; scalar cellSource = (gSum(srcH))/patch().size(); for (int celli = 0; celli <= patch().size(); celli++) { sourceH[celli]=cellSource; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Solid/liquid phase change | fabian_roesler | OpenFOAM | 10 | December 24, 2012 06:37 |
Change cell zone index/thread during simulation | neilduffy1024 | FLUENT | 0 | January 17, 2011 09:40 |
Is there a way to change the name a volScalarField | liu | OpenFOAM Running, Solving & CFD | 2 | October 18, 2007 17:49 |
no enthalpy change across the momentum source | Atit Koonsrisuk | CFX | 2 | December 19, 2005 02:33 |
Multicomponent fluid | Andrea | CFX | 2 | October 11, 2004 05:12 |