save additional variable saveline

Numerical methods and mathematical models of Elmer
Post Reply
Daniela
Posts: 18
Joined: 21 Sep 2010, 16:51

save additional variable saveline

Post by Daniela »

hello there,

I want to save additional values on my boundaries, for example the partial derivative of the velocity in x and y direction (delvx/delx and delvy/dely).
But I don't know how i can get saveline to actually save my user defined variables.

I used this:

Code: Select all

Solver 3
procedure = "SaveData" "SaveLine"
fileName = "delU.sl"
Exec Solver = After Simulation
Variable 1 = coordinate 1
Variable 2 = coordinate 2 
Variable 3 = pressure
Variable 4 = TMAC
Variable 5 = DvelocityXDx
Variable 6 = DvelocityYDy
end
but I get onlythe coordinates and the pressure.

My boundary condition looks like this:

Code: Select all

Boundary Condition 1
target boundaries = 3
Normal-Tangential Velocity = True
Flow Force BC = True
velocity 1 = 0
Slip Coefficient 2 = Variable temperature,pressure
Procedure "./slipCoeff" "slipCoeff"
Heat Flux BC = true
pressure 2 = variable temperature
Procedure "/thermalCreep2D" "thermalCreep"
Heat Transfer Coefficient = Variable temperature, pressure
Procedure "heatTransCoeff" "heatTransCoeff"
External Temperature = 313
DvelocityDx = Variable temperature
 Real Procedure "delUx" "delUx"
DvelocityDy = Variable temperature
 Real Procedure "delUy" "delUy"
TMAC = Real 1
TAC = Real 1.0
save line = true
end
Do you have an Idea what I did wrong?

thanks,
Daniela
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: save additional variable saveline

Post by Juha »

Hi,

the defintion of a boundary condition parameter does not by itself create field variables,
which is what the "Variable" for SaveLine refers to. There is, however, a "solver" called
"SaveBoundaryValues" which can be used here:

Solver n
Equation = "save bc params"
Procedure = "SaveData" "SaveBoundaryValues"
Parameter 1 = string x
...
End

such that a BC parameter "x" (say) will end up as a field variable which then may be referred to in the
SaveLine solver "Variable" defintion. The "SaveBoundaryValues" solver should execute before "SaveLine"
solver, i.e. make the n in "Solver n" smaller than the corresponding number in "SaveLine" solver.

The SaveLine could of course evaluate and output such BC parameters directly too. This is not
an existing option at the moment though, i'm afraid.

Regards, Juha
Daniela
Posts: 18
Joined: 21 Sep 2010, 16:51

Re: save additional variable saveline

Post by Daniela »

Hello Juha,

it works,

I tried the "saveBoundaryValues" but I couldn't get it working correctly.

Thanks a lot,

Daniela
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: save additional variable saveline

Post by Juha »

Hi Daniela,

i'm a bit confused. What did work and what did not?
Regads, Juha
Daniela
Posts: 18
Joined: 21 Sep 2010, 16:51

Re: save additional variable saveline

Post by Daniela »

Hi Juha,

I'm so sorry,

I should have added I tried using "saveBoundaryValues" before I started this topic and it didn't work.

But now the program is working, although the part I added doesn't work properly, but I'm pretty sure I'm going to fix that.

So thanks a lot for your help,

Daniela
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: save additional variable saveline

Post by raback »

Hi

One small hint: if you skip the 'Variable i = ...' definitions in SaveLine all the variables will be saved and they are names in the *.names file. This is often quite ok, since the line file is typically rather small anaway.

-Peter
Post Reply