A device for filling with, or bleeding off, gas from a tank comprising an electronic facility for data acquisition, storage and processing and a transfer pipe that comprises a control valve that is connectable to the tank being filled with gas or from which gas is being bled off, the electronic facility for data acquisition, storage and processing comprising a computer or microprocessor, said facility piloting a transfer of gas between the source and the tank, wherein:
- the electronic facility for data acquisition, storage and processing is programmed with logic to calculate at least one temperature of the tank selected from the group consisting of:
- an average temperature of a wall of the tank Twall,average(r,t) according to its thickness (radius r) and as a function of time (t),
- a maximum temperature reached in a thickness of the tank Twall,max(t) as a function of time, and
- a minimum temperature reached in the thickness of the tank Twall,min(t) as a function of time;
- the electronic facility for data acquisition, storage and processing is further programmed with logic to act upon the control valve to regulate an inlet flow rate of the gas into the tank, a bleed off flow rate of the gas out of the tank, and/or an temperature of the gas used to fill the tank, thereby preventing the pressurized tank from reaching a determined high temperature threshold or a determined low temperature threshold;
- and
- the regulation of the inlet flow rate of the gas into the tank, the bleed off flow rate of the gas out of the tank, and/or the temperature of the gas used to fill the tank is carried out as a function of said at least one calculated temperature of the tank.