|
[Sponsors] |
How fvOptions guess the dimension of the equation ? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 7, 2021, 00:55 |
How fvOptions guess the dimension of the equation ?
|
#1 |
Member
Join Date: Jun 2019
Posts: 41
Rep Power: 7 |
Hello dear Foamers.
I'm still new to CFD and I hope this questions is not too stupid. Considering this laplacian toy solver : Code:
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- \*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "fvOptions.H" #include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "postProcess.H" #include "addCheckCaseOptions.H" #include "setRootCaseLists.H" #include "createTime.H" #include "createMesh.H" simpleControl simple(mesh); #include "createFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; while (simple.correctNonOrthogonal()) { fvScalarMatrix TEqn ( fvm::laplacian(k, T) == fvOptions(T) ); fvOptions.constrain(TEqn); TEqn.solve(); fvOptions.correct(T); } #include "write.H" runTime.printExecutionTime(Info); } return 0; } // ************************************************************************* // Code:
k k [0 2 0 0 0 0 0] 1e3; Code:
incompatible dimensions for operation [T[0 0 0 1 0 0 0] ] == [T[0 0 -1 1 0 0 0] ] TEqn is an equation of T [0 0 0 1 0 0 0]. Laplacian of T should be [0 -2 0 1 0 0 0] and then fvm::laplacian(k, T) should be [0 0 0 1 0 0 0] with my k being [0 2 0 0 0 0 0]. Thus I would have [0 0 0 1 0 0 0] to he left hand side and I was hopping fvOptions(T) to be [0 0 0 1 0 0 0] on the right hand side but its dimensions are [0 0 -1 1 0 0 0] Thus my question is : how does the fvOptions dimensions are chosen ? Is it always the dimension of the solved field divided by dimTime ? Thanks for having reading me and have a nice week.
__________________
« Debugging is what CFD is about. 5 minutes to modify your code, 5 months to find why it does not work anymore. » |
|
January 24, 2022, 02:22 |
|
#2 |
Member
Join Date: Jun 2019
Posts: 41
Rep Power: 7 |
Up. Anyone could give any advice ?
__________________
« Debugging is what CFD is about. 5 minutes to modify your code, 5 months to find why it does not work anymore. » |
|
January 24, 2022, 05:11 |
|
#3 |
Senior Member
|
The constant k could either be the thermal conductivity (units W/(mK)) see https://en.wikipedia.org/wiki/Thermal_conductivity
or the thermal diffusivity (units m^2/s) see https://en.wikipedia.org/wiki/Thermal_diffusivity fvOptions operates on T and retrieves physical units from T. |
|
Tags |
dimensional error, fvoptions |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Q-criterion in Tecplot360 | john filippou | Main CFD Forum | 11 | December 14, 2021 07:45 |
How can temperature e treated as a passive scalar be used in transport equation? | granzer | OpenFOAM Running, Solving & CFD | 3 | June 6, 2021 17:35 |
Derivation of the Temperature Equation | Tobi | OpenFOAM Programming & Development | 21 | April 10, 2018 23:15 |
Problem with Velocity Poisson Equation and Vector Potential Poisson Equation | mykkujinu2201 | Main CFD Forum | 1 | August 12, 2017 14:15 |
error message | cuteapathy | CFX | 14 | March 20, 2012 07:45 |