Re: [DuMux] Non isothermal coupled exercise

2024-04-05 Thread Christoph Grüninger

Hi Suzon,
check if the linear system is set up correctly. Reduce the grid size to 
as small as possible (like 1x6) and check if the matrix contains entries 
everywhere you expect it. If non-zero entries are missing in the linear 
system (matrix), you have an indictaion where to look for the error.


Bye
Christoph

--
L'enjeu est de bâtir la France de nos enfants,
pas de ressasser la France de notre enfance.
   [Emmanuel Macron, 2022]
___
DuMux mailing list
DuMux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


Re: [DuMux] Non isothermal coupled exercise

2024-04-05 Thread Suzon Jammes

Hi Edward,


Thank you for you answer, it did help. The code is now compiling (with a 
warning-> porousmediumsubproblem.hh:324:19: warning: variable ‘values’ 
set but not used [-Wunused-but-set-variable]) but doesn't run :-(!


The linear solver doesn't converge so there is still a problem somewhere.


To keep it simple, I just added a constant temperature in the 
initialAtPos function in the porousmediumsubproblem and a 
freeflowsubproblem but it doesn't work. Any idea why it doesn't converge ?


I am attaching the .hh files that I am using that are a slightly 
modified version of the exercises/exercise-coupling-ff-pm/models.



Thank you for your help,


Suzon





On 02/04/2024 16:25, Coltman, Edward wrote:


Hello Suzon,


I'm not sure if this is really where you are working, but assuming:

- the error you are working on is coming from the 
"evaluateInterfaceFluxes" function,


- in porousmediumsubproblem.hh header file,

- and you have added a call to evaluate the face-wise flux at 
somepoint that looks like this:



>

NumEqVector flux = 
couplingManager().couplingData().massCouplingCondition(element, 
fvGeometry, elemVolVars, scvf)
                                   * scvf.area() * 
elemVolVars[scvf.insideScvIdx()].extrusionFactor() * 
FluidSystem::molarMass(1) * -1.0 * 86400.0;

> (taken from the exercise solution)


Then there will be a compatibility problem between the call to the 
"massCouplingCondition(...)" function, and the type NumEqVector.



NumEqVector will have three entries (FieldVector<[...],3>, including 
the added temperature), and the returned vector from the 
massCouplingCondition(...) function will only have two entries 
(FieldVector<[...],2>, only evaluating the mass fluxes).



To fix this, you can use the correct type (for this I would recommend 
to simply use the auto type).


If this is not where your error is coming from, it would be very 
helpful if you could send us a bit more output from the compiler 
error. This is just a best guess based on the line number and error 
you have mentioned.


Best,
Ned


*From:* DuMux  on behalf of 
Suzon Jammes 

*Sent:* Tuesday, April 2, 2024 4:01 PM
*To:* DuMux User Mailing List
*Subject:* Re: [DuMux] Non isothermal coupled exercise
Hi Christoph,

I was able to use non isothermal condition with another example using 
TwoPNCNI model so I guess that the problem comes from the coupling part.
I assume that indeed the temperature should be taken into at the 
coupling interface but I am not sure how to do that.

Should I modify something in the couplingManager ?
Thanks for your help,

—
Suzon Jammes
Researcher & Consultant

M sas, Geology by Research
www.mandu-geology.fr
su...@mandu-geology.fr / +33(0)768692934



Ce message est confidentiel. Son contenu ne représente en aucun cas 
un engagement de la part de M SAS sous reserve de tout accord conclu 
par écrit avec la société. Toute publication, utilisation
ou diffusion, meme partielle, doit être autorisée préalablement. 
Si vous n'êtes pas destinataire de ce message, merci d'en 
avertir immédiatement l'expéditeur ou par email :cont...@mandu-geology.fr.


This message is confidential. Its contents do not constitute 
a commitment by M SAS except
 where provided for in a written  agreement with the company. 
Any unauthorised disclosure, use
or dissemination, either whole or partial, is prohibited. If you 
are not the intended recipient, please notify the sender

immediately or with the following email: cont...@mandu-geology.fr




On 30 Mar 2024, at 16:23, Christoph Grüninger  wrote:

Hi Suzon,
I did not look into the code, so I might guess wrong.

I suspect that by adding temperature, you got a third primary 
variable. The error points out that you are using a vector with two 
entries (representing two primary variables) at a place where you 
should use a vector with three entries (for all three primary vars).


I hope this helps you figuring out what went wrong.

Bye
Christoph


Am 29.03.24 um 11:14 schrieb Suzon Jammes:

Hi all,
I am now working from the coupled exercise 
(exercises/exercise-coupling-ff-pm/models) with a 2pnc model. I 
wanted to make it non-isothermal so I change TwoPNC by TwoPNCNI and 
NavierStockesNC by NavierStockesNCNI in the properties file but I 
get the following error :
error: conversion from ‘FieldVector<[...],2>’ to non-scalar type 
‘FieldVector<[...],3>’ requested
  263 | elemVolVars[scvf.insideScvIdx()].extrusionFactor() * 
FluidSystem::molarMass(1) * -1.0 * 86400.0;
I don't understand what does it mean. Does anybody know how to fix 
this problem ?

Thank you
Suzon Jammes
___
DuMux mailing list
DuMux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


--
L'enjeu est de bâtir la France de nos enfants,
pas de ressasser la France de notre enfance.
  [Emmanuel Macron,