Search
Close this search box.
Notifications
Clear all

Problem in using USDFLD subroutine

3 Posts
3 Users
0 Reactions
896 Views
Posts: 11
Topic starter
(@artiger)
Active Member
Joined: 15 years ago

Hello

I have modeled a cantilever beam under gravity loads, and I have used the USDFLD subroutine to determine the density of material as a function of x coordinate value corresponding to each material point (field(1)). But it seems that the USDFLD subroutine does not work, and the value of density corresponding to the first row of the field variable is assigned to all material points. I would be so grateful if anyone can help me.

The USDFLD subroutine and input file of model have been attached.

SUBROUTINE USDFLD(FIELD,STATEV,PNEWDT,DIRECT,T,CELENT,

1 TIME,DTIME,CMNAME,ORNAME,NFIELD,NSTATV,NOEL,NPT,LAYER,

2 KSPT,KSTEP,KINC,NDI,NSHR,COORD,JMAC,JMATYP,MATLAYO,

3 LACCFLA)

C

INCLUDE ABA_PARAM.INC

C

CHARACTER*80 CMNAME,ORNAME

CHARACTER*3 FLGRAY(15)

DIMENSION FIELD(NFIELD),STATEV(NSTATV),DIRECT(3,3),

1 T(3,3),TIME(2)

DIMENSION ARRAY(15),JARRAY(15),JMAC(*),JMATYP(*),

1 COORD(*)

x=coord(1)

FIELD(1)=x

RETURN

END

*Heading

** Job name: Job-1 Model name: Model-1

** Generated by: Abaqus/CAE 6.14-1

*Preprint, echo=NO, model=NO, history=NO, contact=NO

**

** PARTS

**

*Part, name=Part-1

*End Part

**

**

** ASSEMBLY

**

*Assembly, name=Assembly

**

*Instance, name=Part-1-1, part=Part-1

*Node

1, 0., 0.

2, 0.200000003, 0.

3, 0.400000006, 0.

4, 0.600000024, 0.

5, 0.800000012, 0.

6, 1., 0.

7, 1.20000005, 0.

8, 1.39999998, 0.

9, 1.60000002, 0.

10, 0., 0.0799999982

11, 0.200000003, 0.0799999982

12, 0.400000006, 0.0799999982

13, 0.600000024, 0.0799999982

14, 0.800000012, 0.0799999982

15, 1., 0.0799999982

16, 1.20000005, 0.0799999982

17, 1.39999998, 0.0799999982

18, 1.60000002, 0.0799999982

*Element, type=CPS4R

1, 1, 2, 11, 10

2, 2, 3, 12, 11

3, 3, 4, 13, 12

4, 4, 5, 14, 13

5, 5, 6, 15, 14

6, 6, 7, 16, 15

7, 7, 8, 17, 16

8, 8, 9, 18, 17

*Nset, nset=Set-1, generate

1, 18, 1

*Elset, elset=Set-1, generate

1, 8, 1

** Section: Section-1

*Solid Section, elset=Set-1, material=Mat1

0.01,

*End Instance

**

*Nset, nset=Set-1, instance=Part-1-1

1, 10

*Elset, elset=Set-1, instance=Part-1-1

1,

*Nset, nset=Set-11, instance=Part-1-1, generate

1, 18, 1

*Elset, elset=Set-11, instance=Part-1-1, generate

1, 8, 1

*End Assembly

**

** MATERIALS

**

*Material, name=Mat1

*Density, dependencies=1

3925., , 0.

5676.57, , 0.1

6064.37, , 0.3

6538.04, , 0.5

7116.57, , 0.7

7823.19, , 0.9

8686.27, , 1.1

9740.42, , 1.3

11028., , 1.5

11775., , 1.6

*Depvar

1,

*Elastic

2e+11, 0.3

*User Defined Field

**

** BOUNDARY CONDITIONS

**

** Name: BC-1 Type: Displacement/Rotation

*Boundary

Set-1, 1, 1

Set-1, 2, 2

** ----------------------------------------------------------------

**

** STEP: Step-1

**

*Step, name=Step-1, nlgeom=NO

*Static

0.1, 1., 0.1, 0.1

**

** LOADS

**

** Name: Load-1 Type: Body force

*Dload

Set-11, BY, -9.81

**

** OUTPUT REQUESTS

**

*Restart, write, frequency=0

**

** FIELD OUTPUT: F-Output-1

**

*Output, field, variable=PRESELECT

**

** HISTORY OUTPUT: H-Output-1

**

*Output, history, variable=PRESELECT

*End Step

Topic Tags
2 Replies
Posts: 3998
(@jorgen)
Member
Joined: 5 years ago

Debugging a user-subroutine is always time consuming and I unfortunately dont have the time 🙁

I recommend adding print statements to figure out what is going on.

-Jorgen

Topic Tags
2 Replies
Posts: 2
 rok
(@rok)
New Member
Joined: 9 years ago

Hi,

your problem is density itself, not the subroutine.

You cannot change it during your analyses with most types of elements (in Explicit, for instance, only acoustic elements).

Put all the nodes with a certain x coordinate in a precise set (i.e. B0, B1, etc) and add this to your inp file:

*INITIAL CONDITIONS, TYPE=FIELD, VARIABLE=1

B0, 0.

B1, 0.1

B2, 0.5

B3, 0.7

etc

It should work.

The problem is that you have to organise all the nodes in this way and it can be quite boring.

I hope someone else can help us to find another way.

Gabriele

Reply
Share: