Skip to content
TheChatArchiveThe Chat Archive
grok-3-mini-beta· xAIHugging Face LMArena Human Preference 140K

What are some important components that should be included in a system prompt for an LLM…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Geminigemini-2.5-pro’s answer.
  1. User

    What are some important components that should be included in a system prompt for an LLM that will be used as an OpenFOAM CFD Assistant that will help users setup and execute Steady State Port Flow (SSPF) cases in OpenFOAM and post-processing and analyzing them in Paraview. Please consider all aspects of the requirements and provide useful information for the creation of the system prompt. Avoid creating the system prompt - just provide useful parts or components of this work that may be beneficial to include in a system prompt. Also, at the end of your response, provide an example of a prompt to an LLM that could be used to create a system prompt for an OpenFOAM CFD Assistant for SSPF analysis

  2. Assistant

    Below, I'll outline key components that should be included in a system prompt for an LLM designed to function as an OpenFOAM CFD Assistant, specifically for Steady State Port Flow (SSPF) cases. This assistant would guide users through setting up and executing simulations in OpenFOAM, as well as post-processing and analyzing results in ParaView. I've focused on essential elements based on the requirements, drawing from aspects like role definition, domain-specific knowledge, user interaction guidelines, and best practices for accuracy and safety. These components are not exhaustive but provide a strong foundation to build a comprehensive system prompt.

    Important Components for the System Prompt

    1. Role and Expertise Definition:

      • Clearly define the AI's identity and primary function to establish context. For example, specify that the AI is an "expert assistant for OpenFOAM-based Computational Fluid Dynamics (CFD) simulations, with a focus on Steady State Port Flow (SSPF) cases." This helps the LLM stay in character and prioritize relevant responses.
      • Include the scope of expertise, such as familiarity with OpenFOAM's steady-state solvers (e.g., simpleFoam), mesh generation tools, and ParaView's visualization capabilities. Mention any limitations, like not being a replacement for professional engineering judgment.
    2. Domain-Specific Knowledge and Terminology:

      • Incorporate key concepts related to SSPF, such as steady-state assumptions, port flow dynamics (e.g., incompressible vs. compressible flows), boundary conditions (e.g., inlet velocity, outlet pressure), and solver settings (e.g., turbulence models like k-epsilon or k-omega).
      • Reference OpenFOAM-specific tools and workflows, including case directory structure (e.g., system, constant, and 0 directories), utilities like blockMesh for simple meshes or snappyHexMesh for complex geometries, and commands for running simulations (e.g., simpleFoam for SSPF).
      • For ParaView, include knowledge of relevant features like filters (e.g., Stream Tracer for flow visualization, Contour for pressure fields), data readers (e.g., OpenFOAM reader), and analysis tools (e.g., calculating flow rates or extracting line probes).
      • Emphasize best practices, such as ensuring mesh quality (e.g., checking for skewness), setting appropriate time steps (though SSPF is steady-state, iterations matter), and validating results against physical expectations.
    3. Step-by-Step Guidance Structure:

      • Instruct the AI to provide responses in a structured, sequential format, such as breaking down tasks into phases: (1) case setup (e.g., creating directories, defining geometry), (2) simulation execution (e.g., running the solver, monitoring convergence), (3) post-processing in ParaView (e.g., loading data, applying filters), and (4) analysis (e.g., interpreting velocity fields, pressure drops, or flow uniformity).
      • Encourage the use of clear, actionable language, including code snippets, command-line examples, and warnings for common pitfalls (e.g., "Ensure your mesh is refined near the ports to capture boundary layer effects").
      • Suggest including checklists or verification steps, like running checkMesh in OpenFOAM or verifying convergence criteria.
    4. User Interaction and Customization Guidelines:

      • Specify how the AI should adapt to different user levels, e.g., providing beginner-friendly explanations for novices (with basic CFD concepts) while offering advanced tips for experienced users (e.g., optimizing solver parameters for specific hardware).
      • Promote interactive responses, such as asking clarifying questions if user inputs are vague (e.g., "What type of geometry are you using for your SSPF case?") or suggesting follow-up actions.
      • Include instructions for handling queries about related tools, like integrating with pre-processors (e.g., Salome or Gmsh for mesh generation) or post-processors beyond ParaView.
    5. Safety, Ethics, and Error Handling:

      • Emphasize safety protocols, such as advising users to work on backed-up files, use appropriate computational resources to avoid crashes, and avoid simulations that could lead to unsafe real-world applications (e.g., disclaimer: "This is for educational or simulation purposes only; validate results with physical experiments").
      • Cover common errors and troubleshooting, like diagnosing non-converging simulations (e.g., adjusting under-relaxation factors) or ParaView issues (e.g., incorrect data loading), and guide users toward resources like OpenFOAM documentation or forums.
      • Reinforce ethical guidelines, such as not encouraging piracy of software and promoting accurate, evidence-based advice.
    6. Response Format and Output Best Practices:

      • Direct the AI to use consistent formatting for readability, such as:
        • Code blocks for OpenFOAM commands (e.g., fenced with ```bash).
        • Bullet points or numbered lists for steps.
        • Visual aids like simple ASCII diagrams for geometry setups.
      • Limit response length to avoid overwhelming users, suggesting concise answers with options for more details.
      • Encourage cross-referencing reliable sources, like the OpenFOAM user guide or ParaView tutorials, to build user trust.
    7. Performance and Optimization Tips:

      • Include advice on efficiency, such as parallel processing in OpenFOAM (e.g., using MPI for large SSPF cases) or optimizing ParaView workflows (e.g., using LOD for large datasets).
      • Highlight SSPF-specific optimizations, like selecting appropriate discretization schemes (e.g., second-order for accuracy) or monitoring residuals for convergence.
    8. Integration and Extensibility:

      • Mention how the AI can interface with other tools or workflows, such as scripting in Python for automation (e.g., using PyFoam for OpenFOAM case management) or exporting ParaView data for further analysis in tools like MATLAB.
      • Allow for extensibility, e.g., enabling the AI to handle variations of SSPF cases, like those involving heat transfer or multi-phase flows, if relevant.

    By incorporating these components, the system prompt can ensure the LLM provides accurate, helpful, and contextually appropriate assistance while minimizing risks like misinformation or inefficient guidance.

    Example Prompt for Creating a System Prompt

    Here's an example of a prompt you could use with an LLM (like GPT-4) to generate a full system prompt based on the components above:

    "Create a detailed system prompt for an AI assistant that specializes in OpenFOAM CFD simulations for Steady State Port Flow (SSPF) cases. The assistant should help users with setting up cases, executing simulations in OpenFOAM, and performing post-processing and analysis in ParaView. Include the following elements: a clear role definition, key domain knowledge (e.g., OpenFOAM utilities like simpleFoam and ParaView tools like Stream Tracer), step-by-step guidance instructions, safety and error-handling guidelines, response formatting best practices, and tips for user interaction. Ensure the prompt is comprehensive but concise, and emphasize accuracy and ethical considerations."

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.