|
[Sponsors] |
integral of the gradient of a variable over a face during unsteady simulation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 20, 2017, 00:52 |
integral of the gradient of a variable over a face during unsteady simulation
|
#1 |
New Member
Bingchuan
Join Date: Dec 2017
Posts: 16
Rep Power: 9 |
Hi All,
I want to get the integral of the gradient of a variable (e.g. Temperature) over a face during doing an unsteady simulation. 1. First, I computed the gradient of the variable by adding the following code into the main function of the solver, then it is compiled. Code:
volVectorField gradT(fvc::grad(T)); volScalarField gradTx ( IOobject ( "gradTx", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), gradT.component(vector::X) ); volScalarField gradTy ( IOobject ( "gradTy", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), gradT.component(vector::Y) ); volScalarField gradTz ( IOobject ( "gradTz", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), gradT.component(vector::Z) ); 2. I planed to use the function objects. I put the patchIntegrate file in the system directory of my case, which was included by the controlDict file. The item fields in the patchIntegrate file are defined as Code:
fields (U gradT) Code:
fields (U gradTx) 3. Then I tried the singleGraph in the same way as patchIntegrate. No gradT or gradTx such data was wrote along the line I defined neither. Is there anyone knows how to solve this problem or anyone has better strategy to do this? Thank you very much. kind regards, Bingchuan |
|
December 20, 2017, 05:46 |
|
#2 |
New Member
Bingchuan
Join Date: Dec 2017
Posts: 16
Rep Power: 9 |
Can anyone bring me a ray of light?
many Thanks. |
|
December 20, 2017, 07:06 |
|
#3 | |
Senior Member
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15 |
Hi
can you show us the case folder? At least, the controlDict file. Quote:
|
||
December 21, 2017, 07:19 |
|
#4 |
New Member
Bingchuan
Join Date: Dec 2017
Posts: 16
Rep Power: 9 |
Dear Agustin,
Thanks for your reply. Below is the information of my transient simulation. 1. Code added into the main function of the solver Code:
.... volVectorField gradT(fvc::grad(T)); volScalarField gradTx ( IOobject ( "gradTx", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), gradT.component(vector::X) ); .... Code:
.... timeFormat general; timePrecision 6; runTimeModifiable true; adjustTimeStep no; maxCo 0.5; // ************************************************************************* // functions { /#includeFunc patchIntegrate } Code:
name Mypatch; fields ( U T gradT gradTx); operation areaIntegrate; type surfaceRegion; libs ("libfieldFunctionObjects.so"); regionType patch; writeControl timeStep; writeInterval 1; ... Issue: Integrals of fields U and T at every timestep have been outputted successfully. However, It is failed to output the integral of gradT and gradTx. log information: FOAM warning: From function Foam::label Foam::sampledSets::classifyFields() in file sampledSetsGrouping.C at line 140 cannot find registered field matching gradT. (The same warning for gradTx) Thanks. Bests, Bingchuan |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] Internal walls of zero thickness | anger | OpenFOAM Meshing & Mesh Conversion | 23 | February 6, 2020 19:25 |
[snappyHexMesh] sHM layer process keeps getting killed | MBttR | OpenFOAM Meshing & Mesh Conversion | 4 | August 15, 2016 04:21 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 08:36 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |
Procedure to run unsteady simulation? | STN | Main CFD Forum | 2 | February 16, 2002 05:37 |