Adding additional parameters to Case_Def.xml

edited October 2015 in Old versions
Hi,

I'm trying to implement an interparticle cohesion/adhesion model into DualSPHysics in an effort to simulate surface tension effects. I've got the code working when I hard-code the parameters of the model directly into the source code, but I'm getting annoyed with having to recompile each time I want to change the parameters. I'd like to be able to define a new node in the Case_Def.xml file under <<constantsdef>> which will hold the value of the surface tension coefficient, but I'm running into trouble. Running the code gives the following error:

*** Exception (JXml::ErrReadElement)
Text: Error reading xml: Some element is missing 'surftens'
File: CaseDropMerge_out/CaseDropMerge.xml(row:77)

Right now, when GenCase writes the Case.xml file, the new surface tension node shows up under <<constantsdef>>, i.e.:

<<constantsdef>>
<<lattice bound="1" fluid="1" />>
<<gravity x="0.0" y="0.0" z="-9.81" />>
<<cflnumber value="0.1" />>
<<hswl auto="true" value="0" />>
<<coefsound value="30.0" />>
<<coefficient value="2.0" />>
<<gamma value="7.0" />>
<<rhop0 value="1000.0" />>
<<surftens value="0.076" />> *****
<<eps value="0.5" />>
<</constantsdef>>

but the code does not add a new node under <<constants>> (which begins at line 77 of Case.xml). I had hoped that I could manually add the line <<surftens value="0.076">>, for example, to Case.xml and run DualSPHysics from there, but the problem is not so simple. Doing this, I get the error

*** Exception (JPartsLoad::LoadParticles)
Text: Data file does not match the configuration of the case
File: CaseDropMerge_out/CaseDropMerge.bi2

My attempt so far consists in looking through JPartData.h, JPartData.cpp, JSpaceCtes.h, JSpaceCtes.cpp, JSph.h, and JSph.cpp, and essentially copying what you guys have done for the other constants (coefsound, coefficient, gamma, rhop0, etc.); but obviously I've missed something. Any advice on how to proceed?

Thanks in advance,
Mitch Sullivan

P.S.: I should mention that I'm using the CPU version of the code

Comments

  • Dear user

    The best option is that you include your values in <<parameters>>
    and your read from that the values... you can mimic the use of kernel or visco....

    Regards
  • Ok, I will try that. Thank you for the quick response
Sign In or Register to comment.