|
[Sponsors] |
September 20, 2019, 17:40 |
Run time calculating non-dimensional fields
|
#1 |
Member
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 8 |
Greetings to all!
I am trying to calculate non-dimensional fields. Such as: Tn ( IOobject ( "Tn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), (T-Tc)/(Th-Tc) ); Un ( IOobject ( "Un", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), U/U0 ); of course, I defined Th and Tc, U0. This should actually work but it doesnt. It correctly calculates initial values but it doesn't calculate it for all iterations. In last iteration I still have same Tn values of the first iteration. I should be missing something. Of course, I can calculate it in paraview but I am trying to gain some time. Any help would be great, Eren. |
|
September 21, 2019, 11:19 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 14 |
If you put those somewhere like createFields, they will just be initialized (not updated). To update them, you'll need to put
Code:
Tn = (T - Tc)/(Th - Tc) Caelan |
|
September 21, 2019, 15:22 |
|
#3 | |
Member
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 8 |
Quote:
Thank you sir! It is working. How about runtime calculation of gradients? I defined GUn in createFields and added following line to code: Code:
GUn= con * fvc::grad(Un) But not working. error: no match for 'operator=' |
||
September 21, 2019, 20:02 |
|
#4 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 14 |
Well it is hard to diagnose why it might not be working without seeing the code you've written or the corresponding error, but I'd guess that you haven't specified GUn as a volVectorField. Another option is to take the magnitude of the gradient to make it a scalar field.
Caelan |
|
September 21, 2019, 20:37 |
|
#5 |
Member
Join Date: Jun 2012
Posts: 76
Rep Power: 13 |
Is GUn of type volTensorField? Calculating the gradient of a vector (here: velocity) results in a tensor. Maybe that's the reason for the error.
|
|
September 22, 2019, 03:55 |
|
#6 |
Senior Member
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21 |
||
September 22, 2019, 06:54 |
|
#7 |
Member
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 8 |
And it quickly solves my error! I changed field and it compiled. Thank you all!
Hope this thread will help another fellas to gain some time too! |
|
September 22, 2019, 08:13 |
|
#8 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12 |
OpenFOAM-Doxygen is your friend to deduce the types of objects, defined operators and so on in OpenFOAM software:
OpenFOAM-Doxygen
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
LES, Courant Number, Crash, Sudden | Alhasan | OpenFOAM Running, Solving & CFD | 5 | November 22, 2019 02:05 |
Inconsistencies in reading .dat file during run time in new injection model | Scram_1 | OpenFOAM | 0 | March 23, 2018 22:29 |
Floating point exception error | lpz_michele | OpenFOAM Running, Solving & CFD | 53 | October 19, 2015 02:50 |
Transient run continues from last time (when startover is desired) | bongbang | CFX | 2 | March 22, 2015 23:05 |
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 | bookie56 | OpenFOAM Installation | 8 | August 13, 2011 04:03 |