Delphi 7 e Código com Chamadas...

21/05/2018

1

Boa noite Natanael Ferreira, conseguiu encontrar algum erro na procedure que lhe enviei? Estou lhe enviando a chamada do programa a esta procedure e às procedures que antecedem a chamada desta. A procedure fica em uma DLL que criei para comportá-la e às demais procedures do exemplo em questão. Por favor, não deixe de me dar uma resposta. Fico no aguardo de seus comentários, atenciosamente, Edisson Sávio.

BEGIN

{ Main part of this program }

{ Reading the main variables to start the code }

Reading_data(imax,jmax,a_char,xyn,General,Physical_properties,Algorithm,Computational,Air);

{ Calculation of the cell volumes }

Volumes(imax,jmax,xyn,Vol);

{ Calculation of surface areas and normal vectors }

Areas_and_Normal_Vectors(imax,jmax,xyn,S,Normal);

{ Calculation of the reference length }

Characteristic_Length(imax,jmax,xyn,ds);

{ Define the gas properties and the stoichiometric coefficients }

{ Thermal equilibrium and chemical non-equilibrium }

IF (General.Formulation = TECNE) THEN

BEGIN

Gas_Properties_5_Species_TECNE(Air,a_char,Tref,Properties);
Stoichiometric_Coefficients_5_Species_TECNE(nis);

END;

{ Thermochemical non-equilibrium }

IF (General.Formulation = TCNE) THEN

BEGIN

{ Five species chemical model }

IF (General.Gas_model = Five_Species_Chemical_Model) THEN

BEGIN

Gas_Properties_5_Species_TCNE(Air,a_char,Tref,Properties);
Stoichiometric_Coefficients_5_Species_TCNE(nis);

END;

END;

{ Initial condition of the code }

IF (General.Initial = Restart) THEN

BEGIN

{ Start from a condition of restart }

Restart_and_Parameters(imax,jmax,a_char,General,Physical_properties,Algorithm,N_aux,Q,Temperatures,Max_Res,Air,Computational);
index := Computational.Iter+General.Iterations_to_Saving;

END

ELSE

BEGIN

{ Five species chemical model in chemical non-equilibrium }

IF (General.Formulation = TECNE) THEN

BEGIN

{ Start from an initial condition }

Initial_Condition_5_Species_TECNE(imax,jmax,a_char,Tref,Properties,Physical_properties,General,Q,Air);

{ Test to employ turbulence model }

IF (General.Flow = Turbulent_Flow) THEN

CASE General.Turbulence OF

Coakley_1983 : BEGIN

{ Turbulence model of Coakley (1983) }

Initial_Conditions_to_Coakley_1983(imax,jmax,Physical_properties,General,Q);

END;

Wilcox_1988,
Yoder_Georgiadids_and_Orkwis_1996,
Coakley_1997,
Rumsey_Gatski_Ying_and_Bertelrud_1998 : BEGIN

{ For other models, apply the Wilcox (1988) initial condition }

Initial_Conditions_to_Wilcox_1988(imax,jmax,Physical_properties,General,Q);

END;

END;

END;

{ Thermochemical non-equilibrium }

IF (General.Formulation = TCNE) THEN

BEGIN

{ Five species chemical model in thermochemical non-equilibrium }

IF (General.Gas_model = Five_Species_Chemical_Model) THEN

BEGIN

{ Start from an initial condition }

Initial_Condition_5_Species_TCNE(imax,jmax,a_char,Tref,Properties,Physical_properties,General,Q,Air);

{ Test to employ turbulence model }

IF (General.Flow = Turbulent_Flow) THEN

CASE General.Turbulence OF

Coakley_1983 : BEGIN

{ Turbulence model of Coakley (1983) }

Initial_Conditions_to_Coakley_1983(imax,jmax,Physical_properties,General,Q);

END;

Wilcox_1988,
Yoder_Georgiadids_and_Orkwis_1996,
Coakley_1997,
Rumsey_Gatski_Ying_and_Bertelrud_1998 : BEGIN

{ For other models, apply the Wilcox (1988) initial condition }

Initial_Conditions_to_Wilcox_1988(imax,jmax,Physical_properties,General,Q);

END;

END;

END;

END;

{ General data }

Computational.Iter := 0;

IF (General.Saving = Yes) THEN

index := General.Iterations_to_Saving;

END;

{ Initial condition to the Maxwell equations }

IF (General.Magnetic = Gaitonde_1999) THEN

Magnetic_Initial_Conditions(imax,jmax,Physical_properties,General,Q);

{ For TECNE formulation }

IF (General.Formulation = TECNE) THEN

BEGIN

{ Temperature in the field }

Field_Temperatures_5_Species_TECNE(imax,jmax,a_char,Tref,Computational,Physical_properties,General,Properties,Air,Q,Temperatures);

{ Ratio of specific heats }

Ratio_of_Specific_Heats(imax,jmax,a_char,Q,Temperatures,Properties,g_mixt);

END;
Responder

Post mais votado

22/05/2018

Tenta revisar sua dll - Five_Species_TECNE_Library

PROCEDURE Field_Temperatures_5_Species_TECNE(imax,jmax:INTEGER;a_char,Tref:DOUBLE;Computational:Computational_data;Physical_properties:Physical_data;General:General_data;Properties:SPEC1;Air:SPEC3;Q:TYPE1;VAR Temperatures:TYPE13); export;

{ This procedure calculates the translational/rotational temperature of the field to all volumes of the computational }
{ mesh. The initial temperature is estimated by the problem's initial  condition.  Posteriorly,  the  state  equation }
{ involving mixture total energy, mixture internal energy, mixture Cartesian velocity  components,  and  the  mixture }
{ formation enthalpy is employed. From the definition of the internal energy [ei = Cv(mixt).(T-Tref)], an  expression }
{ for the translational/rotational temperature is obtained. The thermal equilibrium is admited; Due  to  the  thermal }
{ equilibrium hypothesis, the equality of translational and rotational temperatures is assumed  and  any  vibrational }
{ mode is not considered. It is a strong hypothesis, but as initial study is  valid.  The  translational / rotational }
{ temperature is redefined when the magnetic option is active. The Z energy variable should  be  considered  together }
{ with the modulus of the magnetic field. }

TYPE

    TYPE20 = ARRAY[1..14] OF DOUBLE;
    Primitive_Variables = ^TYPE20;

VAR

   f1 : TEXTFILE;
   i,j : INTEGER;
   Primitive : Primitive_Variables;
   Mi_Mag,Cv_mixt,dhf_mixt : ^DOUBLE;

{  Order of Primitive variables }

{  Primitive^[1] = Den; }
{  Primitive^[2] = u; }
{  Primitive^[3] = v; }
{  Primitive^[4] = Z; }
{  Primitive^[5] = Bx; }
{  Primitive^[6] = By; }
{  Primitive^[7] = B; }
{  Primitive^[8] = En; }
{  Primitive^[9] = cs1; }
{  Primitive^[10] = cs2; }
{  Primitive^[11] = cs3; }
{  Primitive^[12] = cs4; }
{  Primitive^[13] = cs5; }
{  Primitive^[14] = ei_int; }

BEGIN

{    Main part of this procedure }

     ASSIGNFILE(f1,'TEMPERATURAS.DAT');
     REWRITE(f1);

{    Defining pointer }

     NEW(Primitive);
     NEW(Mi_Mag);
     NEW(Cv_mixt);
     NEW(dhf_mixt);

{    Volume temperatures }

     FOR i := 1 TO (imax-1) DO

         FOR j := 1 TO (jmax-1) DO

             BEGIN

{                 Volume temperatures at the first iteration determined by the initial condition }

                  IF (Computational.Iter = 0) THEN

{                    Nondimensionalized initial temperature of each volume }

                     Temperatures[i,j,1] := Physical_properties.Temperature/a_char+Tref

                  ELSE

{                     For the other iterations... }

                      BEGIN

{                          Five species model composed of N, O, N2, O2, and NO. }

                           Primitive^[1] := Q[i,j,1];
                           Primitive^[2] := Q[i,j,2]/Q[i,j,1];
                           Primitive^[3] := Q[i,j,3]/Q[i,j,1];

{                          Calculation of the mass fractions }

                           Primitive^[9] := Q[i,j,5]/Q[i,j,1];
                           Primitive^[10] := Q[i,j,6]/Q[i,j,1];
                           Primitive^[12] := Q[i,j,7]/Q[i,j,1];
                           Primitive^[13] := Q[i,j,8]/Q[i,j,1];
                           Primitive^[11] := 1.0E0-(Primitive^[9]+Primitive^[10]+Primitive^[12]+Primitive^[13]);

{                          Calculation of the mixture specific heat at constant volume }

                           Cv_mixt^ := Primitive^[9]*Properties[1].Heat+Primitive^[10]*Properties[2].Heat+Primitive^[11]*Properties[3].Heat+Primitive^[12]*Properties[4].Heat+Primitive^[13]*Properties[5].Heat;

{                          Calculation of the mixture formation enthalpy }

                           dhf_mixt^ := Primitive^[9]*Properties[1].Enthalpy+Primitive^[10]*Properties[2].Enthalpy+Primitive^[11]*Properties[3].Enthalpy+Primitive^[12]*Properties[4].Enthalpy+Primitive^[13]*Properties[5].Enthalpy;

{                          Considering or not the magnetic effect }

                           IF (General.Magnetic = Gaitonde_1999) THEN

                              BEGIN

{                                  Considering magnetic field }

                                   Primitive^[4] := Q[i,j,4]/Q[i,j,1];
                                   Primitive^[5] := Q[i,j,13];
                                   Primitive^[6] := Q[i,j,14];
                                   Primitive^[7] := SQRT(Primitive^[5]*Primitive^[5]+Primitive^[6]*Primitive^[6]);
                                   Mi_Mag^ := 1.0E0;

{                                  Internal energy considering magnetic field }

                                   Primitive^[14] := Primitive^[4]-dhf_mixt^-0.5E0*(Primitive^[2]*Primitive^[2]+Primitive^[3]*Primitive^[3])-0.5E0*Air.Rb*(Primitive^[7]*Primitive^[7])/(Mi_Mag^*Primitive^[1]);

                              END

                           ELSE

                               BEGIN

{                                   Magnetic field is not considered }

                                    Primitive^[8] := Q[i,j,4];

{                                   Internal energy without magnetic field actuation }

                                    Primitive^[14] := Primitive^[8]/Primitive^[1]-dhf_mixt^-0.5E0*(Primitive^[2]*Primitive^[2]+Primitive^[3]*Primitive^[3]);

                               END;

{                          Mixture translational/rotational temperature }

                           Temperatures[i,j,1] := Primitive^[14]/Cv_mixt^+Tref;

                      END;

                  WRITELN(f1,Temperatures[i,j,1]);

             END;

{    The volume's temperatures are determined by the above calculations }

     CLOSEFILE(f1);

     DISPOSE(Primitive);
     DISPOSE(Mi_Mag);
     DISPOSE(Cv_mixt);
     DISPOSE(dhf_mixt);

END;
Responder

Mais Posts

22/05/2018

P2

Bom dia.
Mais uma vez tentei debugar seu código.
Obtive erro do depurador.


75c935e1 8bf8 mov edi,eax

Se o código fonte foi desenvolvido por você, acredito que não terá problemas para resolve-lo
https://stackoverflow.com/questions/8824937/what-does-eax-have-after-mov-eax-dword-ptr-edi
Responder