|
[Sponsors] |
March 20, 2019, 10:26 |
fvOptions fix field using field
|
#1 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,675
Rep Power: 66 |
OF 2.4.x
It is quite easy to fix the values of a field to a set scalar/vector by using fvOptions. E.g., I can set the value of b to be uniform everywhere all the time to the value 1 by using: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvOptions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // banana { type scalarExplicitSetValue; active true; selectionMode all; scalarExplicitSetValueCoeffs { injectionRate { b 1; } } } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvOptions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // coldCase { type scalarExplicitSetValue; active true; selectionMode all; // points; cellSet; cellZone; all; scalarExplicitSetValueCoeffs { injectionRate { b $bMean; } } } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Yes this obviously is equivalent to skipping the solution of an equation (but that requires rebuilding the solver which might break other things because b is coupled to other stuff). |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] problems with averaging a new field | fgarita | OpenFOAM Community Contributions | 1 | October 28, 2016 03:27 |
velocity field of MRF, GGI and rotatingWallVelocity | tonky | OpenFOAM Programming & Development | 1 | October 14, 2016 11:04 |
[General] How to create an additional vector with {Field 4, Field 5, Field 6} | Bombacar | ParaView | 1 | August 15, 2015 18:05 |
''unknown radialModelType type Gidaspow'' PROBLEM WITH THE BED TUTORIAL | AndoniBM | OpenFOAM Running, Solving & CFD | 2 | March 25, 2015 18:44 |
How to fix a value in the buoyanPimpleFoam solver? | samiam1000 | OpenFOAM | 13 | April 5, 2012 04:09 |