|
[Sponsors] |
fvm::div("phi", U) always requires registered phi? |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Jim Park
Join Date: Nov 2020
Posts: 5
Rep Power: 6 ![]() |
I am modifying simpleFoam such that I can operate with two fluids, which do not mix but shares the same mesh.
I have prepared new fields which are U1, U2, p1, p2, phi1, and phi2. So, I no longer have the original U,p,phi, and such. Now, when I try to run the following piece of code (which is itself a part of original UEqn.H in simpleFoam): fvVectorMatrix tU1Eqn ( fvm::div(phi1, U1) ); I get an error saying failed lookup of phi (objectRegistry region0) available objects of type surfaceScalarField: 2(phi2 phi1). Obviously, there is no phi since I intend to work with phi1 and phi2. But, it is quite surprising that even if the input arguments to fvm::div were phi1 and U1, it still tries to find phi. When compiling, I did not have any error. Do you have any suggestion on how to work this out? |
|
![]() |
![]() |
![]() |
![]() |
#3 | |
New Member
Jim Park
Join Date: Nov 2020
Posts: 5
Rep Power: 6 ![]() |
Quote:
I tried modifying the scalarTransportFoam so that all the variables like T, U, phi are converted to T1, U1, phi1. I ran the pitzDaily in the tutorials/basic/scalarTransportFoam, and there is no complaint. What a surprise. I am suspecting whether this has more to do with the case directory settings than the solver itself. Answering the other part of your comment, if my solver (which tries to adapt the simpleFoam) did use phi somewhere, then I would be getting an error during compilation of the solver because I do not declare phi at all. However, during compilation, there is no error. It only spits out an error during the execution of the case with the solver. I will keep digging and try to experiment with the modified scalarTransportFoam with different initial/boundary conditions... |
||
![]() |
![]() |
![]() |
![]() |
#4 |
New Member
Jim Park
Join Date: Nov 2020
Posts: 5
Rep Power: 6 ![]() |
I found that it might have to do with whether you are working with fvScalarMatrix or fvVectorMatrix.
For example, fvScalarMatrix TEqn ( fvm::div(phi1, T1) == fvOptions(T1) ); This works without errors. But, fvVectorMatrix tUEqn ( fvm::div(phi1, U1) == fvOptions(U1) ); This will try to search for phi during execution and throw error if phi is not there as a registered object. I am not sure whether there is some dynamic referencing that is happening to actively search for phi when you run fvVectorMatrix..? |
|
![]() |
![]() |
![]() |
Tags |
divergence, flux |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Windkessel boundary implementation | Filippo70 | OpenFOAM Programming & Development | 0 | November 7, 2024 12:04 |
[General] Extracting ParaView Data into Python Arrays | Jeffzda | ParaView | 30 | November 6, 2023 22:00 |
Correction procedure on a non-orthogonal skewed Mesh | me.ouda | OpenFOAM Programming & Development | 0 | January 18, 2017 10:05 |
mixerVesselAMI2D's mass is not balancing | sharonyue | OpenFOAM Running, Solving & CFD | 6 | June 10, 2013 10:34 |