Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Importing a depth dependant variable

Please login with a confirmed email address before reporting spam

I have output a text file from a model where I simulate laminar flow through a vertical cylinder. The output text file contains three columns; r, z and shear stress (defined in model). I only need z and shear stress.

I am now running a second solid mechanics deformation model, where I would like to input the shear stress profile as a boundary load along a similar cylinder.

I am able to input a variable for my boundary load. However, I do not know how to import my shear stress depth profile such that I can use it as this variable.

Is it possible to do this?

1 Reply Last Post Aug 14, 2017, 7:57 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Aug 14, 2017, 7:57 a.m. EDT
Updated: 7 years ago Aug 14, 2017, 10:00 a.m. EDT
I have solved the problem. This is what I did.

I wrote a quick script to remove the first column of my text file. In this line I also shift the second column (z) by a certain value, to account for the difference in z between my flow model and deformation model:

awk -v s=$depth_offset '{print $2+s, $3s}' "$filename".txt > "$filename"_2c.txt

Following this, I loaded this data using global definitions > interpolation. One can plot the data at this point to make sure it looks as it should.

From here, I created a variable for my shear stress as a function of depth:

int1(z)

Please note that int1 is the function name given during the interpolation.

I then assigned the variable to my boundary load.
I have solved the problem. This is what I did. I wrote a quick script to remove the first column of my text file. In this line I also shift the second column (z) by a certain value, to account for the difference in z between my flow model and deformation model: awk -v s=$depth_offset '{print $2+s, $3s}' "$filename".txt > "$filename"_2c.txt Following this, I loaded this data using global definitions > interpolation. One can plot the data at this point to make sure it looks as it should. From here, I created a variable for my shear stress as a function of depth: int1(z) Please note that int1 is the function name given during the interpolation. I then assigned the variable to my boundary load.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.