Trouble reading in flux

General discussion about Elmer
Post Reply
barnburnr
Posts: 9
Joined: 15 Jun 2011, 19:43
Antispam: Yes

Trouble reading in flux

Post by barnburnr »

Here's a newbie question. I am running three solvers: HeatEquation, FluxSolver, and AdvectionDiffusion. The idea is to compute a constant velocity field for AdvectionDiffusion by computing the flux of the temperature of the heat equation. Since my heat-equation is steady-state, I am running it in a separate sif file from AdvectionDiffusion. Everything works fine in scenario 1:

1. Compute Temperature with flow.sif file.
2. Read in temperature in transport.sif (using Restart File and Restart Position commands).
3. Compute flux by specifying Exec Solver = Before All for the FluxSolver.
4. Equate the components of the Convection Velocity to the components of the flux variable in the Material section.
5. Run AdvectionDiffusion solver.

While this works just fine, I'd prefer to compute the flux in flow.sif instead of in transport.sif. The only changes I make is to move the solver calling FluxSolver from transport.sif to flow.sif since all variable names will remain the same and I am still reading from the same restart file. Running flow.sif works great and the output shows the flux just as it was outputted when included in transport.sif. Unfortunatley, running transport.sif results in a segmentation fault which I've tracked to ModelDescription.f90 under the "Count degress of freedom to be saved" section. The code is attempting to run through all of the variables but when it encounters "temperature flux[temperature flux:2]", it drops into a loop:

DO k=1,Var % DOFs
Var => Var % Next
END DO

Runs through this twice (since flux has two DOFs) and then segfaults after exiting the case statement on the command:

Var => Var % Next

It appears as though Temperature % Next % Next is an undefined pointer. Naively, I tried simply nullifying it but that didn't work. I'm a C programmer so my intuition tells me that the linked list construction wasn't completed correctly but I haven't had the time to track down why. Any help?

Thanks,
Kevin
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Trouble reading in flux

Post by raback »

Hi

There is probably indeed some bug that comes up due to the unorthodox use of Restart. Perhaps you could omit the Restart part and decleare the Heat equation steady by using the optional keyword in Solver section

Code: Select all

Time Derivative Active = Logical False
Nicely advanced question for a newbie!

-Peter
barnburnr
Posts: 9
Joined: 15 Jun 2011, 19:43
Antispam: Yes

Re: Trouble reading in flux

Post by barnburnr »

Peter,

Thanks for the quick reply! I am now trying to run everything in one sif file using the option you gave. Just to show you how much of a newbie I really am, I've attached the sif file and the output. Now I'm running into a seg fault at the beginning of the second AdvectionDiffusion time step. The only thing being shown in my .res output file are the results of HeatEquation (which are correct). There are no flux or concentration results even if I set the number of time steps to 1. This leads me to believe that I have something wrong with my setup. Any hints? Also, if you would, let me know if I'm doing anything else unorthodox.

Best,
Kevin
Attachments
output.txt
(6.67 KiB) Downloaded 309 times
transport.sif
(3.28 KiB) Downloaded 341 times
hazelsct
Posts: 153
Joined: 05 Oct 2009, 17:02
Location: Boston, MA, USA
Contact:

Re: Trouble reading in flux

Post by hazelsct »

Hold on: you're trying to use the heat flux as a convection velocity? How is this physically relevant/realistic?
barnburnr
Posts: 9
Joined: 15 Jun 2011, 19:43
Antispam: Yes

Re: Trouble reading in flux

Post by barnburnr »

Good question. I am using the heat equation to calculate a potential field and the derivative of that potential gives me the velocity. This is common in applications concerned with laminar flow in porous media (Darcy's Law). The velocity can then be used to compute transport (like with the ADE). As Peter has pointed out, this could also be solved using Richard's equation with full saturation.
Post Reply