FEAP User Forum
FEAP => Programming => Topic started by: markus_h on April 11, 2021, 02:32:36 AM
-
Dear Feap-Community
I want to modell the evaporation of a solid material with a thermal simulation.
To modell the evaporation process, i want to keep the temperature fixed once it reaches a certain value (the evaporation-temperature).
Then I want all excess thermal energy to go towards the evaporation process until the needed amount of energy has been collected.
I want to setup my modell with 2 DOFs per node, the temperature and an evaporation-counter going from 0 at the start to 1 when fully evaporated.
At any given time only one of these DOFs shall be active at each node, based on wether or not the evaporation temperature has been reached locally.
Before reaching this temperature-value my evaporation-counter has to be constrained and after reaching it the Temperature should be constrained.
Currently i am using the 1st Equation at each node for the Energy-Conservation-Law.
The 2nd equation constrains one of my nodal DOFs, so it is just:
temperature_node=temperature_evaporation
or
evaporation-counter_node= <maximum-value of the evaporation-counter since t_0>
This works for me as intended, I am just wondering if there is a better way to implement this.
So my questions are:
Currently I am using double the number of Equations i would need in theory.
It would be great to only have one equation for each node and constrain the required DOF in another way.
Is there a better way to constrain or deactivate a DOF for a node at runtime of the simulation?
I also wanted to try to switch the constrained DOF during the Newton-Raphson-Iteration and not just before each timestep.
However in this case FEAP ended the Newton-method too soon.
Is there a flag that can be set to tell feap, that the Newton-method is not supposed to finish in this iteration?
Best Regards
-
First, PARTitions allow you to set which equation is active during a solution step.
I am not quite sure what you mean by not completing a Newton iteration step. Just where do you want to interrupt the solution process?
If you use the solution steps
TANG
FORM
SOLV
instead ot TANG,,1 -- then you could write some macro commend of your own to check the interrupts and use an IF-ELSE-ENDI to skip steps.
You could have your module set a parameter - say parameter 'sk' to appropriate values for the IF tests.
-
You also can control the loop by set ljump (ldata.h) in your user macro.
-
Thank you for the replies.
The PARTition-command was not exactly what i was looking for, since i want to decide on the active DOFs for each node individually.
So at a given time-step for some nodes i want the temperature to be fixed and the Phase-Counter to be free and for the rest of the nodes the exact opposite. From my understanding of the manual, the PARTition command sets active DOFs globally for all nodes.
However it may still be useful for me.
I will see if I can maybe implement some sort of Correction-Step for my second DOF.
The solution steps i used where:
LOOP INFInite !time loop
Time
LOOP iter 8 !Newton-method-loop
UTANgent,,1
NEXT iter
Next
And in my example the Newton iteration finished after 3 steps even though i wanted it to continue. (because i had just switched the active DOF at one node).
So i am looking for a flag to tell feap to do another step of the Newton-method even if the convergence-criterium has been met (the opposite behavior of the ljump-flag).
I would basically like to implement a custom necessary condition, which needs to be fulfilled before the Newton-method is considered finished by feap and breaks the "LOOP iter 8"
Thank you very much
-
The check on convergence is performed in ./program/pmacr1.f -- and is controlled by the value of 'aengy' and 'rnorm' -- If when you change a dof you reset these to sufficiently large values it should continue to iterate.
If this does not work you need to provide a bit more information on how you are changing things for each dof -- that is are you redefining information in the ID/EQ arrays to redefine the algebraic equations or something else.
-
Maybe you are interested in uprofil.f, where you can modify the relation between global equations and nodal DOFs for each individual node.
I guess that you can enable and disable the DOFs there as you want.
If you have a user macro in your Newton loop which checks when to enable/disable a DOF then you can reset the reference values for the convergence test as Prof. Taylor has mentioned:
LOOP iter 8 !Newton-method-loop
UMACRXXX
UTANgent,,1
NEXT iter
In order to leave the time loop at a certain time point, you can use the additional parameters of the TIME command to define a maximum time.
-
Thank you for your replies,
I will try to modify the control values of the convergence-criterium.
Currently i am "constraining" a DOF by having a row in my element-tangent-matrix consists of all 0s, except for the DOF i want to constrain, which has a 1. In the residual of my element i put the desired value i want my constrained DOF to have.
So my element tangent matrix S would look like this:
N1,T N1,P, N2,T N2,P ... Nnel,T Nnel,P
N1,T <normal linear heat-flow>
N1,P 0 1 0 0 0 0
N2,T <normal linear heat-flow>
N2,P 0 0 1 0 0 0
...
Nnel,T <normal linear heat-flow>
Nnel,P 0 0 0 0 0 1
where T is my DOF corresponding to the Temperature and P is the DOF corresponding to the evaporation counter.
In this example I would want to constrain the Temperature of N2 because it has reached the evaporation temperature, and constrain the evaporation counter of N1 because it has not yet reached the evaporation temperature.
The physical unit of the equation of the 2nd ndf changes, (from Kelvin when constraining the Temperature to unit-less when constraining the evaporation counter)
So I can imagine this causing problems for the Convergence-Criterium if i switch during the Newton-method.
Kind regards