Re: Saving results & restarting
Posted: 04 Mar 2014, 16:20
Hi,
I just came by chance accross this old post. I have experienced recently the same issue:
I do a run, where I use the Navier-Stokes Solver and calculate the loads. Then I restart from this, and in my second run I am not running Navier-Stokes, I only need the loads. The userfunction which uses them can't find them. They are not found in Model % Variables anymore (see code below, I get the error message 'Need >Calculate Loads = Logical True<. Flow Load not found').
So apparently FlowLoads are saved during the restart, but are not found by Model % Variables unless the Navier-Stokes Solver is present in the sif-file.
I'm not sure if that is wanted?
Putting Navier-Stokes with Exec=Never in the sif-file works, and also saving the loads as variable and passing directly this variable to the userfunction helps (but the latter makes loosing the benefit of passing them automatically).
Martina
I just came by chance accross this old post. I have experienced recently the same issue:
I do a run, where I use the Navier-Stokes Solver and calculate the loads. Then I restart from this, and in my second run I am not running Navier-Stokes, I only need the loads. The userfunction which uses them can't find them. They are not found in Model % Variables anymore (see code below, I get the error message 'Need >Calculate Loads = Logical True<. Flow Load not found').
So apparently FlowLoads are saved during the restart, but are not found by Model % Variables unless the Navier-Stokes Solver is present in the sif-file.
I'm not sure if that is wanted?
Putting Navier-Stokes with Exec=Never in the sif-file works, and also saving the loads as variable and passing directly this variable to the userfunction helps (but the latter makes loosing the benefit of passing them automatically).
Martina
Code: Select all
! Get the Stokes loads
!---------------------------
FlowLoadsName = GetString( Model % Solver % Values , 'Flow Solver Name', GotIt )
IF (.NOT. GotIt) THEN
WRITE(FlowLoadsName,'(A)') TRIM(FlowSolutionName)//' Loads'
WRITE(Message,'(AA)') 'Using default name for flow solution: ', &
FlowLoadsName
CALL WARN(FunctionName,Message)
END IF
FlowLoadSol => VariableGet( Model % Variables, TRIM(FlowLoadsName) )
IF ( ASSOCIATED( FlowLoadSol ) ) THEN
FlowLoadPerm => FlowLoadSol % Perm
FlowLoadValues => FlowLoadSol % Values
ELSE
CALL FATAL(FunctionName,&
'Need >Calculate Loads = Logical True<. Flow Load not found')
END IF